Summary: | IBinding#getJavaElement() always returns null for IAnnotationBindings declared in annotation or enum types | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | Olivier_Thomann | ||||||
Version: | 3.5 | ||||||||
Target Milestone: | 3.5 M3 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 236850 | ||||||||
Attachments: |
|
Description
Markus Keller
2008-10-06 14:03:24 EDT
Could you please provide an example where you get null? E.g. open java.lang.annotation.Target from JDK6 and look at the binding for '@Documented'. Same for source, e.g. on binding for @Test, IAnnotationBinding#getJavaElement() returns null: @Test public @interface Test {} Expected: An IAnnotation that is equal to the annotation I get from IAnnotatable#getAnnotations() on the annotated IType. This seems to be the case only for annotations declared on annotation types. If you write: @Deprecated public interface Test {} it works fine. Updating title accordingly. Annotations declared on enum types are also wrong. I have a patch for the source case. Created attachment 115260 [details]
Proposed fix + regression tests
Patch for source case. Not sure what can be done for the binary case.
(In reply to comment #6) > Created an attachment (id=115260) [details] > Proposed fix + regression tests Fix is good. Thanks. > Not sure what can be done for the binary case. I'm not sure what you mean. Your fix also solves the case of "@Documented" on java.lang.annotation.Target from JDK6. The only problem is that the element doesn't exist. But this is bug 248309. Created attachment 115402 [details]
Same fix and tests moved to ASTModelBridgeTests
Fix and tests released for 3.5M3 Verified for 3.5M3 using I20081026-2000 |