This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 102149

Summary: Method to create a Tree for an arbitrary type while handling imports
Product: java Reporter: Andrei Badea <abadea>
Component: SourceAssignee: Rastislav Komara <moonko>
Status: NEW ---    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Andrei Badea 2007-04-23 14:10:09 UTC
I need to create a Tree for an arbitrary type given as a string using
fully-qualified names and use this tree to generate Java code in such a way that
imports are handled. If I understand correctly the current way to handle imports
is to use TreeMaker.QualIdent(). This method gets an Element, but there is no
simple way to get an Element for any type. There is TreeUtilities.parseType(),
but it returns a TypeMirror.

I recall we agreed to introduce a TreeMaker.Tree(String typeName) method which
would do just this. Such a solution would have the disadvantage that the client
can't choose not to have imports handled, but that's not my case and I would be
happy with such a solution.
Comment 1 Rastislav Komara 2009-02-03 10:56:40 UTC
Overtake.