You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2014/09/02 03:49:36 UTC
Re: svn commit: r1621831 - /commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Action.java
On 1 September 2014 16:44, <at...@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