[otj-users] OTDT 1.2.0: possible regression

Miguel Pessoa Monteiro mmonteiro at di.fct.unl.pt
Wed Jul 9 18:50:14 CEST 2008


After over a week of intermission I got back to OT/J. First thing I did was to
install OTDT 1.2.0 final on top of eclipse 3.4. Next I run a few examples and to my
surprise the following example aborts with the following output:

Exception in thread "main" java.lang.VerifyError: (class:
experiments/context_capture2/Team$__OT__Role, method: doSomething signature: ()V)
Expecting to find object/array on stack
   at experiments.context_capture2.Team._OT$liftTo$Role(Team.java:10) at
experiments.context_capture2.Team._OT$Role$doSomething$trigger(Team.java:20) at
experiments.context_capture2.BaseObject._OT$trigger$chain(BaseObject.java) at
experiments.context_capture2.BaseObject.trigger(BaseObject.java) at
experiments.context_capture2.Main.main(Main.java:12)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source)
   at org.cs3.jmangler.bootstrap.Start.main(Start.java:66)


The error is thrown whenever the line from the role below is out of comments, i.e.
it's related to inferred callout (from a suggestion by Marco Mosconi in a previous
post).
I could swear the example worked OK before, when using OTDT 1.2.0 Milestone 3 on top
of eclipse 3.4 RC4. I wonder if this is a regression... Unfortunately I can't check
for myself: though I still have the zip for eclipse 3.4 RC4, I don't have the files
for OTDT 1.2.0 Milestone 3 and the update site's URL is the same as for OTDT 1.2.0.


public team class Team {
   public class Role playedBy BaseObject {
      public abstract int fieldInternalNumber();
      public abstract BaseObject getBaseObject();

      public void doSomething() {
         System.out.println("From Team.");
//         System.out.println("\tFrom BlackBox base object: " + _internalNumber);
         System.out.println("\tFrom BlackBox base object: " +
fieldInternalNumber());
         System.out.println();
      }
      void doSomething() <- before void trigger();
      int fieldInternalNumber() -> get int _internalNumber;
      BaseObject getBaseObject() -> BaseObject self();
   }
}


public class Main {
   public static void main(String[] args) {
      System.out.println("Hello");
      Team teamObject = new Team();
      teamObject.activate();

      BaseObject baseObject = new BaseObject();
      baseObject.trigger();
   }
}

public class BaseObject {
   private int _internalNumber = 23;

   public int value() {
      return _internalNumber;
   }
   private BaseObject self() {
      return this;
   }
   public void trigger() {
      System.out.println("trigger");
   }
   public String toString() {
      return "<" + getClass().getCanonicalName() + ";" + _internalNumber + ">";
   }
}



-- 
Miguel P. Monteiro          | cell phone +351 96 700 35 45
Departamento de Informatica | Phone +351 21 294 8536 ext. 10708
Faculdade Ciencias e Tecnol.| Fax: +351 21 294 8541
Universidade Nova de Lisboa | URL: http://ctp.di.fct.unl.pt/~mpm
2829-516 Caparica, PORTUGAL | e-mail: mmonteiro [at] di fct unl pt







More information about the otj-users mailing list