diff options
author | aclement <aclement> | 2006-10-26 09:52:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-26 09:52:09 +0000 |
commit | 2d20069013a05c140f3ce605c2f1588535db19cc (patch) | |
tree | b88a77ffd01de89ea432fd361ded9450d9caa639 /tests/bugs153 | |
parent | e4a441b93c2f1a644784af90d8256f0d6c194b4c (diff) | |
download | aspectj-2d20069013a05c140f3ce605c2f1588535db19cc.tar.gz aspectj-2d20069013a05c140f3ce605c2f1588535db19cc.zip |
testcode for 162135
Diffstat (limited to 'tests/bugs153')
-rw-r--r-- | tests/bugs153/pr162135/Foo.java | 25 | ||||
-rw-r--r-- | tests/bugs153/pr162135/Foo2.java | 46 | ||||
-rw-r--r-- | tests/bugs153/pr162135/Foo3.java | 44 | ||||
-rw-r--r-- | tests/bugs153/pr162135/Foo4.java | 39 | ||||
-rw-r--r-- | tests/bugs153/pr162135/Foo5.java | 29 |
5 files changed, 183 insertions, 0 deletions
diff --git a/tests/bugs153/pr162135/Foo.java b/tests/bugs153/pr162135/Foo.java new file mode 100644 index 000000000..df4211a4b --- /dev/null +++ b/tests/bugs153/pr162135/Foo.java @@ -0,0 +1,25 @@ +import java.lang.reflect.Field; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect public class Foo { + + public void m() { + new RuntimeException("hello"); + } + + public static void main(String[] argv) { + } + + @Pointcut("call(Throwable+.new(String, ..)) && this(caller) && if()") + public static boolean exceptionInitializer(Object caller) { + return true; + } + + @Around("exceptionInitializer(caller)") + public Object annotateException(ProceedingJoinPoint jp, Object caller) { + return null; + } +} diff --git a/tests/bugs153/pr162135/Foo2.java b/tests/bugs153/pr162135/Foo2.java new file mode 100644 index 000000000..9fbf93375 --- /dev/null +++ b/tests/bugs153/pr162135/Foo2.java @@ -0,0 +1,46 @@ +//package com.foliofn.infra.logging; + +import java.lang.reflect.Field; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect public class Foo2 { +// aspect Foo { + + public void m() { + new RuntimeException("hello"); + } + public static void main(String[] argv) { + + } + +// Object around(Object caller): call(Throwable+.new(String, ..)) && this(caller) && if(true==true) { + @Around("call(Throwable+.new(String, ..)) && this(caller)") + public Object annotateException(ProceedingJoinPoint jp, Object caller) { + return null; + } + +// @Pointcut("call(Throwable+.new(String, ..)) && args(exceptionMessage) && if()") +// public static boolean exceptionInitializer(String exceptionMessage) { +// return true; +// } +// +// @Around("exceptionInitializer( exceptionMessage)") +// public Object annotateException(ProceedingJoinPoint jp, String exceptionMessage) { +// return null; +// } + +// @Pointcut("call(Throwable+.new(String, ..)) && this(caller) && args(exceptionMessage) && if()") +// public static boolean exceptionInitializer(Object caller, String exceptionMessage) { +// return true; +// } +// +// @Around("exceptionInitializer(caller, exceptionMessage)") +// public Object annotateException(ProceedingJoinPoint jp, Object caller, String exceptionMessage) { +// return null; +// } + +} diff --git a/tests/bugs153/pr162135/Foo3.java b/tests/bugs153/pr162135/Foo3.java new file mode 100644 index 000000000..8265214aa --- /dev/null +++ b/tests/bugs153/pr162135/Foo3.java @@ -0,0 +1,44 @@ +//package com.foliofn.infra.logging; + +import java.lang.reflect.Field; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +//@Aspect public class Foo { +aspect Foo3 { + + public void m() { + new RuntimeException("hello"); + } + public static void main(String[] argv) { + + } + + Object around(Object caller): call(Throwable+.new(String, ..)) && this(caller) && if(true==true) { + return null; + } + +// @Pointcut("call(Throwable+.new(String, ..)) && args(exceptionMessage) && if()") +// public static boolean exceptionInitializer(String exceptionMessage) { +// return true; +// } +// +// @Around("exceptionInitializer( exceptionMessage)") +// public Object annotateException(ProceedingJoinPoint jp, String exceptionMessage) { +// return null; +// } + +// @Pointcut("call(Throwable+.new(String, ..)) && this(caller) && args(exceptionMessage) && if()") +// public static boolean exceptionInitializer(Object caller, String exceptionMessage) { +// return true; +// } +// +// @Around("exceptionInitializer(caller, exceptionMessage)") +// public Object annotateException(ProceedingJoinPoint jp, Object caller, String exceptionMessage) { +// return null; +// } + +} diff --git a/tests/bugs153/pr162135/Foo4.java b/tests/bugs153/pr162135/Foo4.java new file mode 100644 index 000000000..05bea569c --- /dev/null +++ b/tests/bugs153/pr162135/Foo4.java @@ -0,0 +1,39 @@ +//package com.foliofn.infra.logging; + +import java.lang.reflect.Field; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect public class Foo4 { + + public void m() { + new RuntimeException("hello"); + } + + public static void main(String[] argv) { + + } + @Pointcut("call(Throwable+.new(String, ..)) && args(exceptionMessage) && if()") + public static boolean exceptionInitializer(String exceptionMessage) { + return true; + } + + @Around("exceptionInitializer( exceptionMessage)") + public Object annotateException(ProceedingJoinPoint jp, String exceptionMessage) { + return null; + } + +// @Pointcut("call(Throwable+.new(String, ..)) && this(caller) && args(exceptionMessage) && if()") +// public static boolean exceptionInitializer(Object caller, String exceptionMessage) { +// return true; +// } +// +// @Around("exceptionInitializer(caller, exceptionMessage)") +// public Object annotateException(ProceedingJoinPoint jp, Object caller, String exceptionMessage) { +// return null; +// } + +} diff --git a/tests/bugs153/pr162135/Foo5.java b/tests/bugs153/pr162135/Foo5.java new file mode 100644 index 000000000..fb9d6addb --- /dev/null +++ b/tests/bugs153/pr162135/Foo5.java @@ -0,0 +1,29 @@ +//package com.foliofn.infra.logging; + +import java.lang.reflect.Field; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect public class Foo5 { + + public void m() { + new RuntimeException("hello"); + } + public static void main(String[] argv) { + + } + + @Pointcut("call(Throwable+.new(String, ..)) && this(caller) && args(exceptionMessage) && if()") + public static boolean exceptionInitializer(Object caller, String exceptionMessage) { + return true; + } + + @Around("exceptionInitializer(caller, exceptionMessage)") + public Object annotateException(ProceedingJoinPoint jp, Object caller, String exceptionMessage) { + return null; + } + +} |