Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349052

Summary: Concurrent modification in change recorder
Product: [Modeling] EMF Reporter: Kenn Hussey <Kenn.Hussey>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: Kenn.Hussey: indigo+
Version: 2.7.0   
Target Milestone: SR1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Kenn Hussey CLA 2011-06-10 11:07:10 EDT
A concurrent modification exception occurs while consolidating the changes in a change recorder that is attached to objects with (unresolved) container proxies:

Caused by: java.util.ConcurrentModificationException
   at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:762)
   at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:710)
   at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:696)
   at org.eclipse.emf.ecore.change.util.ChangeRecorder.consolidateChanges(ChangeRecorder.java:231)


The fix is to change the isOrphan(EObject) method like this:

protected boolean isOrphan(EObject eObject) {
	return ((InternalEObject) eObject).eInternalContainer() == null && eObject.eResource() == null;
}
Comment 1 Kenn Hussey CLA 2011-08-29 18:12:21 EDT
The fix has been committed to CVS (head and maintenance).
Comment 2 Kenn Hussey CLA 2011-08-29 19:51:17 EDT
The fix is available in maintenance build M201108291525 and integration build I201108291838.