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 190767 - API support for JDK7 language features
Summary: API support for JDK7 language features
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: apireviews
Depends on:
Reported: 2010-10-05 12:44 UTC by Jan Lahoda
Modified: 2011-10-20 12:54 UTC (History)
2 users (show)

See Also:
Exception Reporter:

Proposed API change. (7.07 KB, patch)
2010-10-05 12:44 UTC, Jan Lahoda
Details | Diff
Updated API patch. (8.66 KB, patch)
2010-10-06 14:48 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2010-10-05 12:44:46 UTC
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.
Comment 1 Jesse Glick 2010-10-05 14:02:14 UTC
[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.)
Comment 2 Jan Lahoda 2010-10-06 14:48:04 UTC
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.
Comment 3 Quality Engineering 2010-10-15 02:55:39 UTC
Integrated into 'main-golden', will be available in build *201010150000* on (upload may still be in progress)
User: Jan Lahoda <>
Log: #190767: updating various java.source API to support JDK7 features.
Comment 4 Jesse Glick 2011-10-19 15:23:10 UTC
Is this not now FIXED?