Community
Participate
Working Groups
I20050112-1200 Search for annotations misses references in default and values constructs. In the example below, only one of three references is found: @interface A { String value() default ""; } @interface Main { A child() default @A("Void"); } @Main(child=@/*test*/A("")) class Client { }
Fixed and released in HEAD. All references are now found, even those in annotation member values. [jdt-core-internal] Changes done in: - SourceElementParser, MatchLocatorParser: remove override of consumeAnnotationAsModifier and replace it with consumeMarkerAnnotation, consumeNormalAnnotation. Also modify consumeSingleMemberAnnotation. - MatchLocator: modify reportMatching(Annotation[],...) to report reference inside member value - PatternLocator: add method matchNode(Annotation, MatchingNodeSet) - MethodLocator: + add method matchNode(Annotation, MatchingNodeSet) to add possible matches when annotation member value pairs match method pattern + modify resolveLevel(ASTNode) to resolve SingleMemberAnnotation using its unique member value pair binding - TypeReferenceLocator: + add method matchNode(Annotation, MatchingNodeSet) to add possible matches when annotation type match type reference pattern Test cases added in JavaSearchBugsTests
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.