Summary: | [1.5][compiler] enum classes created without final accessFlag | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Peter Shipton <Peter_Shipton> | ||||||||||||
Component: | Core | Assignee: | Kent Johnson <kent_johnson> | ||||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||||
Severity: | normal | ||||||||||||||
Priority: | P3 | CC: | daniel_megert | ||||||||||||
Version: | 3.1 | ||||||||||||||
Target Milestone: | 3.1 RC3 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows XP | ||||||||||||||
Whiteboard: | |||||||||||||||
Attachments: |
|
Description
Peter Shipton
2005-06-10 14:24:16 EDT
I get 0x4001 using RC1 or any version of javac 1.5. Created attachment 22842 [details]
enum test case
This is the test case that found the problem. The test passes on JDK when its
been compiled with javac.
This is the javac I'm using: javac 1.5.0_03-ea java version "1.5.0_03-ea" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-ea-b04) Java HotSpot(TM) Client VM (build 1.5.0_03-ea-b04, mixed mode) +1 for RC3 Dani - would you pls cast a vote on it ? Our compiler isn't producing valid files without it. +1 for 3.1 RC3. Indeed an enum type is implicitely final if none of its constants has a body. So the first example: public enum X { ONE, TWO } leads to a final bit set in the classfile. Whereas the classfile for public enum X { ONE() { public String toString() { return "1"; } }, TWO; } doesn't have the final bit set. Created attachment 22923 [details]
Fix the final bit issue.
Created attachment 22952 [details]
This is the right patch
Created attachment 22953 [details]
Patch for the test094
Created attachment 22954 [details]
Simplified patch
Added EnumTest test114 Output is now: // Compiled from X.java (version 1.5 : 49.0, super bit) // Signature: Ljava/lang/Enum<LX;>; public final enum X extends java.lang.Enum { ... Verified using N20050616-0010 + JDT/Core HEAD |