Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 376544 - bug in re-connecting a connection with identical start and end anchor
Summary: bug in re-connecting a connection with identical start and end anchor
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno M7 Theme_bugs
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-11 18:16 EDT by Henrik Rentz-Reichert CLA
Modified: 2012-06-29 04:26 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments
fix for this bug (442 bytes, text/plain)
2012-04-11 18:24 EDT, Henrik Rentz-Reichert CLA
michael.wenz: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Rentz-Reichert CLA 2012-04-11 18:16:06 EDT
If a connection starting at one anchor and ending in the same is re-connected to another anchor it might be reverted.
Comment 1 Henrik Rentz-Reichert CLA 2012-04-11 18:24:15 EDT
Created attachment 213866 [details]
fix for this bug

I've found the bug in Graphiti 0.8.0 but the buggy code is the same in the current version in the git repository.

In the case of identical source and target anchor the decision
if (connection.getStart().equals(oldAnchor)) {
might lead to the wrong conclusion since it is true even if the end point is to be changed.

The method
org.eclipse.graphiti.features.impl.DefaultReconnectionFeature.reconnect(IReconnectionContext)

has to be changed according to attached snippet.
Comment 2 Michael Wenz CLA 2012-04-12 03:58:17 EDT
Reproducable in tutorial when reconnection is enabled
Comment 3 Michael Wenz CLA 2012-04-12 06:19:31 EDT
Thanks for pointing out and providing the fix! I took over your patch into our Head revision for Graphiti 0.9.0 (Juno M7) and added a test for this. Checked-in and pushed to Eclipse:
commit 454dc526a7eaf68489729ae8e90e387e6e4b25a4
Author: mwenz <michael.wenz@sap.com> 2012-04-12 12:16:26
Committer: mwenz <michael.wenz@sap.com> 2012-04-12 12:16:26
Parent: 4a76009ff9dfbb4b33a4526e81f0078841c49356 (Bug 373298 - Fixed image resource leak in SVG export and cleaned up around unused image creation without dispose)
Branches: origin/master, master
Comment 4 Michael Wenz CLA 2012-06-29 04:26:01 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)