commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1621831 - /commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java
Date Mon, 01 Sep 2014 15:44:30 GMT
Author: ate
Date: Mon Sep  1 15:44:30 2014
New Revision: 1621831

URL: http://svn.apache.org/r1621831
Log:
reverting and correcting previous fix to prevent NPEs which introduced an incorrect side-effect

Modified:
    commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java

Modified: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java?rev=1621831&r1=1621830&r2=1621831&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java (original)
+++ commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java Mon
Sep  1 15:44:30 2014
@@ -98,10 +98,14 @@ public abstract class Action implements 
      */
     public final EnterableState getParentEnterableState()
     throws ModelException {
-        if (parent == null || (this instanceof Script && ((Script)this).isGlobalScript()))
{
+        if (parent == null && this instanceof Script && ((Script)this).isGlobalScript())
{
             // global script doesn't have a EnterableState
             return null;
         }
+        else if (parent == null) {
+            throw new ModelException("Action "
+                    + this.getClass().getName() + " instance missing required parent TransitionTarget");
+        }
         TransitionTarget tt = parent.getParent();
         if (tt instanceof EnterableState) {
             return (EnterableState)tt;



Mime
View raw message