svn commit: r19397 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2011-05-11 00:11:20-0700
New Revision: 19397

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java

Log:
fix for issue 6242 (State applied stereotypes not shown): in fact it's just a better handling of stereotype application when the profile is inconsistent

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=19397&r1=19396&r2=19397
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2011-05-11 00:11:20-0700
@@ -32,6 +32,8 @@
 import org.eclipse.emf.common.command.Command;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.emf.edit.command.AddCommand;
 import org.eclipse.emf.edit.command.CommandParameter;
 import org.eclipse.emf.edit.command.RemoveCommand;
@@ -129,8 +131,12 @@
             public void run() {
                 for (Object o : stereos) {
                     Stereotype stereotype = (Stereotype) o;
-                    ((Element) modelElement).applyStereotype(stereotype);
-                    fireApplyStereotypeEvent(modelElement, stereotype);
+                    EObject eo = ((Element) modelElement).applyStereotype(stereotype);
+                    if (((Element) modelElement).isStereotypeApplied(stereotype)) {
+                        fireApplyStereotypeEvent(modelElement, stereotype);
+                    } else {
+                        EcoreUtil.remove(eo);
+                    }
                 }
             }
             /**

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2733934

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.