Bug 181256 - support resolving more than just IType
Summary: support resolving more than just IType
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-05 13:41 EDT by Brian Vosburgh CLA
Modified: 2007-12-11 07:28 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Vosburgh CLA 2007-04-05 13:41:47 EDT
If I have the annotation

    @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE)

and I change it so the various parts are imported and unqualified:

    import java.lang.annotation.Target;
    import static java.lang.annotation.ElementType.TYPE;
    ...
    @Target(TYPE)

I have problems resolving the enum (i.e. "TYPE").

I get the annotation from the AST, then I can resolve its full name by calling IType.resolveType("Target"). This returns "java.lang.annotation.Target". Unfortunately there is no public way to resolve the enum's full name. The internal method SelectionEngine.select(ICompilationUnit, int, int) can be used to resolve the enum's name, but there should be a nice public method like that available for types.
Comment 1 Olivier Thomann CLA 2007-04-05 13:50:23 EDT
Do you create the AST with bindings?
Comment 2 Brian Vosburgh CLA 2007-11-13 23:57:14 EST
Yeah, my mistake. I just need to use the bindings. Sorry.
Comment 3 Frederic Fusier CLA 2007-12-11 07:28:28 EST
Verified for 3.4M4