You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Basic3b.java 597B

123456789101112131415161718192021222324252627282930313233343536
  1. import org.aspectj.lang.annotation.*;
  2. public class Basic3b {
  3. public static void main(String []argv) {
  4. Basic3b b = new Basic3b();
  5. if (!(b instanceof X.I)) throw new RuntimeException("Basic3b should implement I");
  6. ((X.I)b).m2();
  7. ((X.I)b).m3();
  8. ((X.I)b).m2();
  9. ((X.I)b).m4();
  10. }
  11. }
  12. @Aspect class X {
  13. interface I {
  14. }
  15. class IIimpl implements I {
  16. public void m2() { }
  17. public void m3() { }
  18. public void m4() { }
  19. }
  20. @DeclareParents("Basic3b",defaultimpl="IImpl")
  21. private I simplefield;;
  22. @Before("call(* *(..))")
  23. public void advice1() {}
  24. }