[kepler-dev] Possible bug: variable name must equal MoML name

Christopher Brooks cxh at eecs.berkeley.edu
Mon Oct 11 22:35:32 PDT 2004


Looks like a bug in the Ptolemy II class mechanism.

I've checked in your example as a test in
domains/pn/test/NameProblem.xml and
domains/pn/test/auto/NameProblemTest.xml

I poked around for a solution be have not found one.  I'll see what I
can do.  

I also fixed a bug in actor/process/ProcessThread.java where
the NullPointerException message was going to stderr instead of being
displayed in a stack trace window.

_Christopher

--------
    Hi,
    
    In the process of writing an actor, Ilkay and I encountered a possible=20=
    
    bug in the implementation of the code that allows instantiation of a=20
    class in the workflow.
    
    Attached are the workflow and the actor that demonstrates this problem.
    
    In the attached actor code, there's a port that's instantiated as:
    
    inputo =3D new TypedIOPort(this, "input", true, false);
    
    
    So the variable name is "inputo", but it is named "input" in the MoML.
    
    When I run this workflow, I get:
    
    
    
    Exception in thread ".np.InstanceOfClass2.NameProblem"=20
    java.lang.RuntimeException: java.lang.NullPointerException
    =A0=A0=A0=A0=A0=A0=A0 at=20
    ptolemy.actor.process.ProcessThread.run(ProcessThread.java:219)
    Caused by: java.lang.NullPointerException
    =A0=A0=A0=A0=A0=A0=A0 at NameProblem.fire(NameProblem.java:28)
    =A0=A0=A0=A0=A0=A0=A0 at=20
    ptolemy.actor.process.ProcessThread.run(ProcessThread.java:181)
    Exception in thread ".np.InstanceOfClass.NameProblem"=20
    java.lang.RuntimeException: java.lang.NullPointerException
    =A0=A0=A0=A0=A0=A0=A0 at=20
    ptolemy.actor.process.ProcessThread.run(ProcessThread.java:219)
    Caused by: java.lang.NullPointerException
    =A0=A0=A0=A0=A0=A0=A0 at NameProblem.fire(NameProblem.java:28)
    =A0=A0=A0=A0=A0=A0=A0 at=20
    ptolemy.actor.process.ProcessThread.run(ProcessThread.java:181)
    
    
    However, interestingly enough, if I rename the variable to "input", and=20=
    
    thus match the MoML name, there's no exception.
    
    So somehow, the workflow only runs if the variable name is the same as=20=
    
    the MoML name.
    
    Is this a bug in Ptolemy or is something missing in my understanding of=20=
    
    writing actors?
    
    
    Thanks in advance for the help!
    Xiaowen
    
    
    
    
<<attachments deleted>>



More information about the Kepler-dev mailing list