commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r327091 - in /jakarta/commons/sandbox/scxml/trunk/src: main/java/org/apache/commons/scxml/ main/java/org/apache/commons/scxml/env/ main/java/org/apache/commons/scxml/env/faces/ main/java/org/apache/commons/scxml/env/jsp/ main/java/org/apach...
Date Fri, 21 Oct 2005 04:00:44 GMT
Author: rahul
Date: Thu Oct 20 21:00:32 2005
New Revision: 327091

URL: http://svn.apache.org/viewcvs?rev=327091&view=rev
Log:
Mostly coding style corrections.

One change:
 * Send and Cancel, renamed property to match case with WD (sendId -> sendid)

Style corrections based on:
 * Checkstyle
 * Findbugs
 * Javadoc
 * Unneccessary casts

Modified:
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLDigester.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLHelper.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLSemantics.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/LogUtils.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleErrorHandler.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/Tracer.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/SessionContext.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/ShaleDialogELEvaluator.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/Standalone.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Cancel.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Send.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
    jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/TriggerEventTest.java

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLDigester.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLDigester.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLDigester.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLDigester.java
Thu Oct 20 21:00:32 2005
@@ -857,7 +857,7 @@
         if (h != null) {
             serializeHistory(b, h, indent + INDENT);
         }
-        serializeOnEntry(b, (TransitionTarget) s, indent + INDENT);
+        serializeOnEntry(b, s, indent + INDENT);
         Map t = s.getTransitions();
         Iterator i = t.keySet().iterator();
         while (i.hasNext()) {
@@ -878,7 +878,7 @@
                 serializeState(b, cs, indent + INDENT);
             }
         }
-        serializeOnExit(b, (TransitionTarget) s, indent + INDENT);
+        serializeOnExit(b, s, indent + INDENT);
         b.append(indent).append("</state>\n");
     }
 
@@ -894,13 +894,13 @@
         b.append(indent).append("<parallel");
         serializeTransitionTargetAttributes(b, p);
         b.append(">\n");
-        serializeOnEntry(b, (TransitionTarget) p, indent + INDENT);
+        serializeOnEntry(b, p, indent + INDENT);
         Set s = p.getStates();
         Iterator i = s.iterator();
         while (i.hasNext()) {
             serializeState(b, (State) i.next(), indent + INDENT);
         }
-        serializeOnExit(b, (TransitionTarget) p, indent + INDENT);
+        serializeOnExit(b, p, indent + INDENT);
         b.append(indent).append("</parallel>\n");
     }
 
