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.

Basic2b.java 502B

123456789101112131415161718192021222324252627282930
  1. import org.aspectj.lang.annotation.*;
  2. public class Basic2b {
  3. public static void main(String []argv) {
  4. Basic2b b = new Basic2b();
  5. if (!(b instanceof X.I)) throw new RuntimeException("Basic2b should implement I");
  6. }
  7. }
  8. @Aspect class X {
  9. interface I {
  10. }
  11. public static class IIimpl implements I {
  12. public void m2() { }
  13. }
  14. @DeclareParents(value="Basic2b",defaultImpl=X.IIimpl.class)
  15. private I simplefield;
  16. @Before("execution(* *(..))")
  17. public void advice1() {}
  18. }