diff options
Diffstat (limited to 'tests/design/eachobject/Tricky3.java')
-rw-r--r-- | tests/design/eachobject/Tricky3.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/design/eachobject/Tricky3.java b/tests/design/eachobject/Tricky3.java index 9f03a0369..d38358e1b 100644 --- a/tests/design/eachobject/Tricky3.java +++ b/tests/design/eachobject/Tricky3.java @@ -2,7 +2,8 @@ import org.aspectj.testing.Tester; public class Tricky3 { public static void main(String[] args) { - C c = new SubC(); + C c = new SubC(); + ((SubC)c).m(); } } @@ -14,19 +15,19 @@ class SubC extends C { } aspect A1 pertarget(target(SubC)) { - after() returning (SubC sub): call(new(..)) { - System.out.println("new " + sub); + after(SubC sub) returning: call(* m(..)) && target(sub) { + System.out.println("Called m() on " + sub.getClass().getName()); } } aspect A2 pertarget(call(void SubC.*())) { - after() returning (SubC sub): call(new(..)) { - System.out.println("new " + sub); + after(SubC sub) returning: call(* m(..)) && target(sub) { + System.out.println("Called m() on " + sub.getClass().getName()); } } aspect A3 pertarget(call(void m())) { - after() returning (SubC sub): call(new(..)) { - System.out.println("new " + sub); + after(SubC sub) returning: call(* m(..)) && target(sub) { + System.out.println("Called m() on " + sub.getClass().getName()); } } |