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

(-)src/org/netbeans/api/java/classpath/GlobalPathRegistry.java (+12 lines)
Lines 13-18 Link Here
13
13
14
package org.netbeans.api.java.classpath;
14
package org.netbeans.api.java.classpath;
15
15
16
import java.beans.PropertyChangeEvent;
17
import java.beans.PropertyChangeListener;
16
import java.util.ArrayList;
18
import java.util.ArrayList;
17
import java.util.Arrays;
19
import java.util.Arrays;
18
import java.util.Collection;
20
import java.util.Collection;
Lines 97-102 Link Here
97
            }
99
            }
98
        }
100
        }
99
    };
101
    };
102
    private PropertyChangeListener classpathListener = new PropertyChangeListener() {
103
        public void propertyChange(PropertyChangeEvent evt) {
104
            synchronized (GlobalPathRegistry.this) {
105
                //Reset cache
106
                GlobalPathRegistry.this.resetSourceRootsCache ();
107
            }
108
        }
109
    };
100
    
110
    
101
    private GlobalPathRegistry() {}
111
    private GlobalPathRegistry() {}
102
    
112
    
Lines 147-152 Link Here
147
                }
157
                }
148
                if (added != null && !added.contains(paths[i]) && !l.contains(paths[i])) {
158
                if (added != null && !added.contains(paths[i]) && !l.contains(paths[i])) {
149
                    added.add(paths[i]);
159
                    added.add(paths[i]);
160
                    paths[i].addPropertyChangeListener(classpathListener);
150
                }
161
                }
151
                l.add(paths[i]);
162
                l.add(paths[i]);
152
            }
163
            }
Lines 193-198 Link Here
193
                }
204
                }
194
                if (removed != null && !removed.contains(paths[i]) && !l2.contains(paths[i])) {
205
                if (removed != null && !removed.contains(paths[i]) && !l2.contains(paths[i])) {
195
                    removed.add(paths[i]);
206
                    removed.add(paths[i]);
207
                    paths[i].removePropertyChangeListener(classpathListener);
196
                }
208
                }
197
            }
209
            }
198
            this.paths.put(id, l2);
210
            this.paths.put(id, l2);

Return to bug 51545