Hi folks,
There is a kind of method signature refactoring I often use (manually) and
which is not (to my knowledge) included in IDEA. The goal of this
refactoring is to add a method parameter without disturbing any existing
code. This is similar to the add parameter refactoring in IDEA, but instead
of defining a default value to be used by callers, it uses a default value
in the method's class and an overloaded method which uses this default
value. For example :
before :
public void myMethod(AnOject o) {
// code here
}
after :
public final static int DEFAULT_MODE = /* default value in the refactored
method's class */;
public void myMethod(AnObject o, int mode) { // new method with added
parameter
// code here
}
public void myMethod(AnObject o) { // overloaded method, call the new
method with default parameter
myMethod(o, DEFAULT_MODE);
}
I also often use this refactoring with constructors. It's the exact same
process i.e. defining a default value and an overloaded constructor.
Do you people think this is a valuable refactoring ?
*****************************************************************************************
S- The information in this e-mail and any attachments is confidential and
is intended for the addressee only. Reading, copying, disclosure or
use by anybody else is not authorised. The contents do not represent
the opinion of Serono International S.A. or any of its affiliates except to the
extent that it relates to their official business. If you are not the
intended recipient, please delete this message and any attachments and
advise the sender by return e-mail.
******************************************************************************************
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features