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.

View | Details | Raw Unified | Return to bug 190767
Collapse All | Expand All

(-)a/java.source/apichanges.xml (+15 lines)
Lines 108-113 Link Here
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
109
109
110
    <changes>
110
    <changes>
111
        <change id="jdk7-update">
112
             <api name="general"/>
113
             <summary>Added several methods to support new API for modeling JDK7 features.</summary>
114
             <version major="0" minor="67"/>
115
             <date day="12" month="10" year="2010"/>
116
             <author login="jlahoda"/>
117
             <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
118
             <description>
119
                 Added <code>CodeStyle.alignMultilineTryResources</code>, <code>CodeStyle.spaceBeforeTryParen</code>,
120
                 <code>CodeStyle.spaceWithinTryParens</code>, <code>CodeStyle.wrapTryResources</code>
121
                 <code>TreeMaker.DisjointType</code>, <code>CodeStyle.Try</code> and <code>TreeUtilities.CLASS_TREE_KINDS</code>
122
                 to support new language features in JDK7.
123
             </description>
124
             <issue number="999999"/>
125
        </change>
111
        <change id="TreeMaker.PackageAnnotations">
126
        <change id="TreeMaker.PackageAnnotations">
112
             <api name="general"/>
127
             <api name="general"/>
113
             <summary>Added TreeMaker.CompilationUnit(List&lt;AnnotationTree&gt;, ...), TreeMaker.addPackageAnnotation, TreeMaker.insertPackageAnnotation, TreeMaker.removePackageAnnotation methods.</summary>
128
             <summary>Added TreeMaker.CompilationUnit(List&lt;AnnotationTree&gt;, ...), TreeMaker.addPackageAnnotation, TreeMaker.insertPackageAnnotation, TreeMaker.removePackageAnnotation methods.</summary>
(-)a/java.source/nbproject/project.properties (-1 / +1 lines)
Lines 46-52 Link Here
46
javadoc.title=Java Source
46
javadoc.title=Java Source
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
49
spec.version.base=0.66.0
49
spec.version.base=0.67.0
50
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
50
test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
51
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
51
test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
52
    ${o.n.core.dir}/lib/boot.jar:\
52
    ${o.n.core.dir}/lib/boot.jar:\
(-)a/java.source/nbproject/project.xml (-1 / +3 lines)
Lines 88-94 Link Here
88
                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
88
                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
89
                    <build-prerequisite/>
89
                    <build-prerequisite/>
90
                    <compile-dependency/>
90
                    <compile-dependency/>
91
                    <run-dependency/>
91
                    <run-dependency>
92
                        <specification-version>7.0</specification-version>
93
                    </run-dependency>
92
                </dependency>
94
                </dependency>
93
                <dependency>
95
                <dependency>
94
                    <code-name-base>org.netbeans.libs.javacimpl</code-name-base>
96
                    <code-name-base>org.netbeans.libs.javacimpl</code-name-base>
(-)a/java.source/src/org/netbeans/api/java/source/CodeStyle.java (+12 lines)
Lines 317-322 Link Here
317
        return preferences.getBoolean(alignMultilineAssignment, getDefaultAsBoolean(alignMultilineAssignment));
317
        return preferences.getBoolean(alignMultilineAssignment, getDefaultAsBoolean(alignMultilineAssignment));
318
    }
318
    }
319
319
320
    /**
321
     * @since 0.67
322
     */
320
    public boolean alignMultilineTryResources() {
323
    public boolean alignMultilineTryResources() {
321
        return preferences.getBoolean(alignMultilineTryResources, getDefaultAsBoolean(alignMultilineTryResources));
324
        return preferences.getBoolean(alignMultilineTryResources, getDefaultAsBoolean(alignMultilineTryResources));
322
    }
325
    }
Lines 396-401 Link Here
396
        return WrapStyle.valueOf(wrap);
399
        return WrapStyle.valueOf(wrap);
397
    }
400
    }
398
401
402
    /**
403
     * @since 0.67
404
     */
