Summary: | [1.6][compiler] Code compiles with javac but not the Eclipse compiler | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.4.2 | ||
Target Milestone: | 3.5 M6 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2009-02-02 11:52:27 EST
Also note that in source scenario (not using reflect constructor from lib), javac (build 1.7.0-ea-b44) also rejects the code: import java.lang.annotation.Annotation; public class X<U> { <T extends Annotation> T getAnnotation(Class<T> annotationClass) { return null; } void foo(X x) { x.getAnnotation(ConstructorProperties.class).value(); } } @interface ConstructorProperties { String value(); } X.java:4: warning: [rawtypes] found raw type: X missing type parameters for generic class X<U> void foo(X x) { ^ X.java:5: warning: [unchecked] unchecked call to <T>getAnnotation(java.lang.Class<T>) as a member of the raw type X x.getAnnotation(ConstructorProperties.class).value(); ^ X.java:5: cannot find symbol symbol : method value() location: interface java.lang.annotation.Annotation x.getAnnotation(ConstructorProperties.class).value(); ^ 1 error 2 warnings dup of bug 167952 *** This bug has been marked as a duplicate of bug 167952 *** Verified for 3.5M6 using I20090310-0100 |