Bug 113261 - Incorrect redo behavior of Add where element has settable container feature
Summary: Incorrect redo behavior of Add where element has settable container feature
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical
Target Milestone: ---   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-10-20 13:52 EDT by Nicholas Bennett CLA
Modified: 2010-07-19 12:24 EDT (History)
0 users

See Also:


Attachments
Patches for 112531 and 113261 (7.64 KB, patch)
2005-10-20 17:58 EDT, Christian Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Bennett CLA 2005-10-20 13:52:28 EDT
When an element has a settable container feature, undo/redo behavior of an Add 
to a container element produces incorrect results.  In particular, when redo 
is attempted, the element is appended to the end of the containment collection 
and then moved some seemingly arbitrary amount upwards.  The original index of 
this element is not respected or restored on redo of the add.

Setup of scenario (using org.eclipse.uml2 as an example):

1. Create an Interaction
2. Add multiple CombinedFragments the fragments collection of the Interaction.
3. Add an InteractionOccurrence to the beginning of the fragments collection.
4. Undo/redo the add in step 3.

Notice the InteractionOccurrence is not replaced at the beginning of the 
fragments collection as expected.

This seems to be because MSL is receiving events for both the set of the 
enclosingInteraction feature of the InteractionOccurrence and for the add of 
the InteractionOccurrence to the fragments collection of the Interaction.  
When the add is redone, the redo of the Set appends the InteractionOccurrence 
to the fragments list.  The redo of the add to the fragments collection is 
then executed.
Comment 1 Christian Damus CLA 2005-10-20 17:58:07 EDT
Created attachment 28572 [details]
Patches for 112531 and 113261
Comment 2 Christian Damus CLA 2005-10-20 17:58:52 EDT
Committed the patch.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:24:50 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug