svn commit: r14686 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-05-10 03:07:32-0700
New Revision: 14686

Modified:
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java

Log:
Some corrections on Michiels advice

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java?view=diff&rev=14686&p1=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&p2=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&r1=14685&r2=14686
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java	2008-05-10 03:07:32-0700
@@ -504,6 +504,10 @@
         }
 
         final CompositeState compositeState = (CompositeState) elem;
+        for (StateVertex vertex : compositeState.getSubvertex()) {
+            modelImpl.getUmlFactory().delete(vertex);
+        }
+        
         final CompositeState containingCompositeState = 
             compositeState.getContainer();
                 
@@ -512,14 +516,11 @@
         // concurrent composite state.
         // If this is broken by deletion of substate then we delete the other
         // remaining substates.
-        if (containingCompositeState != null && containingCompositeState.isConcurrent()) {
+        if (containingCompositeState != null
+                && containingCompositeState.isConcurrent()) {
             final Collection<StateVertex> siblings =
                 containingCompositeState.getSubvertex();
             
-            for (StateVertex vertex : compositeState.getSubvertex()) {
-                modelImpl.getUmlFactory().delete(vertex);
-            }
-            
             final int substatesRemaining = siblings.size();
             if (substatesRemaining == 2) {
                 for (StateVertex sibling : siblings) {
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.