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.
nightly build 20070710000 Extra semicolon or comma is generated at last of constant of enum type. Steps to reproduce: 1. Create UML java-platform project. 2. Add an enumerate element to canvas. Add literals Winter, Spring, Summer. 3. Call Code generation and code is generated as below. -- Note that a semicolon appears at end of last constant before the close bracket, which should be after the close bracket. public enum Season { //<maker> Winter, //<maker> Spring, // <maker> Summer; } 4. Add one more literal 'Fall' 5. Repeat step 3 to generate code. -- a comma shows up at last constant 'Fall' as shown below: public enum Season { //<maker> Winter, //<maker> Spring, // <maker> Summer; // <amker> Fall,; }
I call it a p2 here since incorrect code generated.
the following, correct Java, code was generated (markers removed). Last, extra, comma is pretty legal according to Java lang spec&grammar (http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9) public enum Season { Winter, Spring, Summer, Fall,; }
Yes, the extra comma is ok. I issue I see here is the extra semicolon (after Summer) from the description.
trying to reproduce the issue as described i didn't get ";" after Summer.
I just tried with today's cb build netbeans-hudson-trunk-1580-full.zip and not able to reproduce either. Maybe error in copy and paste? If so, this issue is invalid.
just reverified again but not repro.