Hello Chris,

I'm not sure, whether you really mean "inlining". In your case
cut'n'paste will do it.

But inlining a *constant* makes sense. For example:

 private static final String TEXT = "hello world";

 public void print() {
   System.out.println(TEXT);
 }

should be refactored to:

 public void print() {
   System.out.println("hello world");
 }

Tom


On Wed, 25 Sep 2002 13:00:20 +0100, Chris Stevenson
<[EMAIL PROTECTED]> wrote:

> I am currently refactorng ugly GUI builder code which places all the GUI
> elements in the class as fields, and initialises them there.
> I want to be able to inline them, eg so that:
> 
> private JTextField jtextField234 = new JTextField();
> 
> private void guiInit() {
>      jtextField234.setText("Somthing");
> }
> 
> can be refactored to:
> 
> private void guiInit() {
>      JTextField jtextField234 = new JTextField();
>      jtextField234.setText("Somthing");
> }
> 
> Inline Field User Story:
> I want to be able to inline a field.
> 1. The field must only be referenced in one method, either in the
> constructor or a method called only from the constructor
> 2. the field will be inlined to the point just before it is first used.
> 
> Note that if the 'constructor only' requirement is not enforced some
> semantics may change after the refactoring - I wouldn't mind this but it
> might not be a Good Thing :-)
> 
> --
> Chris Stevenson
> [EMAIL PROTECTED]
> 
> 
> 

_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to