diff options
Diffstat (limited to 'tests/bugs153/pr162135/Foo6.java')
-rw-r--r-- | tests/bugs153/pr162135/Foo6.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs153/pr162135/Foo6.java b/tests/bugs153/pr162135/Foo6.java new file mode 100644 index 000000000..16f125ef7 --- /dev/null +++ b/tests/bugs153/pr162135/Foo6.java @@ -0,0 +1,30 @@ +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 Foo6 { + + public void m() { + new RuntimeException("hello"); + } + + public static void main(String[] argv) { + try { + new Foo6().m(); + } catch (Throwable t) {} + } + + @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) { + System.out.println("ProceedingJoinPoint is "+jp); + System.out.println("caller is "+(caller==null?"null":"notnull")); + return null; + } +} |