[kepler-dev] [Bug 4549] String Replace actor "remembers" previous execution values

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Tue Jan 12 23:33:20 PST 2010


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4549

Christopher Brooks <cxh at eecs.berkeley.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |cxh at eecs.berkeley.edu
         Resolution|FIXED                       |

--- Comment #2 from Christopher Brooks <cxh at eecs.berkeley.edu> 2010-01-12 23:33:19 PST ---
Unfortunately, this fix causes one of the tests to fail:

------------------ testing
$PTII/ptolemy/actor/lib/string/test/auto/StringReplace2.xml
auto.tcl: Setting watchdog for 200 seconds at Tue Jan 12 23:26:36 PST 2010
3 ms. Memory: 2448K Free: 847K (35%)
Exception in thread "Thread-30" java.lang.RuntimeException: Execution failed
    at ptolemy.moml.MoMLSimpleApplication$1.run(MoMLSimpleApplication.java:117)
Caused by: ptolemy.kernel.util.IllegalActionException: Channel index 0 is out
of range, because width is only 0.
  in .StringReplace2.StringReplace4.stringToEdit
    at ptolemy.actor.IOPort.hasToken(IOPort.java:1885)
    at ptolemy.actor.lib.string.StringReplace.fire(StringReplace.java:156)
    at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:469)
    at
ptolemy.actor.sched.StaticSchedulingDirector.fire(StaticSchedulingDirector.java:188)
    at ptolemy.actor.CompositeActor.fire(CompositeActor.java:457)
    at ptolemy.actor.Manager.iterate(Manager.java:714)
    at ptolemy.actor.Manager.execute(Manager.java:349)
    at ptolemy.actor.Manager.run(Manager.java:1120)
    at ptolemy.actor.Manager$3.run(Manager.java:1161)
util.testsuite.WatchDog.cancel(): canceling Tue Jan 12 23:26:36 PST 2010

The change was:

Modified: trunk/ptolemy/actor/lib/string/StringReplace.java
===================================================================
--- trunk/ptolemy/actor/lib/string/StringReplace.java    2010-01-13 02:15:04
UTC (rev 56879)
+++ trunk/ptolemy/actor/lib/string/StringReplace.java    2010-01-13 07:05:39
UTC (rev 56880)
@@ -153,6 +153,9 @@
         if (_debugging) {
             _debug("Called fire()");
         }
+        if (!stringToEdit.getPort().hasToken(0)) {
+            return;
+        }
         replacement.update();
         stringToEdit.update();
         pattern.update();

I'm going to comment out this change temporarily.

I'm not sure, but one possible problem is that stringToEdit is a PortParameter.
If the StringReplace actor has stringToEdit set as a Parameter (not as a Port),
then what does getPort().hasToken() return.

It's late and I don't fully understand the test case without replicating the
instructions.  A test model that does not use RExpression might help track this
down.  There could be a generic problem with all actors that have
PortParameters
or PortParameters and RExpression.

-- 
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Kepler-dev mailing list