Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330416 - Enhancement request for the Java AST/DOM package. A helper method to get a new Type ast node that corresponds to a given ITypeBinding.
Summary: Enhancement request for the Java AST/DOM package. A helper method to get a ne...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 19:57 EST by Jochen Huck CLA
Modified: 2013-01-29 10:39 EST (History)
4 users (show)

See Also:


Attachments
This is the code I currently use to deal with the mentioned problem (7.82 KB, text/plain)
2010-11-17 09:58 EST, Jochen Huck CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Huck CLA 2010-11-16 19:57:16 EST
Build Identifier: I20090611-1540

I had the problem that I needed to get a new org.eclipse.jdt.core.dom.Type ast node that corresponds to a given org.eclipse.jdt.core.dom.ITypeBinding. Currently you have to code all of that stuff yourself. So it would be nice to have a helper method that aleady allows to get the corresponding Type ast node.

I'll attach the code I am currently using later on via "Add an Attachment".

Reproducible: Always
Comment 1 Jochen Huck CLA 2010-11-17 09:58:17 EST
Created attachment 183304 [details]
This is the code I currently use to deal with the mentioned problem
Comment 2 Ayushman Jain CLA 2010-11-18 01:51:10 EST
Satyam, please follow up. Thanks!
Comment 3 Olivier Thomann CLA 2010-11-18 08:28:52 EST
I think we should think of what helper methods we could provide as API.
For DOM/AST usage, users need to do the same thing over and over again. It would be good if we could come up with a list of utility methods that could be reused by all users of DOM API.

Markus, would you have any suggestions ?
Comment 4 Markus Keller CLA 2013-01-29 10:39:50 EST
In general, the mapping from ITypeBinding to a Type node can only be done correctly when imports are taken into account.

For this, there's already API, e.g.:
org.eclipse.jdt.core.dom.rewrite.ImportRewrite#addImport(ITypeBinding, AST)