Bug 212175

Summary: [compiler][1.5] Another compiler problem related to annotations/generics
Product: [Eclipse Project] JDT Reporter: Roman Kennke <roman>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc
Version: 3.3.1   
Target Milestone: 3.4 M4   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test case none

Description Roman Kennke CLA 2007-12-06 13:45:19 EST
Created attachment 84657 [details]
test case

Build ID: M20070212-1330

Steps To Reproduce:
Try to compile the attached test program in Eclipse. It complains about:

Type mismatch: cannot convert from Annotation to ConstructorProperties

With javac this compiles without problems (as it should, because it is semantically correct AFAICS). This might be related to bug #212147, but I am not sure. At least the compiler error is a different one.

More information:
Comment 1 Philipe Mulet CLA 2007-12-12 09:21:03 EST
Yes, this is a dup of bug 212147.
You need to write instead:

final Class<ConstructorProperties> propertyNamesClass = ConstructorProperties.class;
Constructor<ConstructorProperties> constr = propertyNamesClass.getConstructor();
String[] propertyNames = constr.getAnnotation(propertyNamesClass).value();

since Constructor is a generic type. 
Closing as duplicate of bug 212147


*** This bug has been marked as a duplicate of bug 212147 ***
Comment 2 Frederic Fusier CLA 2007-12-13 04:14:19 EST
Verified for 3.4M4 using I20071211-0010.