Bug 167952 - [1.6][compiler] Invalid compilation errors for rt.jar for Java 1.6 annotations
Summary: [1.6][compiler] Invalid compilation errors for rt.jar for Java 1.6 annotations
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 223490 263258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-13 15:44 EST by Mark A. Ziesemer CLA
Modified: 2009-02-03 06:43 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark A. Ziesemer CLA 2006-12-13 15:44:01 EST
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;
	}
}
Comment 1 Olivier Thomann CLA 2006-12-13 16:08:59 EST
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.
Comment 2 Philipe Mulet CLA 2006-12-14 07:03:52 EST
Olivier - pls add a regression test.
Comment 3 Olivier Thomann CLA 2006-12-14 15:55:49 EST
Added regression tests:
org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test1095/1096
Comment 4 Philipe Mulet CLA 2007-12-08 09:14:31 EST
*** Bug 212147 has been marked as a duplicate of this bug. ***
Comment 5 Kent Johnson CLA 2007-12-11 11:16:56 EST
Verified for 3.4M4 using build I20071210-1800.
Comment 6 Philipe Mulet CLA 2008-03-21 11:51:20 EDT
also see bug 106744, bug 163560
Comment 7 Philipe Mulet CLA 2008-03-21 11:53:10 EDT
*** Bug 223490 has been marked as a duplicate of this bug. ***
Comment 8 Philipe Mulet CLA 2009-02-03 06:43:21 EST
*** Bug 263258 has been marked as a duplicate of this bug. ***