Skip to content
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 ViewDiagramDescriptionConverter #1176

Closed
pcdavid opened this issue Apr 22, 2022 · 0 comments · Fixed by #1188
Closed

ConcurrentModificationException in ViewDiagramDescriptionConverter #1176

pcdavid opened this issue Apr 22, 2022 · 0 comments · Fixed by #1188

Comments

@pcdavid
Copy link
Member

pcdavid commented Apr 22, 2022

The following exception can easily occur when creating custom studios:

java.util.ConcurrentModificationException: null
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1584) ~[na:na]
	at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1607) ~[na:na]
	at org.eclipse.sirius.components.emf.view.diagram.ViewDiagramDescriptionConverter.createToolSections(ViewDiagramDescriptionConverter.java:281) ~[sirius-components-emf-2022.3.7.jar!/:2022.3.7]
	at org.eclipse.sirius.components.emf.view.diagram.ViewDiagramDescriptionConverter.convert(ViewDiagramDescriptionConverter.java:146) ~[sirius-components-emf-2022.3.7.jar!/:2022.3.7]
	at org.eclipse.sirius.components.emf.view.ViewConverter.lambda$convert$2(ViewConverter.java:71) ~[sirius-components-emf-2022.3.7.jar!/:2022.3.7]
[...]
	at org.eclipse.sirius.components.emf.view.ViewConverter.convert(ViewConverter.java:57) ~[sirius-components-emf-2022.3.7.jar!/:2022.3.7]

This is probably caused by a85988f which made ViewDiagramDescriptionConverter a singleton (@Service), but the conversion code is not thread-safe or even reentrant as it keeps some mutable state during the conversion in convertedNodes and convertedEdges.

@pcdavid pcdavid added this to the 2022.5.0 milestone Apr 22, 2022
florianbarbin added a commit that referenced this issue Apr 26, 2022
ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
florianbarbin added a commit that referenced this issue Apr 26, 2022
ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
@pcdavid pcdavid linked a pull request Apr 27, 2022 that will close this issue
39 tasks
florianbarbin added a commit that referenced this issue Apr 27, 2022
ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
florianbarbin added a commit that referenced this issue Apr 28, 2022
ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
sbegaudeau pushed a commit that referenced this issue Apr 29, 2022
…ionConverter

ViewDiagramDescriptionConverter is now a service but two attributes
convertedNodes and convertedEdges were mutable and used during the
conversion.

Bug: #1176
Signed-off-by: Florian Barbin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants