DescriptionThis is a fix for https://code.google.com/p/error-prone/issues/detail?id=185
I'm afraid we can't fix annotations(); this is because it runs its submatcher over all AnnotationTrees attached to the given Tree. To take superclasses into account, it would need to access their Trees, and this seems impossible (compiler may not even have access to superclass' source code).
We can, however, access inherited annotations as Attribute.Compound - "compiled" form, to run some less general matchers. I fixed hasAnnotation() this way. If needed, I could also add something a bit more general like:
hasAnnotationWithArgument(String annotationClass, String argumentName, String value);
Patch Set 1 : #
Total comments: 4
Patch Set 2 : #
MessagesTotal messages: 10
|