Bug 544834 - Remove bend-points fails for edge with same source and target
Summary: Remove bend-points fails for edge with same source and target
Status: CLOSED FIXED
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: 6.1.3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-26 11:22 EST by Steve Monnier CLA
Modified: 2019-06-17 10:46 EDT (History)
2 users (show)

See Also:


Attachments
RemoveBendpoints.zip (10.02 KB, application/x-zip-compressed)
2019-03-04 08:46 EST, Steve Monnier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Monnier CLA 2019-02-26 11:22:12 EST
Concerning the "Remove bend-points" action, the case of edges with the same source and target is not processed correctly and results in exceptions.
Comment 1 Eclipse Genie CLA 2019-02-26 11:35:17 EST
New Gerrit change created: https://git.eclipse.org/r/137654
Comment 2 Steve Monnier CLA 2019-03-04 08:46:27 EST
Created attachment 277749 [details]
RemoveBendpoints.zip

Validation steps:
- Import project from RemoveBendpoints.zip.
- Open "new userCase" diagram.
- Select edge18 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the east side and the target at the center of the south side.
- Select edge19 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the north side and the target at the center of the east side.
- Select edge20 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the west side and the target at the center of the north side.
- Select edge21 and trigger the contextual action "Remove Bendpoints". Check that the edge has not changed.
Comment 4 Steve Monnier CLA 2019-03-08 10:09:06 EST
Note that the metamodel is available in sirius org.eclipse.sirius.tests.sample.migration
Comment 5 Eclipse Genie CLA 2019-03-21 09:15:39 EDT
New Gerrit change created: https://git.eclipse.org/r/139226
Comment 6 Eclipse Genie CLA 2019-03-21 09:15:42 EDT
New Gerrit change created: https://git.eclipse.org/r/139227
Comment 7 Steve Monnier CLA 2019-03-21 09:52:04 EDT
Reopened to include a fix where on a new edge, after removing bendpoints moving a bendpoint or segment of the edge leads to the following exception

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)
Comment 9 Steve Monnier CLA 2019-03-21 11:23:28 EDT
The fix has been merged but not the auto test as SWTBot does not allow us to move a bendpoint of a reclinear edge for some reason.

Extended Validation Steps:
- Import project from RemoveBendpoints.zip.
- Open "new userCase" diagram.
- Select edge18 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the east side and the target at the center of the south side.
- Select edge19 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the north side and the target at the center of the east side.
- Select edge20 and trigger the contextual action "Remove Bendpoints". Check that the source is now at the center of the west side and the target at the center of the north side.
- Select edge21 and trigger the contextual action "Remove Bendpoints". Check that the edge has not changed.
- Create a edge with the same source and target. Use the tabbar action "Line Style" and set it to "Rectilinear Style Routing". Trigger the contextual action "Remove Bendpoints". Check that you can move bendpoints and segments without having exceptions while you move.
Comment 10 Eclipse Genie CLA 2019-03-21 11:46:08 EDT
New Gerrit change created: https://git.eclipse.org/r/139246
Comment 11 Eclipse Genie CLA 2019-03-28 10:55:17 EDT
New Gerrit change created: https://git.eclipse.org/r/139686
Comment 13 Jerome Pequery CLA 2019-05-28 05:17:05 EDT
Validated with T4C 1.3.1 it5
Comment 14 Pierre-Charles David CLA 2019-06-17 10:46:53 EDT
Available in Sirius 6.1.3, see https://wiki.eclipse.org/Sirius/6.1.3