Bug 83230

Summary: [1.5][search][annot] search for annotation elements does not seem to be implemented yet
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, Olivier_Thomann
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 81441    
Attachments:
Description Flags
Patch to implement this functionality none

Description Markus Keller CLA 2005-01-19 14:26:25 EST
I20050118-1015

Search for A.name() yields no results (no references, no declarations):

@A(name="X")
@interface A {
    String name() default "Me";
}
Comment 1 Markus Keller CLA 2005-01-20 06:50:46 EST
Additional caveat: A search for references to the specially named element
"value" must also find references in SingleMemberAnnotations. For example:

@I(12)
@interface I {
    @I(value=13)
    int value();
}

=> A match must be returned for the implicit reference in @I(12).
Comment 2 Frederic Fusier CLA 2005-02-15 06:05:27 EST
*** Bug 84659 has been marked as a duplicate of this bug. ***
Comment 3 Frederic Fusier CLA 2005-02-16 11:52:15 EST
*** Bug 85423 has been marked as a duplicate of this bug. ***
Comment 4 Philipe Mulet CLA 2005-03-11 09:51:41 EST
On the plan for M7, privileging API work.
Comment 5 Philipe Mulet CLA 2005-04-20 04:39:44 EDT
This defect prevents UI from renaming annotation members
Comment 6 Frederic Fusier CLA 2005-04-22 10:43:46 EDT
Created attachment 20238 [details]
Patch to implement this functionality

Note that matches for implicit reference have a length equals to 0. User will
not see explicitely them in editor but can reach them easily using Search
view...
Comment 7 Frederic Fusier CLA 2005-04-22 11:23:54 EDT
Patch applied in HEAD.

Test cases added in JavaSearchBugsTests
Comment 8 Markus Keller CLA 2005-05-09 11:04:34 EDT
For the records (see bug 94062):
For implicit references, SearchMatch#isImplicit() is now true, and the length is
the length of the SingleMemberAnnotation's value expression.
Comment 9 Maxime Daniel CLA 2005-05-11 09:25:51 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.