diff options
author | aclement <aclement> | 2006-08-25 12:37:49 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-25 12:37:49 +0000 |
commit | 07e6e9a1767c860b483540ac165108983dc1e1f4 (patch) | |
tree | fd180b83ddb86ca9637df6afd9b1d75bb7c1a4a3 /tests/features153 | |
parent | 5787d0e82f32648f30f4677c13aef68d4615e300 (diff) | |
download | aspectj-07e6e9a1767c860b483540ac165108983dc1e1f4.tar.gz aspectj-07e6e9a1767c860b483540ac165108983dc1e1f4.zip |
last of the dreaded jdtlikehandleprovider changes - 141730#22
Diffstat (limited to 'tests/features153')
5 files changed, 117 insertions, 0 deletions
diff --git a/tests/features153/jdtlikehandleprovider/Get.aj b/tests/features153/jdtlikehandleprovider/Get.aj new file mode 100644 index 000000000..cb300ff34 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/Get.aj @@ -0,0 +1,20 @@ +aspect A1 { + + pointcut getPcd() : get(int C1.x); + + before() : getPcd() { + } + +} + +class C1 { + + int x = 0; + + public void method1() { + int y = x; + System.out.println("y " + y); + int z = x; + System.out.println("z " + z); + } +} diff --git a/tests/features153/jdtlikehandleprovider/Handler.aj b/tests/features153/jdtlikehandleprovider/Handler.aj new file mode 100644 index 000000000..24bbeabb5 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/Handler.aj @@ -0,0 +1,30 @@ +import java.io.FileNotFoundException; + +aspect A { + + pointcut handlerPointcut() : handler(FileNotFoundException); + + before() : handlerPointcut() { + } + +} + +class C { + + public void method() { + try { + exceptionMethod(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + try { + exceptionMethod(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + + + public void exceptionMethod() throws FileNotFoundException { + } +} diff --git a/tests/features153/jdtlikehandleprovider/Set.aj b/tests/features153/jdtlikehandleprovider/Set.aj new file mode 100644 index 000000000..d7822f172 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/Set.aj @@ -0,0 +1,19 @@ +aspect A1 { + + pointcut setPcd() : set(int C1.x); + + before() : setPcd() { + } + +} + +class C1 { + + int x = 0; + + public void method() { + x = 1; + x = 2; + } + +} diff --git a/tests/features153/jdtlikehandleprovider/TwoDiffMethodCalls.aj b/tests/features153/jdtlikehandleprovider/TwoDiffMethodCalls.aj new file mode 100644 index 000000000..b024974c4 --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/TwoDiffMethodCalls.aj @@ -0,0 +1,25 @@ +aspect A { + + pointcut tracedPrint(String s): call(void java.io.PrintStream.println(*)) && + args(s) && !within(A); + + before(String s): tracedPrint(s) { + System.out.println("got you: " + s + " ;)"); + } + + after(String s): tracedPrint(s) { + System.out.println("hehe, finished: " + s + " :("); + } +} + +class Main { + + public static void main(String[] args) { + System.out.println("start"); + } + + public void method(String[] s) { + System.out.println("end"); + } + +} diff --git a/tests/features153/jdtlikehandleprovider/TwoMethodCalls.aj b/tests/features153/jdtlikehandleprovider/TwoMethodCalls.aj new file mode 100644 index 000000000..fb7bd140e --- /dev/null +++ b/tests/features153/jdtlikehandleprovider/TwoMethodCalls.aj @@ -0,0 +1,23 @@ +aspect A { + + pointcut tracedPrint(String s): call(void java.io.PrintStream.println(*)) && + args(s) && !within(A); + + before(String s): tracedPrint(s) { + System.out.println("got you: " + s + " ;)"); + } + + after(String s): tracedPrint(s) { + System.out.println("hehe, finished: " + s + " :("); + } +} + +class Main { + + public static void main(String[] args) { + System.out.println("start"); + System.out.println("end"); + } + +} + |