commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1621831 - /commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java
Date Tue, 02 Sep 2014 01:49:36 GMT
On 1 September 2014 16:44,  <ate@apache.org> wrote:
> 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

There should really be a unit test that fails without this change.

> 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;
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message