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.

PR61658.java 516B

12345678910111213141516171819202122232425262728293031323334353637
  1. class A {
  2. void m() {
  3. System.out.println("A");
  4. }
  5. }
  6. class B extends A {
  7. void m() {
  8. System.out.println("B");
  9. }
  10. }
  11. aspect FunkyPointcut {
  12. after(A a, B b) returning:
  13. call(* foo(*,*)) &&
  14. (args(b,a) || args(a,b)) {
  15. System.out.println("Woven");
  16. }
  17. }
  18. public class PR61658 {
  19. public static void foo(A a, A b) {
  20. a.m();
  21. b.m();
  22. }
  23. public static void main(String[] args) {
  24. A a = new A();
  25. B b = new B();
  26. foo(b,a);
  27. }
  28. }