Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 577025

Summary: Potential regression since z-order for unsynchronized diagrams
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Laurent Redor <laurent.redor>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: steve.monnier
Version: unspecified   
Target Milestone: 7.0.0   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/187261
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=61056d7b76f023b6cd12d4a16333e21a3b53875c
Whiteboard:
Bug Depends on: 576722    
Bug Blocks: 574273    
Attachments:
Description Flags
tc2330.zip none

Description Laurent Redor CLA 2021-11-03 03:53:10 EDT
+++ This bug was initially created as a clone of Bug #576722 +++

This problem has been discovered in Capella. There is currently no reproduction use case with a simple Sirius viewpoint. The Capella scenario needs to be analysed.

Steps to reproduce:
* Import IFE project (from IFE-5.2.zip)
* Open "\[PAB] Focus on Network Transport" (under "In-Flight Entertainment System\Physical Architecture\Structure\IFE System")
* Synchronize the diagram (by clicking on contextual menu "Unsynchronized")
* Add a functional exchange between "Synchronize Audio Video" and "Initiate Audio-Video Stream"
* The following error is thrown: Uncaught exception during post-commit listener notifications

java.lang.IndexOutOfBoundsException: Index does not exist
	at org.eclipse.draw2d.Figure.add(Figure.java:140)
	at org.eclipse.draw2d.FreeformLayer.add(FreeformLayer.java:28)
	at org.eclipse.draw2d.ConnectionLayer.add(ConnectionLayer.java:43)
	at org.eclipse.gmf.runtime.draw2d.ui.internal.figures.ConnectionLayerEx.add(ConnectionLayerEx.java:53)
	at org.eclipse.draw2d.Figure.add(Figure.java:185)
	at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDDiagramEditPart.reorderEdgesFiguresAccordingToGmfOrder(AbstractDDiagramEditPart.java:356)
	at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDDiagramEditPart.refreshChildren(AbstractDDiagramEditPart.java:326)
	at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:726)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:644)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$3(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$3.run(GraphicalEditPart.java:862)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:852)
	at org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDDiagramEditPart.handleNotificationEvent(AbstractDDiagramEditPart.java:235)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.notifyChanged(GraphicalEditPart.java:1436)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:505)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:400)
	at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:74)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl$1.run(TransactionalEditingDomainImpl.java:781)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.postcommit(TransactionalEditingDomainImpl.java:771)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:404)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:135)
	at org.eclipse.sirius.diagram.ui.tools.internal.commands.WrappingCommandIgnoringAffectedFiles.execute(WrappingCommandIgnoringAffectedFiles.java:125)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:73)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:54)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:157)
	at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
	at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
	at org.eclipse.gef.tools.AbstractConnectionCreationTool.handleCreateConnection(AbstractConnectionCreationTool.java:256)
	at org.eclipse.gef.tools.ConnectionCreationTool.handleButtonDown(ConnectionCreationTool.java:77)
	at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
Comment 1 Eclipse Genie CLA 2021-11-03 04:05:02 EDT
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/187261
Comment 3 Laurent Redor CLA 2021-11-03 13:32:11 EDT
Created attachment 287439 [details]
tc2330.zip

Steps to reproduce:
* Import the modeling project tc2330 from tc2330.zip
* Open the diagram "new 2330 Diagram"
* Activate the filter "port collapse" (with tabbar filter drop down menu)
* Expected: The "red" ports are no longer visible.
* Deactivate the filter "port collapse" (with tabbar filter drop down menu)
* Expected: The "red" ports and associated edges are visible.
    * But is "Only one red port is visible and no edge is visible. There is an IndexOutOfBoundsException in Error Log view".
	
These steps to reproduce are extracted from tests of class org.eclipse.sirius.tests.swtbot.HideRevealDiagramElementsLabelsTestWithOldUI that fail randomly. After the above fix the automatic tests are OK.
Comment 4 Steve Monnier CLA 2022-01-31 21:30:06 EST
Validated with Sirius 7.0.0.202201120736
Comment 5 Pierre-Charles David CLA 2022-02-28 04:22:27 EST
Available in Sirius 7.0.0, see https://projects.eclipse.org/projects/modeling.sirius/releases/7.0.0