You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by at...@apache.org on 2017/12/10 03:25:01 UTC
commons-scxml git commit: SCXML-260 must fail on using
illegal item definition
Repository: commons-scxml
Updated Branches:
refs/heads/master 5155f49df -> 8233b90eb
SCXML-260 <foreach> must fail on using illegal item definition
Project: http://git-wip-us.apache.org/repos/asf/commons-scxml/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-scxml/commit/8233b90e
Tree: http://git-wip-us.apache.org/repos/asf/commons-scxml/tree/8233b90e
Diff: http://git-wip-us.apache.org/repos/asf/commons-scxml/diff/8233b90e
Branch: refs/heads/master
Commit: 8233b90eb074a0d04c503bc0e23376d4cddf02a4
Parents: 5155f49
Author: Ate Douma <at...@apache.org>
Authored: Sun Dec 10 04:24:19 2017 +0100
Committer: Ate Douma <at...@apache.org>
Committed: Sun Dec 10 04:24:34 2017 +0100
----------------------------------------------------------------------
src/changes/changes.xml | 4 ++++
src/main/java/org/apache/commons/scxml2/model/Foreach.java | 4 ++--
src/test/java/org/apache/commons/scxml2/w3c/tests.xml | 4 ++--
3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-scxml/blob/8233b90e/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5c027e7..ac19a40 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -35,6 +35,10 @@
<release version="2.0" date="In Git master"
description="Latest unreleased code">
+ <action dev="ate" type="fix" issue="SCXML-259">
+ [12-10-2017] <foreach> must fail on using illegal item definition
+ </action>
+
<action dev="ate" type="update" issue="SCXML-259">
[12-10-2017] Complete implementation and handling of system variables _event and _ioprocessors
</action>
http://git-wip-us.apache.org/repos/asf/commons-scxml/blob/8233b90e/src/main/java/org/apache/commons/scxml2/model/Foreach.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/scxml2/model/Foreach.java b/src/main/java/org/apache/commons/scxml2/model/Foreach.java
index 6007b12..bdc43f8 100644
--- a/src/main/java/org/apache/commons/scxml2/model/Foreach.java
+++ b/src/main/java/org/apache/commons/scxml2/model/Foreach.java
@@ -107,7 +107,7 @@ public class Foreach extends Action implements ActionsContainer {
if (arrayObject != null && (arrayObject.getClass().isArray() || arrayObject instanceof Iterable || arrayObject instanceof Map)) {
if (arrayObject.getClass().isArray()) {
for (int currentIndex = 0, size = Array.getLength(arrayObject); currentIndex < size; currentIndex++) {
- ctx.setLocal(item, Array.get(arrayObject, currentIndex));
+ eval.evalAssign(ctx, item, Array.get(arrayObject, currentIndex));
if (index != null) {
ctx.setLocal(index, currentIndex);
}
@@ -132,7 +132,7 @@ public class Foreach extends Action implements ActionsContainer {
}
int currentIndex = 0;
for (Object value : arrayList) {
- ctx.setLocal(item, value);
+ eval.evalAssign(ctx, item, value);
if (index != null) {
ctx.setLocal(index, currentIndex);
}
http://git-wip-us.apache.org/repos/asf/commons-scxml/blob/8233b90e/src/test/java/org/apache/commons/scxml2/w3c/tests.xml
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/scxml2/w3c/tests.xml b/src/test/java/org/apache/commons/scxml2/w3c/tests.xml
index ef02fd5..20b667a 100644
--- a/src/test/java/org/apache/commons/scxml2/w3c/tests.xml
+++ b/src/test/java/org/apache/commons/scxml2/w3c/tests.xml
@@ -44,7 +44,7 @@
<test id="149" mandatory="true" manual="false" jexl="true" ecma="true"/>
<test id="150" mandatory="true" manual="false" jexl="true" ecma="true"/>
<test id="151" mandatory="true" manual="false" jexl="true" ecma="true"/>
- <test id="152" mandatory="true" manual="false" jexl="false" ecma="false"/>
+ <test id="152" mandatory="true" manual="false" jexl="true" ecma="true"/>
<test id="153" mandatory="true" manual="false" jexl="true" ecma="true"/>
<test id="155" mandatory="true" manual="false" jexl="true" ecma="true"/>
<test id="156" mandatory="true" manual="false" jexl="true" ecma="true"/>
@@ -168,7 +168,7 @@
<test id="561" mandatory="false" profile="ecma" manual="false" ecma="false"/>
<test id="562" mandatory="false" profile="ecma" manual="false" ecma="false"/>
<test id="569" mandatory="false" profile="ecma" manual="false" ecma="true"/>
- <test id="457" mandatory="false" profile="ecma" manual="false" ecma="false"/>
+ <test id="457" mandatory="false" profile="ecma" manual="false" ecma="true"/>
<test id="459" mandatory="false" profile="ecma" manual="false" ecma="true"/>
<test id="460" mandatory="false" profile="ecma" manual="false" ecma="true"/>
<test id="189" mandatory="true" manual="false" jexl="true" ecma="true"/>