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.
If I add a new constant to the enum via jmi api it fails with notification about inconsitent storage, NoSuchElementException and other pleasant info.
Created attachment 15378 [details] log
*** Issue 44616 has been marked as a duplicate of this issue. ***
x
Should be fixed now. I added test classes to javacore tests configuration. There is also simple test for adding constant. Enum functionality is pretty wide, so if you come to problems again, reopen this bug, please. It would be fine if you provide your test classes to allow quickly identify the root cause of problem.
Still cannot add none constant to any enum. Now I get different exception. To reproduce try JavaNode subnode|Add Constant test enum: public enum EnumTest { } :-)
Created attachment 15844 [details] InvalidObjectException
Partially fixed. There isn't still solved your usecase, but now it works when you add new enum and its first constant in single transaction. Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaEnumImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaEnumImpl.java,v <-- JavaEnumImpl.java new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... RCS file: /cvs/java/javacore/test/unit/data/goldenfiles/org/netbeans/jmi/javamodel/codegen/EnumTest/testNewEnum_EnumTest.pass,v done Checking in test/unit/data/goldenfiles/org/netbeans/jmi/javamodel/codegen/EnumTest/testNewEnum_EnumTest.pass; /cvs/java/javacore/test/unit/data/goldenfiles/org/netbeans/jmi/javamodel/codegen/EnumTest/testNewEnum_EnumTest.pass,v <-- testNewEnum_EnumTest.pass initial revision: 1.1 done Processing log script arguments... More commits to come... Checking in test/unit/src/org/netbeans/jmi/javamodel/codegen/EnumTest.java; /cvs/java/javacore/test/unit/src/org/netbeans/jmi/javamodel/codegen/EnumTest.java,v <-- EnumTest.java new revision: 1.4; previous revision: 1.3 done Processing log script arguments...
Moved to new subcomponent java/javacore.
Fixed. Checking in org/netbeans/modules/javacore/jmiimpl/javamodel/EnumConstantClassImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/EnumConstantClassImpl.java,v <-- EnumConstantClassImpl.java new revision: 1.4; previous revision: 1.3 done Checking in org/netbeans/modules/javacore/jmiimpl/javamodel/JavaEnumImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaEnumImpl.java,v <-- JavaEnumImpl.java new revision: 1.6; previous revision: 1.5
verified
Reorganization of java component