diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/AroundCalls.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/AroundCalls.java')
-rw-r--r-- | tests/new/AroundCalls.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/new/AroundCalls.java b/tests/new/AroundCalls.java new file mode 100644 index 000000000..0dd2960e1 --- /dev/null +++ b/tests/new/AroundCalls.java @@ -0,0 +1,42 @@ +import org.aspectj.testing.Tester; + +public class AroundCalls { + public static void main(String[] args) { test(); } + + public static void test() { + //Tester.checkEqual(new C().m(), "abc:2", "many arounds"); + Tester.checkEqual(new C().m(), "acb:2", "many arounds"); + } +} + +class C { + public String m() { + return new D().m1("a", 0); + } +} + +class D { + public String m1(String s, int x) { return s + ":" + x; } +} + +aspect A { + String around(D d, String as, int ax): + call(String D.m1(String,int)) && + args(as,ax) && + target(d) + //receptions(String d.m1(as, ax)) + + { + //System.out.println(as + " : " + d + " : " + ax); + return proceed(d, as + "c", ax + 1); + } + + String around(String as/*, C c1*/, D d1, int ax): + within(C) && + target(d1) && call(String m1(String,int)) && args(as,ax) + //instanceof(c1) && callsto(instanceof(d1) && receptions(String m1(as, ax))) + { + //System.out.println(as + " : " + c1 + " : " + d1 + " : " + ax); + return proceed(as + "b", /*c1,*/ d1, ax + 1); + } +} |