Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323016

Summary: [All Diagrams] Undo / Redo doesn't work on stereotype application
Product: [Modeling] Papyrus Reporter: Thibault LandrĂ© <thibault.landre>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: benoit.maggi, cletavernier, papyrus-bugs, Patrick.Tessier
Version: 0.7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/33368
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=9bc39e219e0e2204139ad062500e8ec52eeeb5f3
Whiteboard:

Description Thibault Landré CLA 2010-08-18 08:57:29 EDT
Step to reproduce this bug :

1 - Create a class diagram
2 - Apply the SysML profile on the Model
3 - Create a class
4 - Apply the stereotype "Block" on this class
5 - Undo the last change 

The stereotype application is not removed but the class is removed.
Comment 1 Camille Letavernier CLA 2013-06-25 10:56:06 EDT
Still doesn't work properly in 0.10.0: applying a stereotype triggers two commands.
Comment 2 Benoit Maggi CLA 2014-09-04 10:12:58 EDT
Still present in 1.0.0.

1 - Create a class diagram
2 - Apply the SysML profile on the Model
3 - Create a class
4 - Apply the stereotype "Block" on this class
5 - Undo the last change => Nothing 
6 - Undo the last change => the class is removed

There is probably a problem on the refresh with stereotype see 393532
Comment 3 Benoit Maggi CLA 2014-09-15 08:29:21 EDT
Patch on gerrit : https://git.eclipse.org/r/#/c/33368/

It will solve this problem using the same way as unapply stereotype.

But there is still a lot of command for applying and unapplying stereotype
Is there a reason for keeping all of them ? 
=> maybe it will be a better solution to use  org.eclipse.papyrus.uml.tools.commands.ApplyStereotypeCommand
Comment 5 Camille Letavernier CLA 2015-04-07 07:20:19 EDT
> Gerrit change https://git.eclipse.org/r/33368 was merged to [master].

As mentioned in the Gerrit review, this approach can only be a workaround. But since then, Bug 437898 and Bug 393532 have been fixed and the ApplyStereotypeRequest should be used instead of trying to build add-hoc notifications
Comment 6 Camille Letavernier CLA 2015-04-07 07:23:00 EDT
> the ApplyStereotypeRequest should be used instead of trying to build add-hoc notifications

Actually since the stereotype listener is now a resource set listener, this shouldn't even be required (But still probably a good idea)
Comment 7 Camille Letavernier CLA 2016-02-03 04:39:45 EST
This works as expected in the current version