[kepler-dev] CloneNotSupportedException

Chad Berkley berkley at nceas.ucsb.edu
Wed Apr 20 10:39:58 PDT 2005


ahh cool.  thanks.  ignore the message i just sent then.

chad

Christopher Brooks wrote:
> Hi Chad,
> 
> Ptolemy hackers has a limit of 40k for messages, and your last message
> was over that limit (sorry).  I truncated your message in my response
> below. 
> 
> Chad writes:
> 
> 
>>Hey Christopher,
>>
>>I forgot to address the problem of the actors with ports that actually 
>>do follow the naming convention.  I've attached a class that is an 
>>example of this.  Here's the port definition:
>>
>>startTrigger = new TypedIOPort(this, "startTrigger", true, false);
>>
>>and here's the stack trace:
>>
>>[java] java.lang.CloneNotSupportedException: Problem cloning 
>>'startTrigger'     [java]     at 
>>ptolemy.kernel.Entity.clone(Entity.java:224)
>>      [java]     at 
>>ptolemy.kernel.ComponentEntity.clone(ComponentEntity.java:125)
>>      [java]     at ptolemy.actor.AtomicActor.clone(AtomicActor.java:121)
>>      [java]     at 
> 
> 
> 
> The problem is in the constructor, where you create startTrigger:
> 
>      startTrigger = new TypedIOPort(this, "startTrigger", true, false);
>      new Attribute(startTrigger, "_showName");
>      startTrigger.setContainer(null);
> 
> If I remove the setContainer(null) line, then startTrigger is properly
> cloned.  I think setting setContainer(null) on a port basically removes
> it from the hierarchy, which causes no end of problems for clone,
> since then startTrigger is not found.  The error message is wrong
> though.
> 
> I created a test for this in kernel/Entity.tcl.
> I'll see if I can come up with a better error message.
> 
> We have group lunch today, we'll talk over the clone issue and
> get back to you.
> 
> 
>>The only test I have for showing this error is to start up kepler and 
>>open a new graph editor and watch the errors scroll by :)
> 
> 
> ptolemy/configs/test/allConfigs.tcl has tests that clone all the
> actors.
> 
> 
> 
>>chad
>>
> 
> 
> _Christopher
> 



More information about the Kepler-dev mailing list