399
    public WrapStyle wrapTryResources() {
405
    public WrapStyle wrapTryResources() {
400
        String wrap = preferences.get(wrapTryResources, getDefaultAsString(wrapTryResources));
406
        String wrap = preferences.get(wrapTryResources, getDefaultAsString(wrapTryResources));
401
        return WrapStyle.valueOf(wrap);
407
        return WrapStyle.valueOf(wrap);
Lines 548-553 Link Here
548
        return preferences.getBoolean(spaceBeforeWhileParen, getDefaultAsBoolean(spaceBeforeWhileParen));
554
        return preferences.getBoolean(spaceBeforeWhileParen, getDefaultAsBoolean(spaceBeforeWhileParen));
549
    }
555
    }
550
556
557
    /**
558
     * @since 0.67
559
     */
551
    public boolean spaceBeforeTryParen() {
560
    public boolean spaceBeforeTryParen() {
552
        return preferences.getBoolean(spaceBeforeTryParen, getDefaultAsBoolean(spaceBeforeTryParen));
561
        return preferences.getBoolean(spaceBeforeTryParen, getDefaultAsBoolean(spaceBeforeTryParen));
553
    }
562
    }
Lines 668-673 Link Here
668
        return preferences.getBoolean(spaceWithinSwitchParens, getDefaultAsBoolean(spaceWithinSwitchParens));
677
        return preferences.getBoolean(spaceWithinSwitchParens, getDefaultAsBoolean(spaceWithinSwitchParens));
669
    }
678
    }
670
679
680
    /**
681
     * @since 0.67
682
     */
671
    public boolean spaceWithinTryParens() {
683
    public boolean spaceWithinTryParens() {
672
        return preferences.getBoolean(spaceWithinTryParens, getDefaultAsBoolean(spaceWithinTryParens));
684
        return preferences.getBoolean(spaceWithinTryParens, getDefaultAsBoolean(spaceWithinTryParens));
673
    }
685
    }
(-)a/java.source/src/org/netbeans/api/java/source/TreeMaker.java (+20 lines)
Lines 459-464 Link Here
459
        return delegate.Continue(label);
459
        return delegate.Continue(label);
460
    }
460
    }
461
461
462
    /**
463
     * Creates new DisjointTypeTree.
464
     *
465
     * @param typeComponents components from which the DisjointTypeTree should be created.
466
     *                       The components should either be {@link ExpressionTree} (qualified or unqualified identifier),
467
     *                       {@link PrimitiveTypeTree}, {@link WildcardTree}, {@link ParameterizedTypeTree} or {@link ArrayTypeTree}.
468
     * @return newly created DisjointTypeTree
469
     * @since 0.67
470
     */
462
    public DisjointTypeTree DisjointType(List<? extends Tree> typeComponents) {
471
    public DisjointTypeTree DisjointType(List<? extends Tree> typeComponents) {
463
        return delegate.DisjointType(typeComponents);
472
        return delegate.DisjointType(typeComponents);
464
    }
473
    }
Lines 917-922 Link Here
917
        return Try(Collections.<Tree>emptyList(), tryBlock, catches, finallyBlock);
926
        return Try(Collections.<Tree>emptyList(), tryBlock, catches, finallyBlock);
918
    }
927
    }
919
928
929
    /**
930
     * Creates a new TryTree.
931
     *
932
     * @param resource     the resources of the try clause. The elements of the list
933
     *                     should either be {@link VariableTree}s or {@link ExpressionTree}s.
934
     * @param tryBlock     the statement block in the try clause.
935
     * @param catches      the list of catch clauses, or an empty list.
936
     * @param finallyBlock the finally clause, or null.
937
     * @see com.sun.source.tree.TryTree
938
     * @since 0.67
939
     */
