Community
Participate
Working Groups
Created attachment 193062 [details] Junit Test plugin to reproduce the bug Hi, While using EMF Command, I wanted to sort a list of elements before using a SetCommand to set the resulting list to an EObject. The sort result is ok, but during the SetCommand something goes wrong and the following happens : - the elements which where already in the "correct" sorted position (before the sort) are not accurately placed after the command execution. I think it has something to do with the use of MoveCommand in the implementation of SetCommand, because this bug only happens if I create the SetCommand using SetCommand.create(...) and not with a "usual" instanciation "new SetCommand()" Because I do not really know how to express this bug in a better way, I reproduced both instantiation scenarios using an UML Class and some properties in the attached JUnit plug-in test. Regards, Nicolas Guyomar http://www.eclipse.org/modeling/emft/facet/ http://www.eclipse.org/MoDisco/
Created attachment 193076 [details] Patches to address the issue. It looks like it's important to keep the list of remainingValues that we're using to analyze which objects need to be moved in sync with the moves that will be done by the actual move commands. Could you verify this solves the problem; it makes the test pass. Thanks for making it so easy to reproduce the problem!
Hi Ed, Thank you for the patch, it solves my problem with the SetCommand. Would that patch be applied for 3.6 M7 ? Regards, Nicolas Guyomar
The fix is committed to CVS for 2.7. It will be in the M7 build.
The changes are available in EMF 2.7 M7 or an earlier build.