Community
Participate
Working Groups
Build ID: N/A (Eclipse 3.3) Steps To Reproduce: 1. Create a test method with two formal parameters with different annotations. 2. Acquire a org.eclipse.jdt.core.dom.IMethodBinding for this method from a MethodCall AST node calling this method. 3. Call getParameterAnnotations(0) and getParameterAnnotations(1) in sequence. The same array of annotations with be returned both times, containing the annotation bindings for the first parameter of the method. Instead, the second call should return annotation bindings for the second parameter. More information: A suitable test method might have the signature: void m(@Foo a, @Bar b) Calling getParameterAnnotations(0) and getParameterAnnotations(1) on an org.eclipse.jdt.core.dom.IMethodBinding for this method will return a IAnnotationBinding for @Foo both times instead of returning a IAnnotationBinding for @Bar from getParameterAnnotations(1). Using the debugger it appears that the implementation of getParameterAnnotations caches the result from the first call and returns the cached result regardless of the index passed in subsequent calls. This problem does not exist in Eclipse 3.2.1 (build M20060921-0945). This problem is different from Eclipse bug #212834 and does not seem to depend on whether the method is declared and called in the same or different compilation units. It is unknown whether the bug also occurs when using a IMethodBinding retrieved from the MethodDeclaration AST node for a method; the problem was observed when using a IMethodBinding from a MethodCall AST node.
Created attachment 85654 [details] Proposed patch
Released for 3.4M5 in HEAD stream.
*** Bug 217793 has been marked as a duplicate of this bug. ***
Verified for 3.4M5 using build I20080204-0010.