New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModificationException in saved diagram index #1612

Closed
philip-alldredge opened this Issue Oct 24, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@philip-alldredge
Collaborator

philip-alldredge commented Oct 24, 2018

A ConcurrentModificationException can occur when opening a diagram using the context menu.

org.eclipse.e4.core.di.InjectionException: java.util.ConcurrentModificationException
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$EntrySpliterator.forEachRemaining(Unknown Source)
at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
at java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.osate.ge.internal.indexing.SavedDiagramIndex.getDiagramsByContexts(SavedDiagramIndex.java:367)
at org.osate.ge.internal.indexing.SavedDiagramIndex.getDiagramsByContext(SavedDiagramIndex.java:357)
at org.osate.ge.internal.services.impl.DefaultDiagramService.findDiagramsByContextBusinessObject(DefaultDiagramService.java:190)
at org.osate.ge.internal.services.impl.DefaultDiagramService.openOrCreateDiagramForBusinessObject(DefaultDiagramService.java:199)
at org.osate.ge.internal.services.DiagramService.openOrCreateDiagramForBusinessObject(DiagramService.java:70)
at org.osate.ge.internal.ui.handlers.GoToImplementationDiagramHandler.execute(GoToImplementationDiagramHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
at sun.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
... 36 more

@philip-alldredge

This comment has been minimized.

Collaborator

philip-alldredge commented Oct 24, 2018

Several code reviews have been conducted. So far, the only plausible explanation so far is that SavedDiagramIndexInvalidator, a resource change listener, is being called while fetching information about the diagrams. Adjustments to the saved diagram index is protected by synchronized blocks but it appears that the invalidator is being called by the same thread. Although the issue hasn't been reliably reproduced, it has been confirmed that the change listeners will be notified in the running thread under certain circumstances. The theory is that while walking the workspace tree, Eclipse determined that something has changed and sends out notifications.

@wafflebot wafflebot bot added the in progress label Oct 24, 2018

philip-alldredge added a commit that referenced this issue Oct 24, 2018

@lwrage

This comment has been minimized.

Contributor

lwrage commented Oct 29, 2018

@philip-alldredge Is this fixed with PR #1613?

@philip-alldredge

This comment has been minimized.

Collaborator

philip-alldredge commented Oct 29, 2018

Yes. Closing...

@wafflebot wafflebot bot removed the in progress label Oct 29, 2018

@lwrage lwrage added this to the 2.3.6 milestone Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment