svn commit: r17965 - trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-02-04 15:36:04-0800
New Revision: 17965

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java

Log:
Issue 5957: Don't fire critic if we have no state machine

Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java?view=diff&pathrev=17965&r1=17964&r2=17965
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java	2010-02-04 15:36:04-0800
@@ -90,8 +90,12 @@
             return NO_PROBLEM;
         }
         /* Now we are sure dm is a State. */
-        Object sm = Model.getFacade().getStateMachine(dm);
-        if (sm != null && Model.getFacade().getTop(sm) == dm) {
+        Object stateMachine = Model.getFacade().getStateMachine(dm);
+        if (stateMachine == null) {
+            return NO_PROBLEM;
+        }
+        
+        if (stateMachine != null && Model.getFacade().getTop(stateMachine) == dm) {
             /* If dm is the top state of the statemachine, then it is 
              * not supposed to have outgoing transitions. */
             return NO_PROBLEM;
@@ -109,7 +113,7 @@
 
         /* Issue 689: Look for a transition that starts 
          * at a sub-state and goes out of the composite state: */
-        Collection transitions = Model.getFacade().getTransitions(sm);
+        Collection transitions = Model.getFacade().getTransitions(stateMachine);
         for (Object t : transitions) {
             Object sourceState = Model.getFacade().getSource(t);
             Object targetState = Model.getFacade().getTarget(t);

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

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.