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 123762
Collapse All | Expand All

(-)apichanges.xml (+12 lines)
Lines 107-112 Link Here
107
    <changes>
107
    <changes>
108
        <change id="CAMEL_CASE_INSENSITIVE">
108
        <change id="CAMEL_CASE_INSENSITIVE">
109
            <api name="general"/>
109
            <api name="general"/>
110
            <summary>Added CancellableTreePathScanner(AtomicBoolean) and CancellableTreeScanner(AtomicBoolean)</summary>
111
            <version major="0" minor="29"/>
112
            <date day="17" month="12" year="2007"/>
113
            <author login="jlahoda"/>
114
            <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
115
            <description>
116
                Added constructors taking AtomicBoolean to the CancellableTreePathScanner and CancellableTreeScanner.
117
            </description>
118
            <issue number="000000"/>
119
        </change>
120
        <change id="CAMEL_CASE_INSENSITIVE">
121
            <api name="general"/>
110
            <summary>Added ClassIndex.NameKind.CAMEL_CASE_INSENSITIVE</summary>
122
            <summary>Added ClassIndex.NameKind.CAMEL_CASE_INSENSITIVE</summary>
111
            <version major="0" minor="28"/>
123
            <version major="0" minor="28"/>
112
            <date day="26" month="11" year="2007"/>
124
            <date day="26" month="11" year="2007"/>
(-)nbproject/project.properties (-1 / +1 lines)
Lines 43-49 Link Here
43
javadoc.title=Java Source
43
javadoc.title=Java Source
44
javadoc.arch=${basedir}/arch.xml
44
javadoc.arch=${basedir}/arch.xml
45
javadoc.apichanges=${basedir}/apichanges.xml
45
javadoc.apichanges=${basedir}/apichanges.xml
46
spec.version.base=0.28.0
46
spec.version.base=0.29.0
47
test.qa-functional.cp.extra=${refactoring/java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
47
test.qa-functional.cp.extra=${refactoring/java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
48
test.unit.run.cp.extra=${core.dir}/core/core.jar:\
48
test.unit.run.cp.extra=${core.dir}/core/core.jar:\
49
    ${core.dir}/lib/boot.jar:\
49
    ${core.dir}/lib/boot.jar:\
(-)src/org/netbeans/api/java/source/support/CancellableTreePathScanner.java (-6 / +25 lines)
Lines 42-47 Link Here
42
42
43
import com.sun.source.tree.Tree;
43
import com.sun.source.tree.Tree;
44
import com.sun.source.util.TreePathScanner;
44
import com.sun.source.util.TreePathScanner;
45
import java.util.concurrent.atomic.AtomicBoolean;
45
46
46
/**
47
/**
47
 *
48
 *
Lines 49-66 Link Here
49
 */
50
 */
50
public class CancellableTreePathScanner<R,P> extends TreePathScanner<R,P> {
51
public class CancellableTreePathScanner<R,P> extends TreePathScanner<R,P> {
51
52
52
    private boolean canceled;
53
    private final AtomicBoolean internalCanceled;
54
    private final AtomicBoolean canceled;
53
55
54
    /** Creates a new instance of CancellableTreeScanner */
56
    /**Construct a new CancellableTreePathScanner which can be canceled by calling
57
     * the {@link #cancel} method.
58
     */
55
    public CancellableTreePathScanner() {
59
    public CancellableTreePathScanner() {
60
        this(null);
56
    }
61
    }
57
62
58
    protected synchronized boolean isCanceled() {
63
    /**Construct a new CancellableTreePath Scanner which can be canceled either by calling
59
        return canceled;
64
     * the {@link #cancel} method, or by setting <code>true</code> into the provided
65
     * <code>canceled</code> {@link AtomicBoolean}.
66
     * 
67
     * @param canceled an {@link AtomicBoolean} through which this scanner can be canceled.
68
     *                 The scanner never changes the state of the {@link AtomicBoolean}.
69
     * @since 0.29
70
     */
71
    public CancellableTreePathScanner(AtomicBoolean canceled) {
72
        this.canceled = canceled;
73
        
74
        this.internalCanceled = new AtomicBoolean();
60
    }
75
    }
61
76
62
    public synchronized void cancel() {
77
    protected boolean isCanceled() {
63
        canceled = true;
78
        return internalCanceled.get() || (canceled != null && canceled.get());
79
    }
80
81
    public void cancel() {
82
        internalCanceled.set(true);
64
    }
83
    }
65
84
66
    /** @inheritDoc
85
    /** @inheritDoc
(-)src/org/netbeans/api/java/source/support/CancellableTreeScanner.java (-7 / +24 lines)
Lines 42-47 Link Here
42
42
43
import com.sun.source.tree.Tree;
43
import com.sun.source.tree.Tree;
44
import com.sun.source.util.TreeScanner;
44
import com.sun.source.util.TreeScanner;
45
import java.util.concurrent.atomic.AtomicBoolean;
45
46
46
/**
47
/**
47
 *
48
 *
Lines 49-68 Link Here
49
 */
50
 */
50
public class CancellableTreeScanner<R,P> extends TreeScanner<R,P> {
51
public class CancellableTreeScanner<R,P> extends TreeScanner<R,P> {
51
52
52
    private boolean canceled;
53
    private final AtomicBoolean internalCanceled;
54
    private final AtomicBoolean canceled;
53
55
54
    /**
56
    /**Construct a new CancellableTreeScanner which can be canceled by calling
55
     * Creates a new instance of CancellableTreeScanner
57
     * the {@link #cancel} method.
56
     */
58
     */
57
    public CancellableTreeScanner() {
59
    public CancellableTreeScanner() {
60
        this(null);
58
    }
61
    }
59
62
60
    protected synchronized boolean isCanceled() {
63
    /**Construct a new CancellableTreeScanner which can be canceled either by calling
61
        return canceled;
64
     * the {@link #cancel} method, or by setting <code>true</code> into the provided
65
     * <code>canceled</code> {@link AtomicBoolean}.
66
     * 
67
     * @param canceled an {@link AtomicBoolean} through which this scanner can be canceled.
68
     *                 The scanner never changes the state of the {@link AtomicBoolean}.
69
     * @since 0.29
70
     */
71
    public CancellableTreeScanner(AtomicBoolean canceled) {
72
        this.canceled = canceled;
73
        
74
        this.internalCanceled = new AtomicBoolean();
75
    }
76
    
77
    protected boolean isCanceled() {
78
        return internalCanceled.get() || (canceled != null && canceled.get());
62
    }
79
    }
63
80
64
    public synchronized void cancel() {
81
    public void cancel() {
65
        canceled = true;
82
        internalCanceled.set(true);
66
    }
83
    }
67
84
68
    /** @inheritDoc
85
    /** @inheritDoc

Return to bug 123762