Community
Participate
Working Groups
Build ID: I20061102-1715 Steps To Reproduce: I'm attempting to compile the Java source code in rt.jar for Java 1.6 under Eclipse 3.3M3meta. I'm getting 2 errors that compile fine using javac: - Type mismatch: cannot convert from Annotation to ConstructorProperties JDK/src/java/beans MetaData.java - The method value() is undefined for the type Annotation JDK/src/com/sun/jmx/mbeanserver OpenConverter.java More information: The JRE System Library is set to jdk1.6.0. The project's Compiler compliance level is set to 6.0. A 3rd error, "The method copyOf(EnumSet<E>) is ambiguous for the type EnumSet<E> JDK/src/java/util EnumSet.java", is already addressed by bug 163370. The following is the relevant code from MetaData.java that doesn't compile under Eclipse: import java.beans.ConstructorProperties; import java.lang.reflect.Constructor; public class Test{ private static String[] getAnnotationValue(Constructor constructor){ ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class); return (annotation != null) ? annotation.value() : null; } }
This seems to be bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6400189. Closing as INVALID. If you add a cast in the code, it should work fine.
Olivier - pls add a regression test.
Added regression tests: org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1095/1096
*** Bug 212147 has been marked as a duplicate of this bug. ***
Verified for 3.4M4 using build I20071210-1800.
also see bug 106744, bug 163560
*** Bug 223490 has been marked as a duplicate of this bug. ***
*** Bug 263258 has been marked as a duplicate of this bug. ***