[kepler-dev] KAR files + private classes

Michal Owsiak michalo at man.poznan.pl
Tue Mar 31 02:33:55 PDT 2009


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

-- 
Michal Owsiak <michalo at man.poznan.pl>
Poznan Supercomputing and Networking Center
ul. Noskowskiego 10, 61-704 Poznan, POLAND
http://www.man.poznan.pl


More information about the Kepler-dev mailing list