920
    public TryTree Try(List<? extends Tree> resources,
940
    public TryTree Try(List<? extends Tree> resources,
921
                BlockTree tryBlock,
941
                BlockTree tryBlock,
922
                List<? extends CatchTree> catches,
942
                List<? extends CatchTree> catches,
(-)a/java.source/src/org/netbeans/api/java/source/TreeUtilities.java (+14 lines)
Lines 84-89 Link Here
84
 */
84
 */
85
public final class TreeUtilities {
85
public final class TreeUtilities {
86
    
86
    
87
    /**{@link Kind}s that are represented by {@link ClassTree}.
88
     * 
89
     * @since 0.67
90
     */
91
    public static final Set<Kind> CLASS_TREE_KINDS = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE);
92
    
87
    private final CompilationInfo info;
93
    private final CompilationInfo info;
88
    private final CommentHandlerService handler;
94
    private final CommentHandlerService handler;
89
    
95
    
Lines 95-114 Link Here
95
    }
101
    }
96
    
102
    
97
    /**Checks whether the given tree represents a class.
103
    /**Checks whether the given tree represents a class.
104
     * @deprecated since 0.67, <code>Tree.getKind() == Kind.CLASS</code> should be used instead.
98
     */
105
     */
106
    @Deprecated
99
    public boolean isClass(ClassTree tree) {
107
    public boolean isClass(ClassTree tree) {
100
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & (Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION)) == 0;
108
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & (Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION)) == 0;
101
    }
109
    }
102
    
110
    
103
    /**Checks whether the given tree represents an interface.
111
    /**Checks whether the given tree represents an interface.
112
     * @deprecated since 0.67, <code>Tree.getKind() == Kind.INTERFACE</code> should be used instead.
104
     */
113
     */
114
    @Deprecated
105
    public boolean isInterface(ClassTree tree) {
115
    public boolean isInterface(ClassTree tree) {
106
        final long flags = ((JCTree.JCModifiers) tree.getModifiers()).flags;
116
        final long flags = ((JCTree.JCModifiers) tree.getModifiers()).flags;
107
        return (flags & Flags.INTERFACE) != 0 && (flags & Flags.ANNOTATION) == 0;
117
        return (flags & Flags.INTERFACE) != 0 && (flags & Flags.ANNOTATION) == 0;
108
    }
118
    }
109
    
119
    
110
    /**Checks whether the given tree represents an enum.
120
    /**Checks whether the given tree represents an enum.
121
     * @deprecated since 0.67, <code>Tree.getKind() == Kind.ENUM</code> should be used instead.
111
     */
122
     */
123
    @Deprecated
112
    public boolean isEnum(ClassTree tree) {
124
    public boolean isEnum(ClassTree tree) {
113
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ENUM) != 0;
125
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ENUM) != 0;
114
    }
126
    }
Lines 121-127 Link Here
121
    }
133
    }
122
    
134
    
123
    /**Checks whether the given tree represents an annotation.
135
    /**Checks whether the given tree represents an annotation.
136
     * @deprecated since 0.67, <code>Tree.getKind() == Kind.ANNOTATION_TYPE</code> should be used instead.
124
     */
137
     */
138
    @Deprecated
125
    public boolean isAnnotation(ClassTree tree) {
139
    public boolean isAnnotation(ClassTree tree) {
126
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ANNOTATION) != 0;
140
        return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ANNOTATION) != 0;
127
    }
141
    }
(-)a/libs.javacapi/nbproject/project.properties (-1 / +1 lines)
Lines 46-52 Link Here
46
javadoc.title=Javac API
46
javadoc.title=Javac API
47
nbm.homepage=http://jackpot.netbeans.org/
47
nbm.homepage=http://jackpot.netbeans.org/
48
nbm.module.author=Petr Hrebejk, Sun Microsystems, Inc.
48
nbm.module.author=Petr Hrebejk, Sun Microsystems, Inc.
49
spec.version.base=0.15.0
49
spec.version.base=7.0.0
50
release.external/javac-api-nb-7.0-b07.jar=modules/ext/javac-api-nb-7.0-b07.jar
50
release.external/javac-api-nb-7.0-b07.jar=modules/ext/javac-api-nb-7.0-b07.jar
51
javadoc.arch=${basedir}/arch.xml
51
javadoc.arch=${basedir}/arch.xml
52
module.javadoc.packages=com.sun.source.tree,com.sun.source.util
52
module.javadoc.packages=com.sun.source.tree,com.sun.source.util

Return to bug 190767