summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-01-28 04:38:30 (EST)
committerCaspar De Groot2011-01-28 04:38:30 (EST)
commit7983e217e43292d1d1a8d83acac0da814247f6be (patch)
tree4323c9ceaaa6779737c21c788f7baa4fb76f15c1
parent0a0957a9f9c95163247fdaaa0e4dda57e74463b2 (diff)
downloadcdo-7983e217e43292d1d1a8d83acac0da814247f6be.zip
cdo-7983e217e43292d1d1a8d83acac0da814247f6be.tar.gz
cdo-7983e217e43292d1d1a8d83acac0da814247f6be.tar.bz2
[335546] RemoveCrossReferences could throw ConcurrentModEx
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335546
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index fc495ea..b5c11d0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -143,6 +143,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -2028,6 +2029,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
for (CDOObject referencer : referencers)
{
+ List<Pair<Setting, EObject>> objectsToBeRemoved = new LinkedList<Pair<Setting, EObject>>();
EContentsEList.FeatureIterator<EObject> it = (EContentsEList.FeatureIterator<EObject>)referencer
.eCrossReferences().iterator();
while (it.hasNext())
@@ -2057,9 +2059,14 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
}
Setting setting = ((InternalEObject)referencer).eSetting(reference);
- EcoreUtil.remove(setting, referencedObject);
+ objectsToBeRemoved.add(new Pair<Setting, EObject>(setting, referencedObject));
}
}
+
+ for (Pair<Setting, EObject> pair : objectsToBeRemoved)
+ {
+ EcoreUtil.remove(pair.getElement1(), pair.getElement2());
+ }
}
}