Index: apichanges.xml =================================================================== RCS file: /cvs/java/source/apichanges.xml,v retrieving revision 1.19 diff -u -r1.19 apichanges.xml --- apichanges.xml 27 Nov 2007 16:36:33 -0000 1.19 +++ apichanges.xml 10 Dec 2007 14:47:56 -0000 @@ -107,6 +107,18 @@ + Added CancellableTreePathScanner(AtomicBoolean) and CancellableTreeScanner(AtomicBoolean) + + + + + + Added constructors taking AtomicBoolean to the CancellableTreePathScanner and CancellableTreeScanner. + + + + + Added ClassIndex.NameKind.CAMEL_CASE_INSENSITIVE Index: nbproject/project.properties =================================================================== RCS file: /cvs/java/source/nbproject/project.properties,v retrieving revision 1.41 diff -u -r1.41 project.properties --- nbproject/project.properties 27 Nov 2007 16:36:34 -0000 1.41 +++ nbproject/project.properties 10 Dec 2007 14:47:56 -0000 @@ -43,7 +43,7 @@ javadoc.title=Java Source javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=0.28.0 +spec.version.base=0.29.0 test.qa-functional.cp.extra=${refactoring/java.dir}/modules/ext/javac-api-nb-7.0-b07.jar test.unit.run.cp.extra=${core.dir}/core/core.jar:\ ${core.dir}/lib/boot.jar:\ Index: src/org/netbeans/api/java/source/support/CancellableTreePathScanner.java =================================================================== RCS file: /cvs/java/source/src/org/netbeans/api/java/source/support/CancellableTreePathScanner.java,v retrieving revision 1.3 diff -u -r1.3 CancellableTreePathScanner.java --- src/org/netbeans/api/java/source/support/CancellableTreePathScanner.java 1 Oct 2007 14:23:39 -0000 1.3 +++ src/org/netbeans/api/java/source/support/CancellableTreePathScanner.java 10 Dec 2007 14:47:56 -0000 @@ -42,6 +42,7 @@ import com.sun.source.tree.Tree; import com.sun.source.util.TreePathScanner; +import java.util.concurrent.atomic.AtomicBoolean; /** * @@ -49,18 +50,36 @@ */ public class CancellableTreePathScanner extends TreePathScanner { - private boolean canceled; + private final AtomicBoolean internalCanceled; + private final AtomicBoolean canceled; - /** Creates a new instance of CancellableTreeScanner */ + /**Construct a new CancellableTreePathScanner which can be canceled by calling + * the {@link #cancel} method. + */ public CancellableTreePathScanner() { + this(null); } - protected synchronized boolean isCanceled() { - return canceled; + /**Construct a new CancellableTreePath Scanner which can be canceled either by calling + * the {@link #cancel} method, or by setting true into the provided + * canceled {@link AtomicBoolean}. + * + * @param canceled an {@link AtomicBoolean} through which this scanner can be canceled. + * The scanner never changes the state of the {@link AtomicBoolean}. + * @since 0.29 + */ + public CancellableTreePathScanner(AtomicBoolean canceled) { + this.canceled = canceled; + + this.internalCanceled = new AtomicBoolean(); } - public synchronized void cancel() { - canceled = true; + protected boolean isCanceled() { + return internalCanceled.get() || (canceled != null && canceled.get()); + } + + public void cancel() { + internalCanceled.set(true); } /** @inheritDoc Index: src/org/netbeans/api/java/source/support/CancellableTreeScanner.java =================================================================== RCS file: /cvs/java/source/src/org/netbeans/api/java/source/support/CancellableTreeScanner.java,v retrieving revision 1.3 diff -u -r1.3 CancellableTreeScanner.java --- src/org/netbeans/api/java/source/support/CancellableTreeScanner.java 1 Oct 2007 14:23:39 -0000 1.3 +++ src/org/netbeans/api/java/source/support/CancellableTreeScanner.java 10 Dec 2007 14:47:56 -0000 @@ -42,6 +42,7 @@ import com.sun.source.tree.Tree; import com.sun.source.util.TreeScanner; +import java.util.concurrent.atomic.AtomicBoolean; /** * @@ -49,20 +50,36 @@ */ public class CancellableTreeScanner extends TreeScanner { - private boolean canceled; + private final AtomicBoolean internalCanceled; + private final AtomicBoolean canceled; - /** - * Creates a new instance of CancellableTreeScanner + /**Construct a new CancellableTreeScanner which can be canceled by calling + * the {@link #cancel} method. */ public CancellableTreeScanner() { + this(null); } - protected synchronized boolean isCanceled() { - return canceled; + /**Construct a new CancellableTreeScanner which can be canceled either by calling + * the {@link #cancel} method, or by setting true into the provided + * canceled {@link AtomicBoolean}. + * + * @param canceled an {@link AtomicBoolean} through which this scanner can be canceled. + * The scanner never changes the state of the {@link AtomicBoolean}. + * @since 0.29 + */ + public CancellableTreeScanner(AtomicBoolean canceled) { + this.canceled = canceled; + + this.internalCanceled = new AtomicBoolean(); + } + + protected boolean isCanceled() { + return internalCanceled.get() || (canceled != null && canceled.get()); } - public synchronized void cancel() { - canceled = true; + public void cancel() { + internalCanceled.set(true); } /** @inheritDoc