[x] I have checked that this bug has not yet been reported by someone else
[x] I have checked that this bug appears on Chrome
[x] I have specified the version :
2023.10.7
[x] I have specified my environment :
All
Steps to reproduce
Create a ReconnectSourceTool or ReconnectTargetTool on a View.
Try to apply this on an incompatible Node.
Caused by: java.lang.ClassCastException: class org.eclipse.syson.sysml.impl.PortUsageImpl cannot be cast to class org.eclipse.syson.sysml.Classifier (org.eclipse.syson.sysml.impl.PortUsageImpl and org.eclipse.syson.sysml.Classifier are in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @570badb8)
at org.eclipse.syson.sysml.impl.SubclassificationImpl.eSet(SubclassificationImpl.java:208) ~[classes/:na]
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1110) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.sirius.ecore.extender.business.internal.accessor.ecore.EcoreIntrinsicExtender.eSet(EcoreIntrinsicExtender.java:322) ~[org.eclipse.sirius.ecore.extender-7.2.0-SNAPSHOT.jar:na]
at org.eclipse.sirius.ecore.extender.business.internal.accessor.ecore.EcoreIntrinsicExtender.eAdd(EcoreIntrinsicExtender.java:104) ~[org.eclipse.sirius.ecore.extender-7.2.0-SNAPSHOT.jar:na]
at org.eclipse.sirius.components.view.emf.OperationInterpreterViewSwitch.caseSetValue(OperationInterpreterViewSwitch.java:117) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.OperationInterpreterViewSwitch.caseSetValue(OperationInterpreterViewSwitch.java:47) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.util.ViewSwitch.doSwitch(ViewSwitch.java:155) ~[sirius-components-view-2023.10.7.jar:2023.10.7]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreterViewSwitch.defaultCase(DiagramOperationInterpreterViewSwitch.java:137) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreterViewSwitch.defaultCase(DiagramOperationInterpreterViewSwitch.java:56) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:58) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:58) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreter.executeOperation(DiagramOperationInterpreter.java:97) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreter.executeOperations(DiagramOperationInterpreter.java:83) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.OperationInterpreterViewSwitch.caseChangeContext(OperationInterpreterViewSwitch.java:86) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.OperationInterpreterViewSwitch.caseChangeContext(OperationInterpreterViewSwitch.java:47) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.util.ViewSwitch.doSwitch(ViewSwitch.java:137) ~[sirius-components-view-2023.10.7.jar:2023.10.7]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreterViewSwitch.defaultCase(DiagramOperationInterpreterViewSwitch.java:137) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreterViewSwitch.defaultCase(DiagramOperationInterpreterViewSwitch.java:56) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:58) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:58) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69) ~[org.eclipse.emf.ecore-2.23.0.jar:na]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreter.executeOperation(DiagramOperationInterpreter.java:97) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.diagram.DiagramOperationInterpreter.executeOperations(DiagramOperationInterpreter.java:83) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.view.emf.diagram.ViewReconnectionToolsExecutor.execute(ViewReconnectionToolsExecutor.java:111) ~[sirius-components-view-emf-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.diagrams.handlers.ReconnectEdgeEventHandler.invokeReconnectEdgeTool(ReconnectEdgeEventHandler.java:209) ~[sirius-components-collaborative-diagrams-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.diagrams.handlers.ReconnectEdgeEventHandler.handleReconnect(ReconnectEdgeEventHandler.java:122) ~[sirius-components-collaborative-diagrams-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.diagrams.handlers.ReconnectEdgeEventHandler.handle(ReconnectEdgeEventHandler.java:105) ~[sirius-components-collaborative-diagrams-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.diagrams.DiagramEventProcessor.handle(DiagramEventProcessor.java:121) ~[sirius-components-collaborative-diagrams-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.editingcontext.EditingContextEventProcessor.handleRepresentationInput(EditingContextEventProcessor.java:320) ~[sirius-components-collaborative-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.editingcontext.EditingContextEventProcessor.doHandle(EditingContextEventProcessor.java:245) ~[sirius-components-collaborative-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.collaborative.editingcontext.EditingContextEventProcessor.lambda$handle$2(EditingContextEventProcessor.java:214) ~[sirius-components-collaborative-2023.10.7.jar:2023.10.7]
at org.eclipse.sirius.components.web.concurrent.DelegatingRequestContextRunnable.run(DelegatingRequestContextRunnable.java:40) ~[sirius-components-web-2023.10.7.jar:2023.10.7]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
Expected behavior
The reconnection of an Edge on an incompatible source/target mapping is forbidden.
Actual behavior
The reconnection of an Edge on an incompatible source/target mapping is allowed.
The backend raises an exception.
The fix should probably be done in ReconnectEdgeEventHandler or ViewReconnectionToolsExecutor.
Steps to reproduce
Create a ReconnectSourceTool or ReconnectTargetTool on a View. Try to apply this on an incompatible Node.
Expected behavior
The reconnection of an Edge on an incompatible source/target mapping is forbidden.
Actual behavior
The reconnection of an Edge on an incompatible source/target mapping is allowed. The backend raises an exception.
The fix should probably be done in
ReconnectEdgeEventHandler
orViewReconnectionToolsExecutor
.