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.
Created attachment 102263 [details] Proposed API change. I would like to propose addition of a few methods to CodeStyle and TreeMaker, and a final static field (Set<Kind>) to TreeUtilities. In addition to this, I propose to deprecate a few methods in TreeUtilities. Please see the attached patch for details. Thanks for the review.
[JG01] DisjointType and Try use List<? extends Tree> to specify arguments, which is not very helpful to an API user. If there is a particular Tree subtype which is in fact expected, such as AssignmentTree for Try, please use that; or if several subtypes may be used according to context, please specify in the Javadoc what they are. (This may be a more general complaint about TreeMaker and related APIs - in my experience using them, I have often been unsure which kind of Tree was expected, or would be returned, by a method, and have had to resort to trying different guesses.)
Created attachment 102286 [details] Updated API patch. JG01: unfortunatelly in both cases the only common supertype of supported elements is Tree. But it would not be possible to be more specific anyway: the javac's API returns List<? extends Tree> in both cases, and requiring more specific type in TreeMaker would require casts to call the TreeMaker methods when reusing parts of existing trees. I have added a note to the javadoc on the supported types.
Integrated into 'main-golden', will be available in build *201010150000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ee40feaaac7f User: Jan Lahoda <jlahoda@netbeans.org> Log: #190767: updating various java.source API to support JDK7 features.
Is this not now FIXED?