Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337549 - concurrentmodificationexception occurs while loading the node(tree structure)
Summary: concurrentmodificationexception occurs while loading the node(tree structure)
Status: RESOLVED WORKSFORME
Alias: None
Product: EMF
Classification: Modeling
Component: Edit (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-18 06:11 EST by madhuri CLA
Modified: 2011-02-22 06:21 EST (History)
0 users

See Also:


Attachments
File which throws the ConcurrentModificationException (55.18 KB, text/plain)
2011-02-22 06:21 EST, madhuri CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description madhuri CLA 2011-02-18 06:11:26 EST
Build Identifier: eclipse.buildId=I20100608-0911

An eclipse application is launched with own perspective(ACE) opened.The node in the tree structure get loaded.While loading the node and node elements,the following error is displayed in the error log.

!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.util.ConcurrentModificationException)
	at org.eclipse.swt.SWT.error(SWT.java:4083)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
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.edit.provider.ItemProviderAdapter.getChildren(ItemProviderAdapter.java:340)
	at org.eclipse.emf.edit.provider.ItemProviderAdapter.hasChildren(ItemProviderAdapter.java:397)
	at org.eclipse.emf.edit.provider.ItemProviderAdapter.hasChildren(ItemProviderAdapter.java:384)
	at org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.hasChildren(AdapterFactoryContentProvider.java:198)
	at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2086)
	at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:588)
	at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2112)
	at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2794)
	at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:852)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1832)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1799)
	at org.eclipse.jface.viewers.StructuredViewer$8.run(StructuredViewer.java:1514)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1422)
	at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1383)
	at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1512)
	at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:548)
	at org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider$ViewerRefresh.refresh(AdapterFactoryContentProvider.java:495)
	at org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider$ViewerRefresh.run(AdapterFactoryContentProvider.java:463)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 23 more


Don't know what is the reason?
I don't see anything that is related to my code in the log displayed.
Can anyone help on this issue?

Thank you in advance...

Reproducible: Always
Comment 1 Ed Merks CLA 2011-02-21 22:13:28 EST
If I can't reproduce it, I can't comment on it.  Most likely you're doing something funky in your model's implementation classes that I'd need to see.  If you can provide a reproducible test case, please reopen it.
Comment 2 madhuri CLA 2011-02-22 06:21:01 EST
Created attachment 189470 [details]
File which throws the ConcurrentModificationException

In the Attached file,the exception is thrown inside the method LoadRepository().
While debugging,Found that its thrown at the first line of 
 for(MSkeleton skeleton : getSortedSkeletonList(skeletons)){
}
 
how to make changes so that this ConcurrentModificationException does not occurs?