Bug 124469 - [1.5][search] does not find references to enum type in binary annotation
Summary: [1.5][search] does not find references to enum type in binary annotation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-19 06:37 EST by Markus Keller CLA
Modified: 2006-02-15 11:03 EST (History)
1 user (show)

See Also:


Attachments
Patch to fix this issue (9.75 KB, patch)
2006-01-28 10:47 EST, Frederic Fusier CLA
no flags Details | Diff
New patch to fix this issue (23.40 KB, patch)
2006-02-03 05:11 EST, Frederic Fusier CLA
no flags Details | Diff
Jar file for model tests (6.61 KB, application/octet-stream)
2006-02-03 05:12 EST, Frederic Fusier CLA
no flags Details
Additional patch to index standard annotations contents (5.66 KB, patch)
2006-02-15 07:32 EST, 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 2006-01-19 06:37:41 EST
I20060118-0800, jdk1.5.0_06

Search for references to java.lang.annotation.ElementType or one of its members in a 1.5 JRE does not find any match. But most of the annotation declarations in the JDK use an @Target with an ElementType, e.g.

...
@Target(ElementType.ANNOTATION_TYPE)
public @interface Retention ...

...
@Target(ElementType.ANNOTATION_TYPE)
public @interface Target ...

I would understand that references with RetentionPolicy.SOURCE are not found, but the others should be available.
Comment 1 Frederic Fusier CLA 2006-01-28 10:47:29 EST
Created attachment 33754 [details]
Patch to fix this issue

Additional information about annotations in class files were not used by BinaryIndexer => record in index files reference to annotation itself, type names and enum constant names of member pair values...
Comment 2 Frederic Fusier CLA 2006-01-28 10:49:01 EST
Olivier, can you review if the parse of the class file annotations information is correct?
Thx
Comment 3 Frederic Fusier CLA 2006-02-03 05:11:41 EST
Created attachment 34062 [details]
New patch to fix this issue

Olivier, may you review this new fix? I'll attach jar file for tests separately...
Thanks
Comment 4 Frederic Fusier CLA 2006-02-03 05:12:35 EST
Created attachment 34063 [details]
Jar file for model tests
Comment 5 Frederic Fusier CLA 2006-02-03 10:32:55 EST
Released in HEAD.
Comment 6 Frederic Fusier CLA 2006-02-15 07:32:54 EST
Created attachment 34763 [details]
Additional patch to index standard annotations contents

Unfortunately previous fix only index references inside non-standard annotations and so Search Engine was still not able to find correct reference to ElementType inside standard annotations as Retention...

Standard annotations are stored in tagBits field of ClassFileReader, so now BinaryIndex indexes corresponding types and fields reading bits of this field.
Comment 7 David Audel CLA 2006-02-15 11:03:28 EST
Verified for 3.2 M5 using build I20060215-0800

There is still some issue in the same area (bug 128033)