Bug 83230 - [1.5][search][annot] search for annotation elements does not seem to be implemented yet
Summary: [1.5][search][annot] search for annotation elements does not seem to be imple...
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:
: 84659 85423 (view as bug list)
Depends on:
Blocks: 81441
  Show dependency tree
 
Reported: 2005-01-19 14:26 EST by Markus Keller CLA
Modified: 2005-05-11 09:41 EDT (History)
2 users (show)

See Also:


Attachments
Patch to implement this functionality (12.61 KB, patch)
2005-04-22 10:43 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.