Index: java/api/nbproject/project.xml =================================================================== RCS file: /cvs/java/api/nbproject/project.xml,v retrieving revision 1.11 diff -u -r1.11 project.xml --- java/api/nbproject/project.xml 3 Oct 2006 18:28:50 -0000 1.11 +++ java/api/nbproject/project.xml 19 Mar 2007 21:16:30 -0000 @@ -36,7 +36,7 @@ - 6.2 + 7.8 Index: java/api/test/unit/src/org/netbeans/api/java/classpath/GlobalPathRegistryTest.java =================================================================== RCS file: /cvs/java/api/test/unit/src/org/netbeans/api/java/classpath/GlobalPathRegistryTest.java,v retrieving revision 1.11 diff -u -r1.11 GlobalPathRegistryTest.java --- java/api/test/unit/src/org/netbeans/api/java/classpath/GlobalPathRegistryTest.java 2 Mar 2007 03:34:28 -0000 1.11 +++ java/api/test/unit/src/org/netbeans/api/java/classpath/GlobalPathRegistryTest.java 19 Mar 2007 21:16:30 -0000 @@ -42,6 +42,7 @@ import org.netbeans.spi.java.classpath.support.PathResourceBase; import org.openide.filesystems.FileStateInvalidException; import org.openide.filesystems.FileUtil; +import org.openide.util.ChangeSupport; import org.openide.util.Lookup; /** @@ -277,7 +278,7 @@ private static class Result implements SourceForBinaryQuery.Result { private FileObject[] sources; - private ArrayList listeners = new ArrayList (); + private final ChangeSupport changeSupport = new ChangeSupport(this); public Result (FileObject[] sources) { this.sources = sources; @@ -286,30 +287,19 @@ void setSources (FileObject[] sources) { this.sources = sources; - this.fireChange (); + this.changeSupport.fireChange (); } - public synchronized void addChangeListener(javax.swing.event.ChangeListener l) { - this.listeners.add (l); + public void addChangeListener(javax.swing.event.ChangeListener l) { + changeSupport.addChangeListener (l); } public FileObject[] getRoots() { return this.sources; } - public synchronized void removeChangeListener(javax.swing.event.ChangeListener l) { - this.listeners.remove (l); - } - - private void fireChange () { - Iterator it; - synchronized (this) { - it = ((ArrayList)this.listeners.clone()).iterator(); - } - ChangeEvent e = new ChangeEvent (this); - while (it.hasNext()) { - ((ChangeListener)it.next()).stateChanged(e); - } + public void removeChangeListener(javax.swing.event.ChangeListener l) { + changeSupport.removeChangeListener (l); } }