aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/throwsSignature
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-09-04 15:49:08 +0000
committerjhugunin <jhugunin>2003-09-04 15:49:08 +0000
commit8660cc12bfbcd6f4957abd4dfc84735de6c048cf (patch)
tree174a6319b9427d56a9707a89743ba5354eb647d5 /tests/bugs/throwsSignature
parentc1ada785adc3a05f9df4b96469b64e5c77d398de (diff)
downloadaspectj-8660cc12bfbcd6f4957abd4dfc84735de6c048cf.tar.gz
aspectj-8660cc12bfbcd6f4957abd4dfc84735de6c048cf.zip
test and fix for Bugzilla Bug 42539
throw derivative pointcuts not advised
Diffstat (limited to 'tests/bugs/throwsSignature')
-rw-r--r--tests/bugs/throwsSignature/ExceptionAspect.java10
-rw-r--r--tests/bugs/throwsSignature/ExceptionBugTest.java8
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/bugs/throwsSignature/ExceptionAspect.java b/tests/bugs/throwsSignature/ExceptionAspect.java
new file mode 100644
index 000000000..db15fcb6b
--- /dev/null
+++ b/tests/bugs/throwsSignature/ExceptionAspect.java
@@ -0,0 +1,10 @@
+public aspect ExceptionAspect
+{
+ pointcut exceptionThrower() :
+ execution(public * ExceptionBugTest.*(..) throws Exception+);
+
+ declare warning : exceptionThrower() : "throws both";
+
+ declare error : execution(public * ExceptionBugTest.*(..) throws Exception) :
+ "throws Exception";
+} \ No newline at end of file
diff --git a/tests/bugs/throwsSignature/ExceptionBugTest.java b/tests/bugs/throwsSignature/ExceptionBugTest.java
new file mode 100644
index 000000000..e77f28381
--- /dev/null
+++ b/tests/bugs/throwsSignature/ExceptionBugTest.java
@@ -0,0 +1,8 @@
+public class ExceptionBugTest {
+ int x;
+ class MyException extends Exception {}
+
+ public void method1() throws Exception { x = 1; } // warning here
+
+ public void method2() throws MyException { x = 2; } // warning here
+} \ No newline at end of file