Community
Participate
Working Groups
Steps to reproduce: > In a runtime, on master, open the docbook sample VSP > open the sample aird model > open the obvious diagram and create a chapter, a big section, a medium section, a tiny section and a note > open the evoluate view diagram > select "Sect2" and try to move it You will get the following stack > org.eclipse.core.commands.ExecutionException: While executing ... exception occurred > at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(:524) > at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.exe..(71 > ... > Caused by: java.lang.ArithmeticException: / by zero > at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) > at java.math.BigDecimal.divide(BigDecimal.java:5153) > at java.math.BigDecimal.divide(BigDecimal.java:1561) > at org.eclipse.draw2d.geometry.PrecisionGeometry.preciseDivide(l48) > at org.eclipse.draw2d.geometry.Vector.getAngle(Vector.java:168) > at oesd.ui.internal.edit.parts.locator.EdgeLabelQuery.getSameLineStatus(l507) For the current case, both vectors are horizontal (and the edge is hidden, we see only the arrow), it seems we might use referenceVector.isParallelTo(vector) and then check the horizontallity/verticallity and direction before computing the angle.
Another scenario: > Create a project > Copy 2182.x files from oe.sirius.tests.junit/data/unit/mappings/edges_on_edges > Open 2182.aird > Open the diagram new doremi-2182_TC1 > Try to move the node C1 (linked to C0) > KO -> same stack than the description. Same kind of scenario: an edge whose segment are not visible due to the source/target locations. No visible or horizontal segments causing the / by zero error in getAngle.
Another stack: > org.eclipse.core.commands.ExecutionException: > While executing the operation, an exception occurred > at org.eclipse.core.commands.operations.DefaultOperationHistory > .execute(DefaultOperationHistory.java:524) > at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack > .execute(DDiagramCommandStack.java:71) > at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack > .execute(DDiagramCommandStack.java:52) > at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack > .execute(DiagramCommandStack.java:156) > at org.eclipse.gef.tools.AbstractTool > .executeCommand(AbstractTool.java:425) > at org.eclipse.gef.tools.AbstractTool > .executeCurrentCommand(AbstractTool.java:438) > at org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx > .executeCurrentCommand(DragEditPartsTrackerEx.java:151) > at org.eclipse.gef.tools.DragEditPartsTracker > .performDrag(DragEditPartsTracker.java:496) > at org.eclipse.gef.tools.DragEditPartsTracker > .handleButtonUp(DragEditPartsTracker.java:351) > at org.eclipse.sirius.diagram.ui.tools.internal.ui.SnapToAllDragEditPartsTracker > .handleButtonUp(SnapToAllDragEditPartsTracker.java:101) > at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200) > ... > at org.eclipse.gef.ui.parts.DomainEventDispatcher > .dispatchMouseReleased(DomainEventDispatcher.java:380) > Caused by: java.lang.ArithmeticException: / by zero > at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) > at java.math.BigDecimal.divide(BigDecimal.java:5153) > at java.math.BigDecimal.divide(BigDecimal.java:1561) > at org.eclipse.draw2d.geometry.PrecisionGeometry.preciseDivide(l48) > at org.eclipse.draw2d.geometry.Vector.getAngle(Vector.java:168) > at oesd.ui.internal.edit.parts.locator.EdgeLabelQuery > .getVectorForSegmentMoveCase (EdgeLabelQuery.java:414) > at oesd.internal.edit.parts.locator.EdgeLabelQuery > .calculateNewCenterLocation(EdgeLabelQuery.java:350) > at oesd.ui.internal.edit.parts.locator.EdgeLabelQuery > .calculateGMFLabelOffset(EdgeLabelQuery.java:243) > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation > .computeGMFLabelOffset(SetLabelsOffsetOperation.java:150) > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation > .computeGMFLabelsOffset(SetLabelsOffsetOperation.java:124) > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation > .setLabelsToUpdate(SetLabelsOffsetOperation.java:109) > at oesd.ui.graphical.edit.policies.SetConnectionBendpointsAndLabelCommmand > .setLabelsToUpdate(line 66) > at oesd.ui.graphical.edit.policies.SetConnectionBendpointsAccordingToDraw2DCommand > .setLabelsToUpdate(line 151) > at oesd.ui.internal.edit.commands.ChangeBendpointsOfEdgesCommand > .getBendpointsChangedCommand(line 250) > ... > at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand > .doExecute > at org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:516) But we do not have the scenario for this one. This stack is different from the other ones, look at the command of stack from the bug description: > Caused by: java.lang.ArithmeticException: / by zero > at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) > at java.math.BigDecimal.divide(BigDecimal.java:5153) > at java.math.BigDecimal.divide(BigDecimal.java:1561) > at org.eclipse.draw2d.geometry.PrecisionGeometry.preciseDivide(48) > at org.eclipse.draw2d.geometry.Vector.getAngle(Vector.java:168) > at EdgeLabelQuery.getSameLineStatus(EdgeLabelQuery.java:507) > at EdgeLabelQuery.getVectorFromOldToNewForSegmentsOnSameLine(457) > at EdgeLabelQuery.calculateNewCenterLocation(EdgeLabelQuery.java:328) > at EdgeLabelQuery.calculateGMFLabelOffset(EdgeLabelQuery.java:243) > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation.computeGMFLabelOffset 150 > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation.computeGMFLabelsOffset 124 > at oesd.ui.internal.edit.commands.SetLabelsOffsetOperation.setLabelsToUpdate 109 > at SetConnectionBendpointsAndLabelCommmand.setLabelsToUpdate 66 > at SetConnectionBendpointsAccordingToExtremityMoveCommmand.setLabelsToUpdate 73 > at ChangeBendpointsOfEdgesCommand.getBendpointsChangedCommand 275 > at ChangeBendpointsOfEdgesCommand.completeCommandWithBendpointsChangedCommand 165 > at ChangeBendpointsOfEdgesCommand.doExecuteWithResult 120 ... at oesd.ui.internal.edit.parts.locator.EdgeLabelQuery.getSameLineStatus(l50
New Gerrit change created: https://git.eclipse.org/r/82524
Gerrit change https://git.eclipse.org/r/82524 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=97629f9f2d6f51b3e5997fe97dc795a663b8f229
The fix has been committed but a test should be added.
New Gerrit change created: https://git.eclipse.org/r/83504
Gerrit change https://git.eclipse.org/r/83504 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a755c9d555e6ca1c3e8792b788556c8c62d04a30
Test has been added by Pierre Guilet.
Available in Sirius 4.1.1, see https://wiki.eclipse.org/Sirius/4.1.1
(In reply to Maxime Porhel from comment #1) > Another scenario: > > Create a project > > Copy 2182.x files from oe.sirius.tests.junit/data/unit/mappings/edges_on_edges > > Open 2182.aird > > Open the diagram new doremi-2182_TC1 > > Try to move the node C1 (linked to C0) > > KO -> same stack than the description. > > Same kind of scenario: an edge whose segment are not visible due to the > source/target locations. No visible or horizontal segments causing the / by > zero error in getAngle. The files can be found here : http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius.tests.junit/data/unit/mappings/edges_on_edges?h=v3.1.x
(In reply to Laurent Redor from comment #10) > > The files can be found here : > http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org. > eclipse.sirius.tests.junit/data/unit/mappings/edges_on_edges?h=v3.1.x The files compatible with this version are http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tree/plugins/org.eclipse.sirius.tests.junit/data/unit/mappings/edges_on_edges?h=v4.1.x