[otj-users] OTDT 1.2.0: possible regression

Marco Mosconi mosconi at cs.tu-berlin.de
Wed Jul 9 19:06:19 CEST 2008


Hi Miguel,

this error is known and already fixed in SVN. It affects only inferred 
callouts to fields with primitive types (int, boolean, ...).
Until Stephan publishes the next minor version, please use the 
"materialize inferred callout ..." quick fixes or implement your own 
explicit callouts for the affected fields.

Sorry for pointing you directly to a bug ;-)

Marco

Miguel Pessoa Monteiro schrieb:
> 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 + ">";
>    }
> }
> 
> 
> 

-- 
Dipl.-Inform. Marco Mosconi
Technische Universität Berlin
Fak. IV, Fachg. Softwaretechnik



More information about the otj-users mailing list