JDK 24 |
---|
24Resolved |
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
FULL PRODUCT VERSION : 1.7.0_04, 1.7.0_06 ADDITIONAL OS VERSION INFORMATION : RHEL 5.8 EXTRA RELEVANT SYSTEM CONFIGURATION : Bug is OS unrelated A DESCRIPTION OF THE PROBLEM : Javac denies to compile code containing references to enum types, if the enum type constructor has annotated parameters and the classes were compiled by Eclipse compiler for Java. Javac complains about " bad class file " and " bad signature " . It looks like javac expects that enum constructors always have generic signature attribute and tries to use the signature attribute to decode parameter annotations. Please see the full discussion and code examples here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=388314 REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class MyMain { public static void main(String[] args){ System.out.println( UseAnnotation.COMPLETE ); } } import javax.annotation.Nonnull; public enum UseAnnotation { COMPLETE( " finished " ); private final String mString; UseAnnotation (@Nonnull String aString) { mString = aString; } public @Nonnull String getString() { return mString; } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : There is no workarounds except to remove annotations from the enum constructor parameters.
|