This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ JDK VERSION : 1.7.5 ] Given the follow class: public class Issue { private String abcd; public String getAbcd() { return abcd; } private void setAbcd(String abcd) { this.abcd = abcd; } } 1. Put the cursor at 'abcd' field; 2. Go to Refactor > Rename and rename it to 'abcde' and mark option 'Rename Getters and Setters' the result is that the field is renamed but the getter/setter is not. If you try it when both get/set are public, it works fine but the expected behaviour is that it should work even if both are private.
Product Version: NetBeans IDE 7.2 (Build 201206291011) Java: 1.7.0_05; Java HotSpot(TM) Client VM 23.1-b03 System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; en_US (nb)
Created attachment 121706 [details] Buggy refactoring sample Ok, it is really worse as I expected. The refactoring works really buggy if the selected token is not the declaration field. If you do the refactoring (or the preview) selecting 'abc' field shown at Issue class, line 5, everything works as expected, even private rename. But, If you try the refactoring selecting the 'abc' field inside the code, for exemplo, putting the cursor at line 8, column 18, the refactoring is not performed as expected, actually just the field is refactored.
Changeset: 1e6595e5e394 Author: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Date: 2012-07-04 16:17 Message: Issue #215137 - Field rename refactoring does not work as expected
Do you think it is possible to have it backported to 7.2 as a future patch?
(In reply to comment #4) > Do you think it is possible to have it backported to 7.2 as a future patch? Yes, I do not see a problem with this. Jirka?
If it's me being asked, I am not against.
Integrated into 'main-golden', will be available in build *201207080002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1e6595e5e394 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Issue #215137 - Field rename refactoring does not work as expected
Build 20120709-7bce6e2cc8f3
http://hg.netbeans.org/releases/rev/91071ddc43d8
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/91071ddc43d8 User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org> Log: Issue #215137 - Field rename refactoring does not work as expected