Bug 212175 - [compiler][1.5] Another compiler problem related to annotations/generics
Summary: [compiler][1.5] Another compiler problem related to annotations/generics
Status: VERIFIED DUPLICATE of bug 212147
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-06 13:45 EST by Roman Kennke CLA
Modified: 2007-12-13 04:14 EST (History)
1 user (show)

See Also:


Attachments
test case (401 bytes, text/x-java)
2007-12-06 13:45 EST, Roman Kennke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.