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 87029 - Code Generation for Enumerations is invalid.
Summary: Code Generation for Enumerations is invalid.
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-12 21:01 UTC by Craig Conover
Modified: 2006-10-18 14:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Conover 2006-10-12 21:01:30 UTC
When an Enumeration element's code is generated, the literals are not generated
properly. Example:


public enum EngineType {
4bangerStraight6V6V8V10V12;
    public void getEngineType() {
    }
}
Comment 1 Craig Conover 2006-10-17 08:36:29 UTC
Look inside ExportCodeTask class to see how the NBEventProcessor is invoked to
generate the code. A simple debug trace staring with exportCode method on a
sample Enumeration with a few literals should reveal the root cause very quickly.
Comment 2 Craig Conover 2006-10-17 09:12:46 UTC
It appears that the enumeration is being created just fine now. Not sure what
changed to make this work.

Just a couple more questions about other possibilities for Enumeration code gen
before closing this.
Comment 3 Craig Conover 2006-10-18 03:27:38 UTC
I fixed this, but I am not thrilled with the implementation. I would like to
revisit during FCS to create an enumLiteralsAdded (note the "s" as in plural)
just like I did for operationsAdded and attributesAdded. This is for performance
reasons. Only one JavaModel tx/source save.

But it works, and attributes and methods are generated properly as well.

Do not bother testing a Nested enum (ex - Enumeration nested in a Class) because
code gen doesn't work for nested classes either and there is already an issue
open for this: 87373
Comment 4 Alexandr Scherbatiy 2006-10-18 14:50:58 UTC
verified with all-nbms-griffin-061018_27.zip nbms