[kepler-dev] KAR files + private classes

Chad Berkley berkley at nceas.ucsb.edu
Tue Mar 31 09:27:50 PDT 2009


Hi Michal,

I've confirmed that this is a bug.  I've entered a bug report here:
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3921

Feel free to add any other notes you think are pertinent.  I'll try to
take a look at this further later today though it may take us some time
to figure out a fix.  It's also possible that we will be significantly
redesigning the KAR system in the not too distant future so we'll be
sure to address this then.

Thanks,
chad


Michal Owsiak wrote:
> Hello all,
> 
> there is an issue related to exporting actors as KAR files. When actor
> class contains private class, actor is not properly exported into KAR
> file. This issue does not affect inner classes - these are exported
> correctly.
> 
> If you try to export as KAR, and then import following actor into
> Kepler, exception is thrown (PrivateClass is not visible).
> 
> I know that this issue depends on a paradigm of class imports (whether
> to use private classes at all), thus I do not say it is a bad thing - it
> just happens.
> 
> Cheers
> 
> Michal
> 
> --- CUT ---
> package pl.psnc.kepler.sandbox;
> 
> import ptolemy.actor.TypedAtomicActor;
> import ptolemy.actor.TypedIOPort;
> import ptolemy.data.StringToken;
> import ptolemy.data.type.BaseType;
> import ptolemy.kernel.CompositeEntity;
> import ptolemy.kernel.util.IllegalActionException;
> import ptolemy.kernel.util.NameDuplicationException;
> 
> public class HelloWorldInner extends TypedAtomicActor {
> 
>   public HelloWorldInner(CompositeEntity container, String name)
>       throws NameDuplicationException, IllegalActionException {
>     super(container, name);
> 
>     output = new TypedIOPort(this, "output", false, true);
>     output.setTypeEquals(BaseType.STRING);
>   }
> 
>   public TypedIOPort output = null;
> 
>   class InnerClass {
>     public String innerTest() {
>       return "Inner test";
>     }
>   }
> 
>   public void fire() throws IllegalActionException {
>     super.fire();
>     output.send(0, new StringToken("Hello: " + new
> PrivateClass().privateTest() + ":" + new
> HelloWorldInner.InnerClass().innerTest()));
>   }
> }
> 
> class PrivateClass {
>   public String privateTest() {
>     return "Test";
>   }
> }
> 
> --- CUT ---
> 



More information about the Kepler-dev mailing list