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 114459 - reformatting a Java class with an internal enumeration loses information
Summary: reformatting a Java class with an internal enumeration loses information
Status: RESOLVED DUPLICATE of bug 108373
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P1 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-02 22:31 UTC by sourcerror
Modified: 2007-11-05 13:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
example from issue description (439 bytes, text/plain)
2007-09-02 22:35 UTC, sourcerror
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sourcerror 2007-09-02 22:31:08 UTC
In 6.0M10, I found that reformatting a Java class with an internal enumeration loses information!

Here is an example where the parameters to the enumeration values are lost.  See below "A1(1), A2(2), A3(3)"

Before...

public class ReforatEnumBug {
    public enum A {
        A1(1),
        A2(2),
        A3(3);
        
        private int length;
        
        A(int length) {
            this.length= length;
        }
        
        public int getLength() { return length; }
    }

    private A a;
    
    public ReforatEnumBug() {
        a= A.A1;
    }

}


After...

public class ReforatEnumBug {

    public enum A {

        A1, A2, A3;

        private int length;

        A(int length) {
            this.length = length;
        }

        public int getLength() {
            return length;
        }
    }

    private A a;

    public ReforatEnumBug() {
        a = A.A1;
    }
}
Comment 1 sourcerror 2007-09-02 22:35:10 UTC
Created attachment 47942 [details]
example from issue description
Comment 2 sourcerror 2007-09-02 23:43:25 UTC
I tried to do a search before submitting but I guess I messed up.

Anyway, now I'm 99.9% sure this is a duplicate of #108373. :)  But I'll let someone (e.g. pflaska) confirm that is 
true.
Comment 3 Jiri Prox 2007-09-03 07:43:33 UTC
You're right it's duplicate of issue 108373. It should work fine in the latest daily build. Thanks for your report.

*** This issue has been marked as a duplicate of 108373 ***