One simple way to achieve that is to add a line where you call 
"StatusLine i_statusLine = getStatusLine();" at the top of your original 
method, then "extract method" on everything below it (which will force 
i_statusLine to be passed as a parameter if it is used in the block), 
and then "inline method" on the original method.  Is this too many 
steps?  (Or does it even make sense in your context?)

-- 
Alex Dommasch


Alain Ravet wrote:
> I want to replace a parameter - ui - by a more specific parameter - 
> ui.getStatusLine().
> 
> 
> from :
> ------
>     Button b = new Button (this, "text")
>     with
>         Button (JFrame i_frame, String i_text);
> 
> to :
> ------
>         Button b = new Button (this, this.getStatusLine(), "text").
>     with
>         Button (JFrame i_frame, StatusLine i_statusLine, String i_text);
> 
> (and later remove /i_frame/)
> 
> 
> 
> I asked "Change signature" to add the new parameter /
> 
>          type                 name                default value
> 
> ----------------------------------------------------------------------
>        StatusLine       -   i_statusLine       -  i_frame.getStatusLine()
> 
> 
> I expected IDEA to replace /i_frame/ by its value, and produce
> 
>         Button b = new Button (this, this.getStatusLine(), "text").
>                                      ^^^^
>                                      expected
> but I got
>         Button b = new Button (this, i_frame.getStatusLine(), "text").
>                                      ^^^^^^^^
>                                      WRONG
> 
> Should this be a separate refactoring, or a "Change Signature" 
> modification/option?
> 
> Alain Ravet
> 

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

Reply via email to