summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-30 21:32:13 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-30 21:32:13 (GMT)
commitce9e0434aa50ad343ec2829262fa7a95ff5d39a7 (patch)
treed99e3c33f139a3fe3f0e8d9ce67dd61fd262c342
parentb7a2d38bdcee3bf85a32dea7ac74b144d5ef40fa (diff)
downloaduscxml-ce9e0434aa50ad343ec2829262fa7a95ff5d39a7.zip
uscxml-ce9e0434aa50ad343ec2829262fa7a95ff5d39a7.tar.gz
uscxml-ce9e0434aa50ad343ec2829262fa7a95ff5d39a7.tar.bz2
Stupid bug
-rw-r--r--embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java8
-rw-r--r--embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java2
-rw-r--r--src/uscxml/Interpreter.cpp2
3 files changed, 8 insertions, 4 deletions
diff --git a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java
index b44c05e..0e2388f 100644
--- a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java
+++ b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleFrame.java
@@ -29,10 +29,13 @@ public class ConsoleFrame extends Frame {
+ " <script src=\"http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js\" />"
+ " <script>var charSeq = \"\";</script>"
+ " <state id=\"idle\">"
+ + " <transition event=\"error\" target=\"quit\" />"
+ " <transition event=\"key.released\" cond=\"_event.data.keyChar == 10\">"
- + " <log expr=\"charSeq\" />"
+ + " <send type=\"console\">"
+ + " <param name=\"foo\" expr=\"charSeq\" />"
+ + " </send>"
+ " <script>"
- + " charSeq = \"\";"
+ + " charSeq = \"\"; // reset string"
+ " </script>"
+ " </transition>"
+ " <transition event=\"*\">"
@@ -40,6 +43,7 @@ public class ConsoleFrame extends Frame {
+ " <script>charSeq += String.fromCharCode(_event.data.keyChar);</script>"
+ " </transition>"
+ " </state>"
+ + " <final id=\"quit\" />"
+ "</scxml>");
diff --git a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java
index f0ad491..7dca28d 100644
--- a/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java
+++ b/embedding/java/src/org/uscxml/tests/ioprocessor/console/ConsoleIOProc.java
@@ -17,7 +17,7 @@ public class ConsoleIOProc extends IOProcessor implements KeyListener {
public IOProcessor create(Interpreter interpreter) {
ConsoleIOProc ioProc = new ConsoleIOProc();
ioProc.swigReleaseOwnership();
-
+
if (ConsoleFrame.perInterpreter.containsKey(interpreter)) {
ConsoleFrame.perInterpreter.get(interpreter).addKeyListener(ioProc);
} else {
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index 438aec3..5fcc3f7 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -2500,7 +2500,7 @@ void InterpreterImpl::setupIOProcessors() {
std::list<std::string>::iterator nameIter = names.begin();
while(nameIter != names.end()) {
// do not override
- if (!boost::equal(*nameIter, ioProcIter->first) && _ioProcessors.find(*nameIter) != _ioProcessors.end())
+ if (!boost::equal(*nameIter, ioProcIter->first) && _ioProcessors.find(*nameIter) == _ioProcessors.end())
_ioProcessors[*nameIter] = _ioProcessors[ioProcIter->first];
nameIter++;
}