Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10E681126F for ; Mon, 1 Sep 2014 15:44:51 +0000 (UTC) Received: (qmail 55662 invoked by uid 500); 1 Sep 2014 15:44:51 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 55602 invoked by uid 500); 1 Sep 2014 15:44:51 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 55593 invoked by uid 99); 1 Sep 2014 15:44:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 15:44:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 15:44:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 95F5E2388993; Mon, 1 Sep 2014 15:44:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: ate@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140901154430.95F5E2388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;