Index: src/org/netbeans/api/java/classpath/GlobalPathRegistry.java =================================================================== RCS file: /cvs/java/api/src/org/netbeans/api/java/classpath/GlobalPathRegistry.java,v retrieving revision 1.9 diff -u -r1.9 GlobalPathRegistry.java --- src/org/netbeans/api/java/classpath/GlobalPathRegistry.java 18 Jun 2004 03:00:16 -0000 1.9 +++ src/org/netbeans/api/java/classpath/GlobalPathRegistry.java 18 Nov 2004 09:57:04 -0000 @@ -13,6 +13,8 @@ package org.netbeans.api.java.classpath; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -97,6 +99,14 @@ } } }; + private PropertyChangeListener classpathListener = new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent evt) { + synchronized (GlobalPathRegistry.this) { + //Reset cache + GlobalPathRegistry.this.resetSourceRootsCache (); + } + } + }; private GlobalPathRegistry() {} @@ -147,6 +157,7 @@ } if (added != null && !added.contains(paths[i]) && !l.contains(paths[i])) { added.add(paths[i]); + paths[i].addPropertyChangeListener(classpathListener); } l.add(paths[i]); } @@ -193,6 +204,7 @@ } if (removed != null && !removed.contains(paths[i]) && !l2.contains(paths[i])) { removed.add(paths[i]); + paths[i].removePropertyChangeListener(classpathListener); } } this.paths.put(id, l2);