summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Le Guennec2014-03-25 09:43:38 (EDT)
committerCamille Letavernier2014-03-25 10:51:39 (EDT)
commitdc77de9cf2fafb73d8513b6d592eab9667dfc697 (patch)
treebd06ba6e1ca394bc02607bc0503f17cba6f14b5e
parenteb2c0e5135c25d5b8325350dcf628588fdc99c0c (diff)
downloadorg.eclipse.papyrus-dc77de9cf2fafb73d8513b6d592eab9667dfc697.zip
org.eclipse.papyrus-dc77de9cf2fafb73d8513b6d592eab9667dfc697.tar.gz
org.eclipse.papyrus-dc77de9cf2fafb73d8513b6d592eab9667dfc697.tar.bz2
395446: [Profile] Bug in UnapplyAllStereotypesCommand causing
stereotypes to be reapplied in the wrong order on undo. https://bugs.eclipse.org/bugs/show_bug.cgi?id=395446 - Apply patch from A. Le Guennec
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java7
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
index bd13928..96c56e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
@@ -13,6 +13,9 @@
package org.eclipse.papyrus.uml.diagram.common.commands;
+import java.util.List;
+import java.util.ListIterator;
+
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
@@ -27,7 +30,9 @@ public class UnapplyAllStereotypesCommand extends CompositeCommand {
public UnapplyAllStereotypesCommand(TransactionalEditingDomain domain, String label, Element element) {
super(label);
- for(EObject stereotypeApplication : element.getStereotypeApplications()) {
+ List<EObject> stereotypeApplications = element.getStereotypeApplications();
+ for (ListIterator<EObject> it = stereotypeApplications.listIterator(stereotypeApplications.size()); it.hasPrevious(); ) {
+ EObject stereotypeApplication = it.previous();
DestroyElementRequest stereoReq = new DestroyElementRequest(domain, stereotypeApplication, false);
add(new DestroyElementCommand(stereoReq));
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
index 7d1760b..577ce39 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/UnapplyAllStereotypesCommand.java
@@ -12,6 +12,9 @@
******************************************************************************/
package org.eclipse.papyrus.uml.service.types.command;
+import java.util.List;
+import java.util.ListIterator;
+
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
@@ -26,7 +29,9 @@ public class UnapplyAllStereotypesCommand extends CompositeCommand {
public UnapplyAllStereotypesCommand(TransactionalEditingDomain domain, String label, Element element) {
super(label);
- for(EObject stereotypeApplication : element.getStereotypeApplications()) {
+ List<EObject> stereotypeApplications = element.getStereotypeApplications();
+ for (ListIterator<EObject> it = stereotypeApplications.listIterator(stereotypeApplications.size()); it.hasPrevious(); ) {
+ EObject stereotypeApplication = it.previous();
DestroyElementRequest stereoReq = new DestroyElementRequest(domain, stereotypeApplication, false);
add(new DestroyElementPapyrusCommand(stereoReq));
}