Author: scabanovich
Date: 2010-10-29 05:44:21 -0400 (Fri, 29 Oct 2010)
New Revision: 26125
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
Log:
JBIDE-7319
https://jira.jboss.org/browse/JBIDE-7319
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java 2010-10-29
09:41:18 UTC (rev 26124)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java 2010-10-29
09:44:21 UTC (rev 26125)
@@ -2,8 +2,10 @@
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -76,7 +78,7 @@
public void pathLoaded(IPath path) {
String p = paths2.get(path);
- if(p != null) {
+ if(p != null) synchronized (processedPaths) {
processedPaths.add(p);
}
}
@@ -88,9 +90,31 @@
public void clean() {
paths = null;
if(paths2 != null) paths2.clear();
- processedPaths.clear();
+ synchronized (processedPaths) {
+ processedPaths.clear();
+ }
}
+ protected List<String> syncProcessedPaths() {
+ ArrayList<String> removed = new ArrayList<String>();
+ synchronized (processedPaths) {
+ Iterator<String> it = processedPaths.iterator();
+ while(it.hasNext()) {
+ String p = it.next();
+ if(paths.contains(p)) continue;
+ removed.add(p);
+ it.remove();
+ }
+ }
+ return removed;
+ }
+
+ protected boolean requestForLoad(String p) {
+ synchronized (processedPaths) {
+ return processedPaths.add(p);
+ }
+ }
+
public void pathsChanged(List<String> paths) {
synchronized (this) {
libsModified = true;