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.
[ BUILD # : 200807101204 ] [ JDK VERSION : 1.6.0_07 ] Encapsulating fields puts getter/setter methods over the enums. To reproduce; * Create a new java class * Create two fields * Encapsulate one of the fields, it generates methods under the fields as expected. * Create an enum over the other fields * Now encapsulate other field. Now it generates and puts methods over the enum. Resulting class looks like this; public class NewClass1 { /** * @return the s1 */ public String getS1() { return s1; } /** * @param s1 the s1 to set */ public void setS1(String s1) { this.s1 = s1; } private enum Hede{ e1, e2 }; private String s1; private String s2; /** * @return the s2 */ public String getS2() { return s2; } /** * @param s2 the s2 to set */ public void setS2(String s2) { this.s2 = s2; } }
I can reproduce it with setting the insert point as first or last method.
fixed as http://hg.netbeans.org/main/rev/ccb0154a9b4c
I can reproduce this with latest daily build; 200807221016. Am I missing something? I'm reopening the issue, please close if I'm wrong.
Sorry, I overlooked the step 4 (create an enum over the other fields after encapsulating one of these fields). Now I can reproduce the described behavior too. Unfortunately it is out of control of the refactoring module. In case you choose the 'Default' insert point the refactoring delegate responsibility where to place new methods to the java generator (module java/source, GeneratorUtilities.get(workingCopy).insertClassMembers(node, newMethods)). In order to work around it choose the insert point other than the default. My fix should handle this properly. Reassigning to java/source to evaluate GeneratorUtilities.insertClassMembers handling.
P4 imo
Overtake.
Reassigning all moonko's java/source bugs to myself.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss