diff options
Diffstat (limited to 'tests/design/eachobject/Tricky3.java')
-rw-r--r-- | tests/design/eachobject/Tricky3.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/design/eachobject/Tricky3.java b/tests/design/eachobject/Tricky3.java new file mode 100644 index 000000000..9f03a0369 --- /dev/null +++ b/tests/design/eachobject/Tricky3.java @@ -0,0 +1,32 @@ +import org.aspectj.testing.Tester; + +public class Tricky3 { + public static void main(String[] args) { + C c = new SubC(); + } +} + +class C { +} + +class SubC extends C { + void m() { } +} + +aspect A1 pertarget(target(SubC)) { + after() returning (SubC sub): call(new(..)) { + System.out.println("new " + sub); + } +} + +aspect A2 pertarget(call(void SubC.*())) { + after() returning (SubC sub): call(new(..)) { + System.out.println("new " + sub); + } +} + +aspect A3 pertarget(call(void m())) { + after() returning (SubC sub): call(new(..)) { + System.out.println("new " + sub); + } +} |