summaryrefslogtreecommitdiffstats
path: root/tests/bugs/IfPerThis/Testcase1.java
diff options
context:
space:
mode:
authoraclement <aclement>2004-05-18 15:54:05 +0000
committeraclement <aclement>2004-05-18 15:54:05 +0000
commit68bc96dd1086d5832e96395b09f49da2b8e5f995 (patch)
tree591d5c30fa87b8e8c26dc1bb56f436f5aa15e9c9 /tests/bugs/IfPerThis/Testcase1.java
parentb8d69e0fb755e3565831662007cef08118b24bd5 (diff)
downloadaspectj-68bc96dd1086d5832e96395b09f49da2b8e5f995.tar.gz
aspectj-68bc96dd1086d5832e96395b09f49da2b8e5f995.zip
Tests for Bugzilla Bug 62458
An if() pointcut inside a perthis() clause causes an ABORT - null pointer exception in ajc
Diffstat (limited to 'tests/bugs/IfPerThis/Testcase1.java')
-rw-r--r--tests/bugs/IfPerThis/Testcase1.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/bugs/IfPerThis/Testcase1.java b/tests/bugs/IfPerThis/Testcase1.java
new file mode 100644
index 000000000..38ea7b16c
--- /dev/null
+++ b/tests/bugs/IfPerThis/Testcase1.java
@@ -0,0 +1,27 @@
+public class Testcase1 {
+
+ public static void main(String [] args) {
+ new Testcase1().sayhi();
+ }
+
+ public void sayhi() {
+ System.out.println("Hello World");
+ }
+
+}
+
+// Note the use of an if inside a perthis, causes the ajc compiler to
+// throw an exception
+aspect Aspect perthis(if(4==3)) {
+
+ before () : call(* println(..)) && !within(Aspect*) {
+ System.out.println("Advice 1");
+ }
+
+}
+
+aspect Aspect2 pertarget(if(3==4)) {}
+
+aspect Aspect3 percflow(if(3==4)) {}
+
+aspect Aspect4 percflowbelow(if(3==4)) {} \ No newline at end of file