commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1623231 - /commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Foreach.java
Date Sun, 07 Sep 2014 21:16:42 GMT
Author: ate
Date: Sun Sep  7 21:16:42 2014
New Revision: 1623231

URL: http://svn.apache.org/r1623231
Log:
Only (try to) keep track of loop index when requested

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

Modified: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Foreach.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Foreach.java?rev=1623231&r1=1623230&r2=1623231&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Foreach.java
(original)
+++ commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/model/Foreach.java
Sun Sep  7 21:16:42 2014
@@ -107,7 +107,9 @@ public class Foreach extends Action impl
                 if (arrayObject.getClass().isArray()) {
                     for (int currentIndex = 0, size = Array.getLength(arrayObject); currentIndex
< size; currentIndex++) {
                         ctx.setLocal(item, Array.get(arrayObject, currentIndex));
-                        ctx.setLocal(index, currentIndex);
+                        if (index != null) {
+                            ctx.setLocal(index, currentIndex);
+                        }
                         // The "foreach" statement is a "container"
                         for (Action aa : actions) {
                             aa.execute(exctx);



Mime
View raw message