Community
Participate
Working Groups
Build Identifier: 20110218-0911 Graphiti version in question: Nightly build 04/13/2011 A diff of org.eclipse.graphiti.ui.internal.command:CreateConnectionCommand.java revisions 1.5 and 1.6 what looks to be an issue with the integrity of private variable "sourceLocation" "sourceLocation" is set in the private method "createContext" which is called by "canStartConnection" and "getFeaturesAndContexts". After a little debugging, it seems "canStartConnection" is called when a FreeFormConnection is started, as expected, and then upon anchoring the FreeFormConnection to the destination "getFeaturesAndContexts" is called (resetting sourceLocation to the current location again and in effect losing the original "sourceLocation"), followed by "execute". This results in a "CreateConnectionContext" being passed down to child classes which has an ILocation sourceLocation and ILocation targetLocation with matching x,y coordinates. Note: This behavior was not present in a nightly Graphiti build from 04/07/2011 Reproducible: Always Steps to Reproduce: 1. Create a Connection Feature class extending AbstractConnectionPattern or some equivalent. 2. In the overridden "create" method, place a debug break point or print statement to observe the contents of the "ICreateConnectionContext"'s sourceLocation and targetLocation coordinates. 3. Attempt to draw a FreeFormConnection and upon anchoring the connection to the target, observe the source/target ILocation coordinates passed into the "create" via the "ICreateConnectionContext" parameter. I would expect the sourceLocation coordinates to be representative of where the connection started and the targetLocation coordinates to represent where the connection ended, but this is not the case.
This is indeed a regression introduced by the enablement of non-EMF undo/redo (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=324859). I fixed this in head, now the sourceLocation variable is only set on calling canStartConnection as it was before. Thanks for pointing this out!
Part of Graphiti Indigo 0.8.0