Bug 545646 - New edge bendpoint coordinates not up to date
Summary: New edge bendpoint coordinates not up to date
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 6.1.2   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-03-21 12:40 EDT by Steve Monnier CLA
Modified: 2019-03-22 11:07 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Monnier CLA 2019-03-21 12:40:11 EDT
While working on https://bugs.eclipse.org/bugs/show_bug.cgi?id=544834 we found out that new edges may not have the proper bendpoint coordinates

To reproduce you will need to comment in org.eclipse.sirius.diagram.ui.tools.internal.routers.RectilinearEdgeUtil.computeRectilinearBendpointsSameSourceAndTarget(Rectangle, ConnectionNodeEditPart) the following lines
if (sourceSide == PositionConstants.NONE) {
            sourceSide = PositionConstants.EAST;
        }

Then you need to open the sample from https://bugs.eclipse.org/bugs/show_bug.cgi?id=544834, create a new edge with the same source and target, set its style to Rectilinear Style Routing (once I had an exception at the step but did not reproduce) and finally move a bendpoint or an edge. This should not throw the following exception multiple time as you move:
java.lang.IndexOutOfBoundsException: Index: 3, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.ConnectionBendpointEditPolicy.getLineSeg(ConnectionBendpointEditPolicy.java:599)
at org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.ConnectionBendpointEditPolicy.showMoveLineSegFeedback(ConnectionBendpointEditPolicy.java:788)
at org.eclipse.sirius.diagram.ui.graphical.edit.policies.TreeLayoutConnectionLineSegEditPolicy.showMoveLineSegFeedback(TreeLayoutConnectionLineSegEditPolicy.java:169)
at org.eclipse.sirius.diagram.ui.graphical.edit.policies.TreeLayoutConnectionLineSegEditPolicy.showSourceFeedback(TreeLayoutConnectionLineSegEditPolicy.java:185)
at org.eclipse.gef.editparts.AbstractEditPart.showSourceFeedback(AbstractEditPart.java:1093)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.showSourceFeedback(ConnectionEditPart.java:1664)
at org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker.showSourceFeedback(SelectConnectionEditPartTracker.java:216)
at org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker.handleDragInProgress(SelectConnectionEditPartTracker.java:144)
at org.eclipse.sirius.diagram.ui.tools.internal.ui.SiriusSelectConnectionEditPartTracker.handleDragInProgress(SiriusSelectConnectionEditPartTracker.java:172)
at org.eclipse.gef.tools.AbstractTool.mouseDrag(AbstractTool.java:1114)
at org.eclipse.sirius.diagram.ui.tools.internal.ui.SiriusSelectConnectionEditPartTracker.mouseDrag(SiriusSelectConnectionEditPartTracker.java:149)
at org.eclipse.gef.tools.SelectionTool.mouseDrag(SelectionTool.java:538)