Hmmm, I had to fix up some of your sample code there as it doesn't actually work as it is. (Is Go an annotation or an aspect - you've used it as both...)
@Go
public class Foo {
public void go() { System.out.println("go"); }
}
=== Go.java
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@interface Go {}
=== GoA.java
public aspect GoA {
public interface I {}
declare parents: (@Go *) implements I;
public void I.go() { System.out.println("aspect-go"); }
}
=== TestFoo.java
public class TestFoo {
public static void main(String []argv) {
new Foo().go();
} // throws AbstractMethodError
}
Compiles and runs fine for me:
> ajc -1.5 *.java -showWeaveInfo
Type 'GoA$I' (GoA.java) has intertyped method from 'GoA' (GoA.java:'void GoA$I.go()')
Extending interface set for type 'Foo' (Foo.java) to include 'GoA$I' (GoA.java)
> java TestFoo
go
As we discussed a little the other day. An ITD on an interface is considered a 'default implementation' as the implementation a class will get that implements the interface if it does not provide its own.
If your ITD had been directly on the class then you would have gotten a clash error:
GoA.java:5 [error] inter-type declaration from GoA conflicts with existing member: void Foo.go()
public void Foo.go() { System.out.println("aspect-go"); }
^^
Foo.java:5 [error] inter-type declaration from GoA conflicts with existing member: void Foo.go()
public void go() { System.out.println("go"); }
If I could recreate your problem I could investigate...
cheers,
Andy