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.

Bug 44073 - [1.5] cannot add constant to enum
Summary: [1.5] cannot add constant to enum
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
: 44616 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-31 20:49 UTC by Jan Pokorsky
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log (12.35 KB, text/plain)
2004-05-31 20:51 UTC, Jan Pokorsky
Details
InvalidObjectException (7.35 KB, text/plain)
2004-06-18 17:46 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2004-05-31 20:49:53 UTC
If I add a new constant to the enum via jmi api it
fails with notification about inconsitent storage,
NoSuchElementException and other pleasant info.
Comment 1 Jan Pokorsky 2004-05-31 20:51:01 UTC
Created attachment 15378 [details]
log
Comment 2 Jan Pokorsky 2004-06-09 10:41:07 UTC
*** Issue 44616 has been marked as a duplicate of this issue. ***
Comment 3 Pavel Flaska 2004-06-18 06:50:34 UTC
x
Comment 4 Pavel Flaska 2004-06-18 14:37:49 UTC
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.
Comment 5 Jan Pokorsky 2004-06-18 17:42:46 UTC
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 {
}

:-)
Comment 6 Jan Pokorsky 2004-06-18 17:46:33 UTC
Created attachment 15844 [details]
InvalidObjectException
Comment 7 Pavel Flaska 2004-06-21 19:01:25 UTC
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...
Comment 8 Tomas Hurka 2004-06-22 08:41:42 UTC
Moved to new subcomponent java/javacore.
Comment 9 Pavel Flaska 2004-06-22 15:03:06 UTC
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
Comment 10 Jan Pokorsky 2004-06-22 20:26:55 UTC
verified
Comment 11 Quality Engineering 2007-09-20 11:00:03 UTC
Reorganization of java component