Bug 114996 - [api] Really need common interface for AST nodes
Summary: [api] Really need common interface for AST nodes
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-11-03 16:48 EST by Daniel R Somerfield CLA
Modified: 2009-08-30 02:07 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 Daniel R Somerfield CLA 2005-11-03 16:48:56 EST
The resolveBinding() method is in a significant number of ASTNode subclasses.
There really should be a common interface for things with this method.
Similarly, there should be a common interface for AST nodes that can be
annotated. Right now, getting annotations from a ASTNode if you don't know
exactly what it is is horrible. Sometimes you call getAnnotations(), sometimes
you call modifiers(). There really should just be IAnnotatable (or something)
that has getAnnotations().
Comment 1 Olivier Thomann CLA 2005-11-04 10:22:59 EST
This would be a breaking API change.
So I doubt it is doable.
Jim, any comment?
Comment 2 Jim des Rivieres CLA 2005-11-04 11:45:38 EST
Adding an interface to ASTNode classes should be doable without breaking 
binary compatibility.
Comment 3 Olivier Thomann CLA 2005-11-04 11:49:48 EST
Could you please clarify what you want?
modifiers() are defined for ASTNodes and getAnnotations() is defined for a binding.
Inside the modifiers list, you can find the AST node corresponding to the
annotation, whereas in the binding world, you use getAnnotations() to retrieve
the resolved information concerning the annotations.
You can also use resolveAnnotation() on the AST node corresponding to the
annotation to get the resolved information.
Comment 4 Olivier Thomann CLA 2006-10-10 12:12:46 EDT
Please provide the requested clarifications.
Closing as REMIND.
Comment 5 Denis Roy CLA 2009-08-30 02:07:47 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.