Community
Participate
Working Groups
Build ID: M20090211-1700 Steps To Reproduce: See example code : public enum Test { TEST_ENUM(FORWARD_REF) private static final int FORWARD_REF = 0; private int i; private Test(int i) { this.i = i; } } More information: The current (1.6 update 12) Sun compiler implementation allows this. I believe problem is probably related to the fix for bug 255452 not checking for this case.
*** This bug has been marked as a duplicate of bug 263877 ***
This is not a duplicate, just an invalid forward reference rejected by all compilers...
Close as INVALID
I forgot to log the error I got while compiling comment 0 test case with Sun JDKs... Using Sun JDK 6.0: java version "1.6.0_14-ea" Java(TM) SE Runtime Environment (build 1.6.0_14-ea-b01) OpenJDK Client VM (build 14.0-b10, mixed mode) Test.java:4: illegal forward reference TEST_ENUM(FORWARD_REF); ^ 1 error Using JDK 1.5.0: java version "1.5.0_18-ea" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-ea-b01) Java HotSpot(TM) Client VM (build 1.5.0_18-ea-b01, mixed mode) Test.java:4: illegal forward reference TEST_ENUM(FORWARD_REF); ^ 1 error
(In reply to comment #4) > I forgot to log the error I got while compiling comment 0 test case with Sun > JDKs... > Also forgot to mention that that test case was missing a ';' at the end of TEST_ENUM(FORWARD_REF) line and that I added it to avoid other noisy compilation errors...
My apologies. If i had double checked my code this bug would indeed have been a duplicate of 255452. My intention was to report the bug defined there.
I guess you meant: TEST_ENUM(Test.FORWARD_REF); Closing as VERIFIED.
Yep...