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 226985

Summary: Create enum constant add super() call
Product: java Reporter: js-java
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: VERIFIED FIXED    
Severity: normal CC: jiriprox, mmirilovic
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description js-java 2013-03-04 15:23:55 UTC
Using the hint "create enum constant...." addes a super() call in the enum constructor:

Test enum:

public enum ContrTest {

    VAL1(true),
    VAL2(false);
    final private boolean v;

    ContrTest(boolean v) {
        this.v = v;
    }
}

Now using this enum in another part of code, but with a not yet declared enum:

ContrTest a=ContrTest.VAL3;

This gives the hint "create enum constant "VAL3" in .....

The result looks like this:

public enum ContrTest {

    VAL1(true),
    VAL2(false), VAL3;
    final private boolean v;

    ContrTest(boolean v) {
        super();
        this.v = v;
    }
}

Of course, super() is red underlined by editor.
Comment 1 Jiri Prox 2013-03-12 16:19:34 UTC
reproducible
Comment 2 Quality Engineering 2013-03-17 01:54:01 UTC
Integrated into 'main-golden', will be available in build *201303162300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2e26aecbee97
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #226985: don't mix Trees from different javacs, Fixes must not hold onto any javac instance.
Comment 3 Jiri Prox 2013-04-15 14:02:17 UTC
unfortunately I can still reproduce it.
Comment 4 Jan Lahoda 2013-04-15 14:50:34 UTC
Jirka, what do I need to do to see the problem? I tried the above testcase, but did not succeed. Thanks.
Comment 5 Jiri Prox 2013-04-16 09:15:47 UTC
sorry, I've read it wrongly, the issue is about adding 'super()', which is ok now
Comment 6 Jiri Prox 2013-04-16 09:16:03 UTC
v.
Comment 7 Jan Lahoda 2013-05-03 07:30:57 UTC
release73:
http://hg.netbeans.org/releases/rev/9c659eb65ba4
Comment 8 Quality Engineering 2013-05-05 00:26:32 UTC
Integrated into 'releases', will be available in build *201305042200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/9c659eb65ba4
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #226985: don't mix Trees from different javacs, Fixes must not hold onto any javac instance.
Comment 9 Jiri Prox 2013-05-09 12:40:49 UTC
verified