svn commit: r14421 - 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: mvw
Date: 2008-04-20 10:02:12-0700
New Revision: 14421

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

Log:
Fix for issue 5027: Top state was not initialised as top state.

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=14421&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=14420&r2=14421
==============================================================================
--- 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-04-20 10:02:12-0700
@@ -204,14 +204,12 @@
             Object statemachine) {
         if (statemachine instanceof StateMachine) {
             StateMachine sm = (StateMachine) statemachine;
-            CompositeState state = createCompositeState();
-            state.setStateMachine(sm);
-            // TODO: This throws an assertion in both sequence diagram
-            // implementation. We need to investigate correctness of this
-            // assertion and/or correctness of sequence diagram code.
-            //assert state.equals(sm.getTop());
-            state.setName("top");
-            return state;
+            CompositeState top = createCompositeState();
+            top.setStateMachine(sm);
+            top.setName("top");
+            sm.setTop(top);
+            assert top.equals(sm.getTop());
+            return top;
         }
         throw new IllegalArgumentException("statemachine");
     }
@@ -232,6 +230,7 @@
                 machine.setNamespace(feature.getOwner());
             }
             State top = buildCompositeStateOnStateMachine(machine);
+            top.setName("top");
             machine.setTop(top);
             return machine;
         }
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.