Community
Participate
Working Groups
HEAD, found while looking at bug 155013 comment 21 TypeReferenceMatch#getOtherElements() does not return the other elements if a match is inside an annotation. Steps: - have: --------------------- package xy; public class Try { void tryB(int tryKind) { @Constants(Try.class) int tryCopy, tryCopy2= tryKind; } @Constants(value= Try.class) Object fTryA, fTryB; } @interface Constants { Class<?> value(); } --------------------- - Refactor > Rename type "Try" using dialog - choose "update similarly named ..." - click "Configure..." and choose 3rd strategy - click Next => TypeReferenceMatch#getOtherElements() is null for both reported matches, but it should return ILocalVariable 'tryCopy2' and IField 'fTryB'. If the proposal from bug 155013 comment 22 is implemented, it should return IAnnotations in #getLocalElement() and #getOtherElements().
Could defer until 3.5 since not super critical. Nice to have though for API completeness. So time permitting for M6.
Finally, the last patch released for bug 209996 does not fix the problem described in comment 0. However, note that with that fix applied, the refactoring does no longer try to rename fields and local variables in the given snippet...
We ran out of time for 3.4M7.
Created attachment 127796 [details] Proposed patch Markus, please let me know if this fix would match your expectation, thanks
> Markus, please let me know if this fix would match your expectation, thanks Looks good. I would only add an example in the Javadoc of TypeReferenceMatch#getOtherElements() where an IAnnotation is returned.
Created attachment 139643 [details] Update patch for 3.6 Updated patch for 3.6 including example in TyepReferenceMatch.getOtherElements() javadoc comment...
Released for 3.6M1 in HEAD stream.
Verified for 3.6M1 using I20090803-1800