Summary: | AnnotationMirror.getPosition() returns wrong value | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Kenneth Cheung <kennethc> | ||||
Component: | APT | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | CC: | eclipse, jpitman, philippe_mulet | ||||
Version: | 3.3 | ||||||
Target Milestone: | 3.3.1 | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Bug Depends on: | 192774 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Kenneth Cheung
2007-06-05 13:25:19 EDT
I am able to reproduce this. The position returned by the annotated declaration is correct, but the position returned by the annotation mirror itself is not. Am investigating. This looks like a JDT Core 3.3 regression. In 3.3, cacheing and reuse of compiler internal annotation bindings was introduced (changes introduced in LookupEnvironment version 1.82 and 1.83), but DefaultBindingResolver.getAnnotationInstance() is supposed to be able to translate from a compiler internal annotation binding to a DOM IAnnotationBinding. Reuse means there is not a 1:1 relationship any more so this translation is broken. I will spawn a JDT Core bug for this, and leave this bug open to create a test case for APT. This is indeed broken. We need to either not have unique compiler annotation bindings or change the binding resolver to be able to retrieve the right ast node when an annotation binding is found. I am investigating. Sounds like a must have for 3.3.1. I agree with both the analysis and the prioritization. Thanks, Olivier. Created attachment 73056 [details]
Regression tests
Set target as 3.3.1 since this is related to bug 192774 which is targetted for 3.3.1. Released for 3.3.1. Same regression tests as bug 192774. Released for 3.4M1. Same regression tests as branch 3.3.1. |