@@ -1073,10 +1073,12 @@
                                 asn.getExpr()).append("\"/>\n");
             } else if (a instanceof Send) {
                 Send s = (Send) a;
-                b.append(indent).append("<send/>\n");
+                b.append(indent).append("<send sendid=\"").
+                    append(s.getSendid()).append("\"/>\n");
             } else if (a instanceof Cancel) {
                 Cancel c = (Cancel) a;
-                b.append(indent).append("<cancel/>\n");
+                b.append(indent).append("<cancel sendid=\"").
+                    append(c.getSendid()).append("\"/>\n");
             } else if (a instanceof Log) {
                 Log lg = (Log) a;
                 b.append(indent).append("<log expr=\"").append(lg.getExpr())
@@ -1098,7 +1100,6 @@
                 If iff = (If) a;
                 serializeIf(b, iff, indent);
             } else if (a instanceof Else) {
-                Else el = (Else) a;
                 b.append(indent).append("<else/>\n");
             } else if (a instanceof ElseIf) {
                 ElseIf eif = (ElseIf) a;
@@ -1189,7 +1190,7 @@
         public final void end(final String namespace, final String name) {
             Action child = (Action) getDigester().peek();
             for (int i = 1; i < getDigester().getCount() - 1; i++) {
-                Object ancestor = (Object) getDigester().peek(i);
+                Object ancestor = getDigester().peek(i);
                 if (ancestor instanceof Executable) {
                     child.setParent((Executable) ancestor);
                     return;

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
Thu Oct 20 21:00:32 2005
@@ -137,17 +137,18 @@
     public SCXMLExecutor() {
         this(null, null, null, null);
     }
-    
+
     /**
      * Constructor.
      *
      * @param expEvaluator The expression evaluator
      * @param evtDisp The event dispatcher
      * @param errRep The error reporter
+     * @param semantics The SCXML semantics
      */
     public SCXMLExecutor(final Evaluator expEvaluator,
             final EventDispatcher evtDisp, final ErrorReporter errRep,
-            final SCXMLSemanticsImpl semantics) {
+            final SCXMLSemantics semantics) {
         this.evaluator = expEvaluator;
         this.eventdispatcher = evtDisp;
         this.errorReporter = errRep;
@@ -161,7 +162,7 @@
         }
         this.currentStatus = null;
         this.stateMachine = null;
-    }    
+    }
 
     /**
      * Clear all state and begin from &quot;initialstate&quot; indicated
@@ -191,7 +192,7 @@
                 step.getAfterStatus().getStates(),
                 step.getEntryList(), errorReporter);
         // ExecuteActions
-        semantics.executeActions(step, stateMachine, evaluator, 
+        semantics.executeActions(step, stateMachine, evaluator,
                 eventdispatcher, errorReporter);
         // AssignCurrentStatus
         updateStatus(step);

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLHelper.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLHelper.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLHelper.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLHelper.java
Thu Oct 20 21:00:32 2005
@@ -81,7 +81,7 @@
      */
     public static Set getAncestorClosure(final Set states,
             final Set upperBounds) {
-        Set closure = new HashSet((int) (states.size() * 2));
+        Set closure = new HashSet(states.size() * 2);
         for (Iterator i = states.iterator(); i.hasNext();) {
             TransitionTarget tt = (TransitionTarget) i.next();
             closure.add(tt);

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLSemantics.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLSemantics.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLSemantics.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/SCXMLSemantics.java
Thu Oct 20 21:00:32 2005
@@ -46,6 +46,9 @@
 public interface SCXMLSemantics {
 
     /**
+     * Optional post processing immediately following Digester. May be used
+     * for removing pseudo-states etc.
+     *
      * @param input
      *            SCXML state machine
      * @return normalized SCXML state machine, pseudo states are removed, etc.
@@ -55,14 +58,16 @@
     SCXML normalizeStateMachine(final SCXML input, final ErrorReporter errRep);
 
     /**
+     * Determining the initial state(s) for this state machine.
+     *
      * @param input
-     *            SCXML state machine [in]
+     *            SCXML state machine
      * @param states
-     *            a set of States to populate [out]
+     *            a set of States to populate
      * @param entryList
-     *            a list of States and Parallels to enter [out]
+     *            a list of States and Parallels to enter
      * @param errRep
-     *            ErrorReporter callback [inout]
+     *            ErrorReporter callback
      * @throws ModelException
      *             in case there is a fatal SCXML object model problem.
      */
@@ -71,15 +76,19 @@
     throws ModelException;
 
     /**
-     * Exectutes all OnExit/Transition/OnEntry transitional actions.
+     * Executes all OnExit/Transition/OnEntry transitional actions.
      *
      * @param step
-     *            [inout] provides EntryList, TransitList, ExitList gets
+     *            provides EntryList, TransitList, ExitList gets
      *            updated its AfterStatus/Events
-     * @param exec
-     *            [inout] execution environment - SCXMLExecutor instance
+     * @param stateMachine
+     *            state machine - SCXML instance
+     * @param eval
+     *            the expression evaluator - Evaluator instance
+     * @param evtDispatcher
+     *            the event dispatcher - EventDispatcher instance
      * @param errRep
-     *            [out[ error reporter
+     *            error reporter
      * @throws ModelException
      *             in case there is a fatal SCXML object model problem.
      */
@@ -89,24 +98,28 @@
     throws ModelException;
 
     /**
+     * Enumerate all the reachable transitions.
+     *
      * @param stateMachine
-     *            a SM to traverse [in]
+     *            a state machine to traverse
      * @param step
      *            with current status and list of transitions to populate
-     *            [inout]
      * @param errRep
-     *            ErrorReporter callback [inout]
+     *            ErrorReporter callback
      */
     void enumerateReachableTransitions(final SCXML stateMachine,
             final Step step, final ErrorReporter errRep);
 
     /**
+     * Filter the transitions set, eliminate those whose guard conditions
+     * are not satisfied.
+     *
      * @param step
-     *            [inout]
+     *            with current status
      * @param evaluator
      *            guard condition evaluator
      * @param errRep
-     *            ErrorReporter callback [inout]
+     *            ErrorReporter callback
      */
     void filterTransitionsSet(final Step step, final Evaluator evaluator,
             final ErrorReporter errRep);
@@ -129,11 +142,10 @@
      * relevant states.
      *
      * @param step
-     *            [inout]
+     *            The current Step
      * @param errRep
-     *            ErrorReporter callback [inout]
+     *            ErrorReporter callback
      */
     void updateHistoryStates(final Step step, final ErrorReporter errRep);
 
 }
-

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/LogUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/LogUtils.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/LogUtils.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/LogUtils.java
Thu Oct 20 21:00:32 2005
@@ -27,7 +27,7 @@
  * Helper methods for Commons SCXML logging.
  *
  */
-public class LogUtils {
+public final class LogUtils {
 
     /**
      * Create a human readable log view of this transition.
@@ -75,5 +75,11 @@
         }
     }
 
-}
+    /**
+     * Discourage instantiation since this is a utility class.
+     */
+    private LogUtils() {
+        super();
+    }
 
+}

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
Thu Oct 20 21:00:32 2005
@@ -34,9 +34,9 @@
     /** Implementation independent log category. */
     protected static final Log LOG = LogFactory.getLog(Context.class);
     /** The parent Context to this Context. */
-    protected Context parent;
+    private Context parent;
     /** The Map of variables and their values in this Context. */
-    protected Map vars;
+    private Map vars;
 
     /**
      * Constructor.
@@ -71,8 +71,11 @@
      */
     public SimpleContext(final Context parent, final Map initialVars) {
         this.parent = parent;
-        this.vars =
-            (initialVars == null) ? new HashMap() : initialVars;
+        if (initialVars == null) {
+            this.vars = new HashMap();
+        } else {
+            this.vars = initialVars;
+        }
     }
 
     /**
@@ -170,6 +173,15 @@
         if (LOG.isDebugEnabled() && !name.equals("_ALL_STATES")) {
             LOG.debug(name + " = " + String.valueOf(value));
         }
+    }
+
+    /**
+     * Get the variables map.
+     *
+     * @return Returns the vars.
+     */
+    protected Map getVars() {
+        return vars;
     }
 
 }

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleErrorHandler.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleErrorHandler.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleErrorHandler.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleErrorHandler.java
Thu Oct 20 21:00:32 2005
@@ -47,7 +47,7 @@
     /**
      * @see ErrorHandler#error(SAXParseException)
      */
-    public void error(SAXParseException exception) {
+    public void error(final SAXParseException exception) {
         if (log.isErrorEnabled()) {
             log.error(MSG_PREFIX + exception.getMessage() + MSG_POSTFIX,
                 exception);
@@ -57,7 +57,7 @@
     /**
      * @see ErrorHandler#fatalError(SAXParseException)
      */
-    public void fatalError(SAXParseException exception) {
+    public void fatalError(final SAXParseException exception) {
         if (log.isFatalEnabled()) {
             log.fatal(MSG_PREFIX + exception.getMessage() + MSG_POSTFIX,
                 exception);
@@ -67,7 +67,7 @@
     /**
      * @see ErrorHandler#warning(SAXParseException)
      */
-    public void warning(SAXParseException exception) {
+    public void warning(final SAXParseException exception) {
         if (log.isWarnEnabled()) {
             log.warn(MSG_PREFIX + exception.getMessage() + MSG_POSTFIX,
                 exception);

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/Tracer.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/Tracer.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/Tracer.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/Tracer.java
Thu Oct 20 21:00:32 2005
@@ -17,9 +17,6 @@
  */
 package org.apache.commons.scxml.env;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import org.apache.commons.scxml.ErrorReporter;
 import org.apache.commons.scxml.SCXMLListener;
 import org.apache.commons.scxml.model.Transition;
@@ -35,15 +32,12 @@
  */
 public class Tracer implements ErrorHandler, ErrorReporter, SCXMLListener {
 
-    /** A Logger for the Tracer. */
-    private static Log log = LogFactory.getLog(Tracer.class);
-
     /** ErrorHandler delegate. */
-    ErrorHandler errHandler;
+    private ErrorHandler errHandler;
     /** ErrorReporter delegate. */
-    ErrorReporter errReporter;
+    private ErrorReporter errReporter;
     /** SCXMLListener delegate. */
-    SCXMLListener scxmlListener;
+    private SCXMLListener scxmlListener;
 
     /**
      * Constructor.

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/SessionContext.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/SessionContext.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/SessionContext.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/SessionContext.java
Thu Oct 20 21:00:32 2005
@@ -77,7 +77,7 @@
      * @see org.apache.commons.scxml.Context#get(java.lang.String)
      */
     public Object get(final String name) {
-        Object value = vars.get(name);
+        Object value = getVars().get(name);
         if (value == null) {
             value = sessionMap.get(name);
         }
@@ -92,7 +92,7 @@
      * @see org.apache.commons.scxml.Context#has(java.lang.String)
      */
     public boolean has(final String name) {
-        return (sessionMap.containsKey(name) || vars.containsKey(name));
+        return (sessionMap.containsKey(name) || getVars().containsKey(name));
     }
 
     /**

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/ShaleDialogELEvaluator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/ShaleDialogELEvaluator.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/ShaleDialogELEvaluator.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/faces/ShaleDialogELEvaluator.java
Thu Oct 20 21:00:32 2005
@@ -26,7 +26,6 @@
 import javax.faces.el.ReferenceSyntaxException;
 
 import org.apache.commons.scxml.Context;
-import org.apache.commons.scxml.Evaluator;
 import org.apache.commons.scxml.SCXMLExpressionException;
 import org.apache.commons.scxml.env.jsp.ELEvaluator;
 
@@ -84,6 +83,7 @@
      */
     public ShaleDialogELEvaluator() {
         super();
+        this.context = null;
     }
 
     /**
@@ -102,7 +102,7 @@
      * @param expr expression
      * @return Object The result of the evaluation
      * @throws SCXMLExpressionException For a malformed expression
-     * @see Evaluator#eval(Context, String)
+     * @see ELEvaluator#eval(Context, String)
      */
     public Object eval(final Context ctx, final String expr)
     throws SCXMLExpressionException {

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
Thu Oct 20 21:00:32 2005
@@ -42,9 +42,9 @@
 public class ELEvaluator implements Evaluator {
 
     /** Implementation independent log category. */
-    protected static Log log = LogFactory.getLog(Evaluator.class);
+    protected static final Log LOG = LogFactory.getLog(Evaluator.class);
     /** Function Mapper for SCXML expressions. */
-    protected FunctionMapper fm = new FunctWrapper();
+    private FunctionMapper functionMapper = new FunctWrapper();
     /** Pattern for recognizing the SCXML In() special predicate. */
     private static Pattern inFct = Pattern.compile("In\\(");
 
@@ -78,9 +78,10 @@
         try {
             String evalExpr = inFct.matcher(expr).
                 replaceAll("In(_ALL_STATES, ");
-            Object rslt = ee.evaluate(evalExpr, Object.class, vr, fm);
-            if (log.isTraceEnabled()) {
-                log.trace(expr + " = " + String.valueOf(rslt));
+            Object rslt = ee.evaluate(evalExpr, Object.class, vr,
+                functionMapper);
+            if (LOG.isTraceEnabled()) {
+                LOG.trace(expr + " = " + String.valueOf(rslt));
             }
             return rslt;
         } catch (ELException e) {
@@ -120,9 +121,9 @@
             String evalExpr = inFct.matcher(expr).
                 replaceAll("In(_ALL_STATES, ");
             Boolean rslt = (Boolean) ee.evaluate(evalExpr, Boolean.class,
-                vr, fm);
-            if (log.isDebugEnabled()) {
-                log.debug(expr + " = " + String.valueOf(rslt));
+                vr, functionMapper);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(expr + " = " + String.valueOf(rslt));
             }
             return rslt;
         } catch (ELException e) {
@@ -147,7 +148,7 @@
         public Object resolveVariable(final String pName) throws ELException {
             Object rslt = ctx.get(pName);
             if (rslt == null) {
-                log.info("Variable \"" + pName + "\" does not exist!");
+                LOG.info("Variable \"" + pName + "\" does not exist!");
             }
             return rslt;
         }
@@ -168,9 +169,9 @@
                 try {
                     return ELEvaluator.class.getMethod("isMember", attrs);
                 } catch (SecurityException e) {
-                    log.error("resolving isMember(Set, String)", e);
+                    LOG.error("resolving isMember(Set, String)", e);
                 } catch (NoSuchMethodException e) {
-                    log.error("resolving isMember(Set, String)", e);
+                    LOG.error("resolving isMember(Set, String)", e);
                 }
             }
             return null;
@@ -194,6 +195,15 @@
             }
         }
         return false;
+    }
+
+    /**
+     * Get the FunctionMapper.
+     *
+     * @return functionMapper The FunctionMapper
+     */
+    protected FunctionMapper getFunctionMapper() {
+        return functionMapper;
     }
 
 }

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/Standalone.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/Standalone.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/Standalone.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/Standalone.java
Thu Oct 20 21:00:32 2005
@@ -106,13 +106,13 @@
                     String name = event.substring(0, marker);
                     String value = event.substring(marker + 1);
                     rootCtx.setLocal(name, value);
-                    System.out.println("Set variable " + name + " to " +
-                        value);
+                    System.out.println("Set variable " + name + " to "
+                        + value);
                 } else if (SCXMLHelper.isStringEmpty(event)
                            || event.equalsIgnoreCase("null")) {
-                    TriggerEvent[] evts = { new TriggerEvent(null,
-                    TriggerEvent.SIGNAL_EVENT, null) };
-                        exec.triggerEvents(evts);
+                    TriggerEvent[] evts = {new TriggerEvent(null,
+                        TriggerEvent.SIGNAL_EVENT, null)};
+                    exec.triggerEvents(evts);
                     if (exec.getCurrentStatus().isFinal()) {
                         System.out.println("A final configuration reached.");
                     }

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Cancel.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Cancel.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Cancel.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Cancel.java
Thu Oct 20 21:00:32 2005
@@ -34,24 +34,24 @@
     /**
      * The ID of the send message that should be cancelled.
      */
-    private String sendId;
+    private String sendid;
 
     /**
      * Get the ID of the send message that should be cancelled.
      *
-     * @return Returns the sendId.
+     * @return Returns the sendid.
      */
-    public String getSendId() {
-        return sendId;
+    public String getSendid() {
+        return sendid;
     }
 
     /**
      * Set the ID of the send message that should be cancelled.
      *
-     * @param sendId The sendId to set.
+     * @param sendid The sendid to set.
      */
-    public void setSendId(final String sendId) {
-        this.sendId = sendId;
+    public void setSendid(final String sendid) {
+        this.sendid = sendid;
     }
 
 }

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Send.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Send.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Send.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Send.java
Thu Oct 20 21:00:32 2005
@@ -30,7 +30,7 @@
     /**
      * The ID of the send message.
      */
-    private String sendId;
+    private String sendid;
 
     /**
      * An expression returning the target location of the event.
@@ -134,17 +134,17 @@
     }
 
     /**
-     * @return String Returns the sendId.
+     * @return String Returns the sendid.
      */
-    public final String getSendId() {
-        return sendId;
+    public final String getSendid() {
+        return sendid;
     }
 
     /**
-     * @param sendId The sendId to set.
+     * @param sendid The sendid to set.
      */
-    public final void setSendId(final String sendId) {
-        this.sendId = sendId;
+    public final void setSendid(final String sendid) {
+        this.sendid = sendid;
     }
 
     /**

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
Thu Oct 20 21:00:32 2005
@@ -139,8 +139,10 @@
      *            a list of actions to execute [in]
      * @param derivedEvents
      *            collection of internal events generated by the actions [out]
-     * @param exec
-     *            execution environment [inout]
+     * @param eval
+     *            the expression evaluator - Evaluator instance
+     * @param evtDispatcher
+     *            the event dispatcher - EventDispatcher instance
      * @param errRep
      *            ErrorReporter callback [inout]
      * @throws ModelException
@@ -182,7 +184,7 @@
                 }
             } else if (a instanceof Cancel) {
                 Cancel cncl = (Cancel) a;
-                evtDispatcher.cancel(cncl.getSendId());
+                evtDispatcher.cancel(cncl.getSendid());
             } else if (a instanceof Exit) {
                 // Ignore; Exit instance holds other information that might
                 // be needed, and is not transformed at parse time.
@@ -247,7 +249,7 @@
                         params.put(varName, varObj);
                     }
                 }
-                evtDispatcher.send(snd.getSendId(),
+                evtDispatcher.send(snd.getSendid(),
                         snd.getTarget(), snd.getTargetType(), snd.getEvent(),
                         params, hints, Long.parseLong(snd.getDelay()));
             } else if (a instanceof Var) {
@@ -266,15 +268,19 @@
     }
 
     /**
-     * Exectutes all OnExit/Transition/OnEntry transitional actions.
+     * Executes all OnExit/Transition/OnEntry transitional actions.
      *
      * @param step
-     *            [inout] provides EntryList, TransitList, ExitList gets
+     *            provides EntryList, TransitList, ExitList gets
      *            updated its AfterStatus/Events
-     * @param exec
-     *            [inout] execution environment - SCXMLExecutor instance
+     * @param stateMachine
+     *            state machine - SCXML instance
+     * @param eval
+     *            the expression evaluator - Evaluator instance
+     * @param evtDispatcher
+     *            the event dispatcher - EventDispatcher instance
      * @param errRep
-     *            [out[ error reporter
+     *            error reporter
      * @throws ModelException
      *             in case there is a fatal SCXML object model problem.
      */
@@ -307,11 +313,12 @@
                 executeActionList(t.getActions(), internalEvents, eval,
                     evtDispatcher, errRep);
             } catch (SCXMLExpressionException e) {
-                errRep.onError(ErrorReporter.EXPRESSION_ERROR, e.getMessage(),
-                        t);
+                errRep.onError(ErrorReporter.EXPRESSION_ERROR,
+                    e.getMessage(), t);
             }
             nr.fireOnTransition(t, t.getParent(), t.getRuntimeTarget(), t);
-            nr.fireOnTransition(stateMachine, t.getParent(), t.getRuntimeTarget(), t);
+            nr.fireOnTransition(stateMachine, t.getParent(),
+                t.getRuntimeTarget(), t);
         }
         // ExecutePhaseActions / OnEntry
         for (Iterator i = step.getEntryList().iterator(); i.hasNext();) {

Modified: jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/TriggerEventTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/TriggerEventTest.java?rev=327091&r1=327090&r2=327091&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/TriggerEventTest.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/TriggerEventTest.java
Thu Oct 20 21:00:32 2005
@@ -51,7 +51,7 @@
     public void setUp() {
         payloadData = new HashMap();
         payloadData.put("property1", "value1");
-        payload1 = (Object) payloadData;
+        payload1 = payloadData;
         payload2 = new Object();
         te1 = new TriggerEvent("name1", TriggerEvent.CHANGE_EVENT, payload1);
         te2 = new TriggerEvent("name1", TriggerEvent.CHANGE_EVENT, payload1);



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


Mime
View raw message