Understanding or Bug? [message #573920] |
Fri, 30 April 2010 15:02 |
Jan Marc Hoffmann Messages: 32 Registered: July 2009 |
Member |
|
|
Here is what I did:
public team class OuterTeam {
public team class InnerTeam playedBy OuterBase {
protected class SomeRole playedBy InnerBase {
}
@SuppressWarnings("ambiguouslowering")
public void createRole(InnerBase as SomeRole b) {
System.out.println(OuterTeam.this.hasRole(b, SomeRole.class));
}
}
public InnerTeam registerInnerTeam(OuterBase as InnerTeam o) {
return o;
}
}
Called by:
public class Main {
public static void main(String[] args) {
OuterBase ob = new OuterBase();
InnerBase ib = new InnerBase();
final OuterTeam ot = new OuterTeam();
InnerTeam<@ot> it = ot.registerInnerTeam(ob);
it.createRole(ib);
}
}
Results in:
Exception in thread "main" java.lang.NoSuchMethodError: otdtbugs.OuterTeam$InnerTeam._OT$getClass$SomeRole()Ljava/la ng/Class;
at otdtbugs.OuterTeam$__OT__InnerTeam.createRole(OuterTeam.java :12)
at otdtbugs.Main.main(Main.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.cs3.jmangler.bootstrap.Start.main(Start.java:66)
The exact same code works fine if the second argument of the hasRole method is omitted.
Really troublesome got this when I used it in conclusion with the ObjectRegistration Pattern ( http://trac.objectteams.org/ot/wiki/OtPatterns/ObjectRegistr ation). Used in GuardPredicates no error will get thrown and the Base wont get lifted.
Is there an error in my understanding or is this a bug?
greetings and congratulations on the approval
Jan Marc
|
|
|
Powered by
FUDForum. Page generated in 0.03184 seconds