Community
Participate
Working Groups
When renaming a field with "rename setter" option checked, only the name of a setter is changed. The parameter of setter stays with old variable name. It would be nice if setter parameter was changed to new name too. Example: Before refactoring i have: int a; public void setA(int a) { this.a = a; } --------- and after: int b; public void setB(int a) { this.b = a; }
*** Bug 65104 has been marked as a duplicate of this bug. ***
*** Bug 152168 has been marked as a duplicate of this bug. ***
*** Bug 108188 has been marked as a duplicate of this bug. ***
*** Bug 198026 has been marked as a duplicate of this bug. ***
I vote for this bug. Also @param JavaDoc annotations are corrupted after such renaming. In this example "foo" -> "bar": public class Fb { private String foo; /** * The constructor for creating Fb instance. * @param foo The foo. */ public Fb(String foo) { this.foo = foo; } /** @param foo The foo to set. */ public void setFoo(String foo) { this.foo = foo; } } public class Fb { private String bar; /** * The constructor for creating Fb instance. * @param bar The bar. */ public Fb(String foo) { this.bar = foo; } /** @param bar The bar to set. */ public void setBar(String foo) { this.bar = foo; } }
*** Bug 368625 has been marked as a duplicate of this bug. ***
Iam using Eclipse Version: 3.7.2 and this bug is still contained.
(In reply to comment #7) > Iam using Eclipse Version: 3.7.2 and this bug is still contained. Plz fix it soon.
Rudolf asked me where the code is. See RenameFieldProcessor in the org.eclipse.jdt.ui plug-in. Note that we will only accept a patch that ensures that the new parameter names doesn't conflict with existing local variables in the method and that updates all occurrences of the variables. Rename participants also need to be notified correctly, etc. The solution will probably look similar to RenameTypeProcessor.fUpdateSimilarElements et al., see http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=cff85fa69f762dac24e3aba194f9d675df7770ec Tests can go to RenamePrivateFieldTests (and resources are in /org.eclipse.jdt.ui.tests.refactoring/resources/RenamePrivateField/).
Maybe some other developer can help me. i have checked out the org.eclipse.jdt.ui plug-in from git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git and even found the files RenameFieldProcessor and RenamePrivateFieldTests :-) now, may problem are unresolved packages. for example line 35 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor; in RenamePrivateFieldTests with the message: "The import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor cannot be resolved" dunno how to handle it. maybe i get any help here.
(In reply to comment #10) > Maybe some other developer can help me. i have checked out the > org.eclipse.jdt.ui plug-in from > git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git and even found the files > RenameFieldProcessor and RenamePrivateFieldTests :-) > > now, may problem are unresolved packages. for example > > line 35 import > org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor; in > RenamePrivateFieldTests with the message: "The import > org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor cannot > be resolved" > > dunno how to handle it. maybe i get any help here. Maybe this helps: http://wiki.eclipse.org/JDT_UI/How_to_Contribute
tanks(In reply to comment #11) > (In reply to comment #10) > > Maybe some other developer can help me. i have checked out the > > org.eclipse.jdt.ui plug-in from > > git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git and even found the files > > RenameFieldProcessor and RenamePrivateFieldTests :-) > > > > now, may problem are unresolved packages. for example > > > > line 35 import > > org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor; in > > RenamePrivateFieldTests with the message: "The import > > org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor cannot > > be resolved" > > > > dunno how to handle it. maybe i get any help here. > > Maybe this helps: http://wiki.eclipse.org/JDT_UI/How_to_Contribute thanks for your comment. i checked git://git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git git://git.eclipse.org/gitroot/platform/eclipse.platform.text.git git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.git git://git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git out and have still the same message. The import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor cannot be resolved
*** Bug 454331 has been marked as a duplicate of this bug. ***