Bug 226985 - Create enum constant add super() call
Create enum constant add super() call
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Hints
7.3
PC Windows 7
: P3 (vote)
: 7.3.1
Assigned To: Jan Lahoda
issues@java
73patch2-verified
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-04 15:23 UTC by js-java
Modified: 2013-05-09 12:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo