Bug 372052 - ConcurrentModificationException in builder
Summary: ConcurrentModificationException in builder
Status: NEW
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-20 13:47 EST by Ed Willink CLA
Modified: 2016-04-07 08:13 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2012-02-20 13:47:39 EST
For 3.3M5 I get

java.util.ConcurrentModificationException
	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:756)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:710)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
	at org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.fixVariablesAndPositions(EMtlResourceImpl.java:148)
	at org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doSave(EMtlResourceImpl.java:123)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1417)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:986)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.build(AcceleoParser.java:455)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.buildFile(AcceleoParser.java:228)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:111)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Ed Willink CLA 2012-08-13 17:06:24 EDT
Still present in 3.3; possibly triggered by an EGIT Reset Hard to advance a local branch.
Comment 2 Ed Willink CLA 2012-09-03 14:25:39 EDT
Any news? Still present in 3.3.1 (31 August).

I'm getting so used to this pop-up that I'll no longer notice real errors from other tools.
Comment 3 Ed Willink CLA 2012-10-15 09:55:34 EDT
I think a CME during a build causes nasty knock on effects.

The problem markers get out of sync, so that significant explicit rebuilding and sometimes explicit marker deletion is needed to force rebuilds from most nested to least nested to eventually get back to a good build.
Comment 4 Laurent Goubet CLA 2016-04-07 08:13:41 EDT
The code in question is :

		List<EObject> synchronizedList = Collections.synchronizedList(getContents());
		synchronized(synchronizedList) {
			Iterator<EObject> contentsIterator = synchronizedList.iterator();

"Collections.synchronizedList" doesn't make a copy of the source list, so synchronizing _only_ this point of the code is useless (all other accesses to "getContents" are unsynchronized). However, we never managed to reproduce this ourselves on a sample we can reuse and debug. Leaving this opened for now without modification of the code until we actually reproduce.