Bug 83012 - [1.5][search][annot] Search for annotations misses references in default and values constructs
Summary: [1.5][search][annot] Search for annotations misses references in default and ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-17 14:41 EST by Markus Keller CLA
Modified: 2005-05-11 05:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-01-17 14:41:21 EST
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 {
}
Comment 1 Frederic Fusier CLA 2005-04-25 12:53:10 EDT
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
Comment 2 Maxime Daniel CLA 2005-05-11 04:41:27 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.