Synchronized access to caching maps added - additional fix to issue #57119.
1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/versioning/RevisionList.java Wed Apr 13 15:13:40 2005 +0000
1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/versioning/RevisionList.java Wed Apr 13 16:29:23 2005 +0000
1.3 @@ -76,9 +76,11 @@
1.4
1.5 public boolean remove(Object obj) {
1.6 boolean status = super.remove(obj);
1.7 - nodeDelegatesWithoutChildren.remove(obj);
1.8 - nodeDelegatesWithChildren.remove(obj);
1.9 - existingChildren.remove(obj);
1.10 + synchronized (this) {
1.11 + nodeDelegatesWithoutChildren.remove(obj);
1.12 + nodeDelegatesWithChildren.remove(obj);
1.13 + existingChildren.remove(obj);
1.14 + }
1.15 //System.out.println("RevisionList.remove("+((RevisionItem) obj).getRevision()+")");
1.16 fireChanged();
1.17 return status;
1.18 @@ -86,9 +88,11 @@
1.19
1.20 public boolean removeAll(Collection c) {
1.21 boolean status = super.removeAll(c);
1.22 - for (Iterator it = c.iterator(); it.hasNext(); nodeDelegatesWithoutChildren.remove(it.next()));
1.23 - for (Iterator it = c.iterator(); it.hasNext(); nodeDelegatesWithChildren.remove(it.next()));
1.24 - for (Iterator it = c.iterator(); it.hasNext(); existingChildren.remove(it.next()));
1.25 + synchronized (this) {
1.26 + for (Iterator it = c.iterator(); it.hasNext(); nodeDelegatesWithoutChildren.remove(it.next()));
1.27 + for (Iterator it = c.iterator(); it.hasNext(); nodeDelegatesWithChildren.remove(it.next()));
1.28 + for (Iterator it = c.iterator(); it.hasNext(); existingChildren.remove(it.next()));
1.29 + }
1.30 //System.out.println("RevisionList.removeAll("+c+"): c.size() = "+c.size());
1.31 fireChanged();
1.32 return status;