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.
Product Version: NetBeans IDE Dev (Build 20080831185227) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13 System: Linux version 2.6.22-15-generic running on i386; UTF-8; en_US (nb) Constants declarations are doubled in enum, when using Insert Code dialog to generate code inside constant body. Yes I know, it's very rare scenario -> P4 Steps to reproduce: 1) have a code: public enum Role { ADMIN_USER { }, REGUALAR_USER, SUPER_USER; public void m() { } } 2) put caret inside body of ADMIN_USER constant 3) use insert code dialog to override method m() -> public enum Role { ADMIN_USER { }, REGUALAR_USER, SUPER_USER; ADMIN_USER { @Override public void m() { super.m(); } }, REGUALAR_USER, SUPER_USER; public void m() { } }
*** Issue 151617 has been marked as a duplicate of this issue. ***
*** Issue 157088 has been marked as a duplicate of this issue. ***
Overtake.
*** Issue 163170 has been marked as a duplicate of this issue. ***
Reassigning all moonko's java/source bugs to myself.
Jan, The Target Milestone of this issue is out of date. Please review.
Seems that the usecase above is no longer reproducible in a current daily build. If there is a particular usecase where this still fails, please specify it here and reopen. Thanks.
Jan, I am using: Product Version: NetBeans IDE Dev (Build 201107220600) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb) Code-complete no longer corrupts the class, but the functionality still doesn't work. 1. Given this class: public enum Role { ADMIN_USER { }, REGUALAR_USER, SUPER_USER; public void m() { } } 2. Place the caret inside the body of ADMIN_USER constant 3. Use code-complete (CTRL+SPACEBAR) to override m() 4. Bug #1: Nothing happens (no code is generated). 5. Place the caret inside the body of ADMIN_USER constant 6. Use Generate Code (ALT+INSERT) to override m() 7. Bug #2: ArrayIndexOutOfBoundsException is thrown. See http://statistics.netbeans.org/analytics/detail.do?id=180119 Either way, it doesn't seem to be possible to override m().
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
Seems to be fixed in dev build 201607060002.