--- /dev/null
+public class Basic1 {
+ public static void main(String []argv) {
+ Basic1 b = new Basic1();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic1 should implement I");
+ }
+}
+
+
+
+aspect X {
+
+ interface I {
+ }
+
+ declare parents: Basic1 implements I;
+
+}
+
--- /dev/null
+import org.aspectj.lang.annotation.*;
+
+public class Basic1b {
+ public static void main(String []argv) {
+ Basic1b b = new Basic1b();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic1b should implement I");
+ }
+}
+
+
+
+@Aspect
+class X {
+
+ interface I {
+ }
+
+ @DeclareParents("Basic1bb")
+ private I someField;
+
+}
+
--- /dev/null
+public class Basic2 {
+ public static void main(String []argv) {
+ Basic2 b = new Basic2();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic2 should implement I");
+ }
+}
+
+
+
+aspect X {
+
+ interface I {
+ }
+
+ public void I.m2() {
+
+ }
+
+
+ declare parents: Basic2 implements I;
+
+
+ before(): execution(* *(..)) {
+ }
+
+}
+
--- /dev/null
+import org.aspectj.lang.annotation.*;
+
+public class Basic2b {
+ public static void main(String []argv) {
+ Basic2b b = new Basic2b();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic2b should implement I");
+ }
+}
+
+
+
+@Aspect class X {
+
+ interface I {
+ }
+
+ class IIimpl implements I {
+ public void m2() { }
+ }
+
+
+ @DeclareParents("Basic2b",defaultimpl="IImpl")
+ private I simplefield;;
+
+
+ @Before("execution(* *(..))")
+ public void advice1() {}
+
+}
+
--- /dev/null
+
+
+public class Basic3 {
+ public static void main(String []argv) {
+ Basic3 b = new Basic3();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic3 should implement I");
+ ((X.I)b).m2();
+ ((X.I)b).m3();
+ ((X.I)b).m2();
+ ((X.I)b).m4();
+ }
+}
+
+
+
+aspect X {
+
+ interface I {
+ }
+
+ public void I.m2() { }
+ public void I.m3() { }
+ public void I.m4() { }
+
+
+ declare parents: Basic3 implements I;
+
+
+ before(): call(* m*(..)) {
+ }
+
+}
+
--- /dev/null
+import org.aspectj.lang.annotation.*;
+
+public class Basic3b {
+ public static void main(String []argv) {
+ Basic3b b = new Basic3b();
+ if (!(b instanceof X.I)) throw new RuntimeException("Basic3b should implement I");
+ ((X.I)b).m2();
+ ((X.I)b).m3();
+ ((X.I)b).m2();
+ ((X.I)b).m4();
+ }
+}
+
+
+
+@Aspect class X {
+
+ interface I {
+ }
+
+ class IIimpl implements I {
+ public void m2() { }
+ public void m3() { }
+ public void m4() { }
+ }
+
+
+ @DeclareParents("Basic3b",defaultimpl="IImpl")
+ private I simplefield;;
+
+
+ @Before("call(* *(..))")
+ public void advice1() {}
+
+}
+