Project

General

Profile

bug #8916

ConcurrentModificationException in CdmFormFactory.destroyElement()

Added by Katja Luther 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Highest
Category:
taxeditor
Target version:
Start date:
03/30/2020
Due date:
% Done:

50%

Severity:
blocker
Found in Version:

Description

While updating the views sometimes a ConcurrentModificationException appears while AbstractCdmDataViewerE4.destroySections calls CdmFormFactory.destroyElement().

Associated revisions

Revision 002ea91b (diff)
Added by Katja Luther 7 months ago

fix #8916: avoid concurrent modification exception

Revision c2286033 (diff)
Added by Katja Luther 7 months ago

fix #8916: avoid concurrent modification exception

Revision 9bc35d79 (diff)
Added by Andreas Müller 7 months ago

ref #8916 try to fix ConcurrentModificationException by using temporary set

History

#1 Updated by Katja Luther 7 months ago

mail WB:

Hallo,
entfernen der Doubtful-Flag im Details View, Save -> Fehler
HG
W

last remote method : http://api.cybertaxonomy.org:80/caryophyllales_spp/remoting/taxonnode.service
last remote request client time : 2020-03-29T08:13:56.525
last remote request response header time : Sun, 29 Mar 2020 08:13:56 GMT
client error time : 2020-03-29T08:13:56.931
login : w.berendsohn
editor version : 5.13.1
server : api.cybertaxonomy.org (cybertaxonomy.org) / caryophyllales_spp
schema version : 5.12.0.0.20191202
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.eclipse.swt.SWTException: Failed to execute runnable (java.util.ConcurrentModificationException)
                at org.eclipse.swt.SWT.error(SWT.java:4533)
                at org.eclipse.swt.SWT.error(SWT.java:4448)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
                at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
                at eu.etaxonomy.taxeditor.Application.start(Application.java:24)
                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(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.util.ConcurrentModificationException
                at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
                at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:565)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:566)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:566)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.destroySections(AbstractCdmDataViewerE4.java:183)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.showEmptyPage(DetailsPartE4.java:131)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.selectionChanged_internal(DetailsPartE4.java:117)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4$DelaySelection.run(AbstractCdmEditorPartE4.java:94)
                at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
                ... 23 more

#2 Updated by Katja Luther 7 months ago

mail WB:

Hallo,
nach Save nach Ändern der sec.-Ref. im Details-View.
HG
W

last remote method : http://api.cybertaxonomy.org:80/caryophyllales_spp/remoting/taxonnode.service
last remote request client time : 2020-03-29T17:53:09.635
last remote request response header time : Sun, 29 Mar 2020 17:53:09 GMT
client error time : 2020-03-29T17:53:10.369
login : w.berendsohn
editor version : 5.13.1
server : api.cybertaxonomy.org (cybertaxonomy.org) / caryophyllales_spp
schema version : 5.12.0.0.20191202
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.eclipse.swt.SWTException: Failed to execute runnable (java.util.ConcurrentModificationException)
                at org.eclipse.swt.SWT.error(SWT.java:4533)
                at org.eclipse.swt.SWT.error(SWT.java:4448)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
                at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
                at eu.etaxonomy.taxeditor.Application.start(Application.java:24)
                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(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
                at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.util.ConcurrentModificationException
                at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
                at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:565)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:566)
                at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.destroyElement(CdmFormFactory.java:566)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.destroySections(AbstractCdmDataViewerE4.java:183)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.showEmptyPage(DetailsPartE4.java:131)
                at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.selectionChanged_internal(DetailsPartE4.java:117)
                at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4$DelaySelection.run(AbstractCdmEditorPartE4.java:94)
                at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
                at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
                ... 23 more

#3 Updated by Katja Luther 7 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#4 Updated by Katja Luther 7 months ago

  • Assignee changed from Katja Luther to Andreas Müller
  • Target version changed from Unassigned CDM tickets to Release 5.14
  • Severity changed from normal to blocker

Avoid the ConcurrentModificationException by using an iterator for iterating over the elements of a set to destroy the cdmFormElements.

#5 Updated by Andreas Müller 7 months ago

  • Assignee changed from Andreas Müller to Katja Luther

The above fix can not work because the remove is not called on the iterator. I changed the code in a way that a temporary set is used so ConcurrentModification can not happen on the elements set.
I hope this fixes this issue.

Please review.

#6 Updated by Katja Luther 7 months ago

  • Status changed from Resolved to Closed

I could not reproduce the exception anymore and the solution seems to be correct.

#7 Updated by Katja Luther 7 months ago

  • Assignee changed from Katja Luther to Andreas Müller

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)