diff options
author | aclement <aclement> | 2006-01-24 09:59:17 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-01-24 09:59:17 +0000 |
commit | d916002f3d0ba392915ec323ff7ae189a5bdb474 (patch) | |
tree | 64af314851e55504fcfb57432220fd52826bf048 /tests/multiIncremental/PR124399 | |
parent | 28f8c695ccc8513e9dcbe0c4fb6ebdc71cf84313 (diff) | |
download | aspectj-d916002f3d0ba392915ec323ff7ae189a5bdb474.tar.gz aspectj-d916002f3d0ba392915ec323ff7ae189a5bdb474.zip |
testcode for 124399
Diffstat (limited to 'tests/multiIncremental/PR124399')
-rw-r--r-- | tests/multiIncremental/PR124399/base/edu/ucsd/aosd/MyApplication.aj | 27 | ||||
-rw-r--r-- | tests/multiIncremental/PR124399/inc1/edu/ucsd/aosd/MyApplication.aj | 27 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/multiIncremental/PR124399/base/edu/ucsd/aosd/MyApplication.aj b/tests/multiIncremental/PR124399/base/edu/ucsd/aosd/MyApplication.aj new file mode 100644 index 000000000..0ee8a869f --- /dev/null +++ b/tests/multiIncremental/PR124399/base/edu/ucsd/aosd/MyApplication.aj @@ -0,0 +1,27 @@ +package edu.ucsd.aosd; + +import java.io.PrintStream; + +public class MyApplication +{ + // main + public static void main(String[] args) { + for (String arg : args) { + System.out.println("got: " + arg); +// System.out.printf("got: %s\n", arg); + } + } +} + +aspect Printing { + pointcut printlnCalls(PrintStream ps, String out): + call(* PrintStream+.println(String)) && target(ps) && args(out); + Object around(PrintStream ps, String out): + printlnCalls(ps, out) && !adviceexecution() { + return proceed(ps, out); + } + +// pointcut printfCalls(PrintStream ps, String fmt, Object[] objs): +// call(* PrintStream+.printf(String, Object...#####)) +// && target(ps) && args(fmt, objs); +} diff --git a/tests/multiIncremental/PR124399/inc1/edu/ucsd/aosd/MyApplication.aj b/tests/multiIncremental/PR124399/inc1/edu/ucsd/aosd/MyApplication.aj new file mode 100644 index 000000000..32aa992fa --- /dev/null +++ b/tests/multiIncremental/PR124399/inc1/edu/ucsd/aosd/MyApplication.aj @@ -0,0 +1,27 @@ +package edu.ucsd.aosd; + +import java.io.PrintStream; + +public class MyApplication +{ + // main + public static void main(String[] args) { + for (String arg : args) { + System.out.println("got: " + arg); + System.out.printf("got: %s\n", arg); + } + } +} + +aspect Printing { + pointcut printlnCalls(PrintStream ps, String out): + call(* PrintStream+.println(String)) && target(ps) && args(out); + Object around(PrintStream ps, String out): + printlnCalls(ps, out) && !adviceexecution() { + return proceed(ps, out); + } + + pointcut printfCalls(PrintStream ps, String fmt, Object[] objs): + call(* PrintStream+.printf(String, Object...)) + && target(ps) && args(fmt, objs); +} |