Community
Participate
Working Groups
It may be a duplicate of 134425. But the setting is not that similar. Take this example: public interface Marker { String toString(); } public class Foo { public static void main(String[] args) { System.err.println(new Foo().toString()); } } public aspect MarkerAspect { declare parents: Foo implements Marker; public String Marker.toString() { new Runnable() { public void run() { Marker.super.toString(); } }.run(); return super.toString(); } } You will get an: Exception in thread "main" java.lang.IncompatibleClassChangeError at test.MarkerAspect$1.run(MarkerAspect.aj:10) at test.MarkerAspect.ajc$interMethod$test_MarkerAspect$test_Marker$toString(MarkerAspect.aj:12) at test.Foo.toString(Foo.java:1) at test.Foo.main(Foo.java:6) Slightly changing MarkerAspect: public aspect MarkerAspect { declare parents: Foo implements Marker; public String Foo.toString() { new Runnable() { public void run() { Foo.super.toString(); } }.run(); return super.toString(); } } And you will get: Exception in thread "main" java.lang.VerifyError: (class: test/MarkerAspect$1, method: run signature: ()V) Incompatible object argument for function call at test.MarkerAspect.ajc$interMethod$test_MarkerAspect$test_Foo$toString(MarkerAspect.aj:8) at test.Foo.toString(Foo.java:1) at test.MarkerAspect.ajc$interMethodDispatch1$test_MarkerAspect$test_Foo$toString(MarkerAspect.aj) at test.Foo.main(Foo.java:6)
Changing OS from Mac OS to Mac OS X as per bug 185991
investigate in 1.5.4 timeframe
Fixed. The cases here now work. The necessary accessors were created in the right places (luckily) but I just had to convince the compiler to modify the Ast appropriately at the super references. For the <Class>.super references I had to port the fix across for fixing intertype declaration superfixervisitor into the superfixervisitor. For the <Interface>.super reference I had to ensure the right instance is used and the super call dispatch method we already generated (on the target interface and implementations) was called. I'm not 100% sure about the <Interface> case and would like to see how it gets used now I've implemented it. fixes in next dev build.