Community
Participate
Working Groups
This problem was found while verifying bug 198085. Testing following snippet: @Deprecated @Invalid public class NotWorking { } The ITypeBinding.getAnnotations() now correctly returns an array with two IAnnotationBinding but the second one is not considered as recovered (isRecovered() returns false) although it should be. The reason is that AnnotationBinding.isRecovered() is implemented as follow: public boolean isRecovered() { return false; }
It should probably be something like this: public boolean isRecovered() { ReferenceBinding annotationType = binding.getAnnotationType(); return annotationType == null || (annotationType.tagBits & TagBits.HasMissingType) != 0; } Seems to work with the provided test case.
+1, I seem to have missed this scenario indeed.
I'll release the proposed change and add a regression test...
Created attachment 93455 [details] Patch including Olivier's fix + regression test
Released for 3.4M6 in HEAD stream.
Verified for 3.4M6 using build I20080325-2233
In fact in this case, two annotations are returned only if the binding recovery is on.