Community
Participate
Working Groups
Build 200310101454: When using the "Introduce parameters" refactoring on the expression "JAVADOC_PARAM_TAGS" and giving the new parameter the name "tags", the result looks as follows: protected final boolean isParameterTag(String[] tags) { if (fToken != null) { for (int index= 0; index < tags.length; index++) { if (fToken.equals(JAVADOC_PARAM_TAGS[index])) { fToken= null; return true; } } } return false; } The second occurrence of "JAVADOC_PARAM_TAGS" was obviously not replaced by the new parameter.
Introduce Parameter currently doesn't offer an option to replace all occurrences.
+1 here introduce param that replaced all occurences would be a powerful tool for making methods more reusable. i could even imagine a refactoring that would introduce params until a method could be turned into a static methods and moved to a reusable util class.
ha! this is a compination of extract temp + introduce param + inline temp observe: class A{ int fField; int doubleIt(){ return fField + fField; } void caller(){ int x= doubleIt(); } } now do extract temp: class A{ int fField; int doubleIt(){ int i= fField; return i + i; } void caller(){ int x= doubleIt(); } } intro param class A{ int fField; int doubleIt(int p){ int i= p; return i + i; } void caller(){ int x= doubleIt(fField); } } inline temp class A{ int fField; int doubleIt(int p){ return p + p; } void caller(){ int x= doubleIt(fField); } } now you have a reusable doubling method kinda slow but works.
*** Bug 68147 has been marked as a duplicate of this bug. ***
*** Bug 73659 has been marked as a duplicate of this bug. ***
*** Bug 118134 has been marked as a duplicate of this bug. ***
See also bug 102125, which handles this problem more generally
*** Bug 194139 has been marked as a duplicate of this bug. ***