[kepler-dev] CloneNotSupportedException

Ilkay Altintas altintas at sdsc.edu
Wed Apr 20 12:05:39 PDT 2005


Hi Christopher,

We were setting the container of the port to null to hide it.

Is there a better way of doing this?

Thanks,
-ilkay


On Apr 20, 2005, at 10:37 AM, Christopher Brooks wrote:

>>
>> 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.



More information about the Kepler-dev mailing list