aboutsummaryrefslogtreecommitdiffstats
path: root/tests/design
diff options
context:
space:
mode:
Diffstat (limited to 'tests/design')
-rw-r--r--tests/design/intro/ExceptionsCF.java24
-rw-r--r--tests/design/intro/ExceptionsCP.java25
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/design/intro/ExceptionsCF.java b/tests/design/intro/ExceptionsCF.java
new file mode 100644
index 000000000..4bf8dc661
--- /dev/null
+++ b/tests/design/intro/ExceptionsCF.java
@@ -0,0 +1,24 @@
+import org.aspectj.testing.Tester;
+
+import java.io.IOException;
+
+public class ExceptionsCF {
+ public static void main(String[] args) {
+ C c = new C();
+ c.foo(); // ERR: can't throw IOException here
+ }
+}
+class Root {
+ public void bar() {}
+}
+
+class C extends Root {
+
+}
+
+
+aspect A {
+ public void C.foo() throws IOException { }
+
+ public void C.bar() throws IOException {} // ERR: can't throw more than super
+}
diff --git a/tests/design/intro/ExceptionsCP.java b/tests/design/intro/ExceptionsCP.java
new file mode 100644
index 000000000..92d0b9b27
--- /dev/null
+++ b/tests/design/intro/ExceptionsCP.java
@@ -0,0 +1,25 @@
+import org.aspectj.testing.Tester;
+
+import java.io.IOException;
+
+public class ExceptionsCP {
+ public static void main(String[] args) {
+ C c = new C();
+ try {
+ c.foo();
+ } catch (IOException io) {}
+ c.bar();
+ }
+}
+class Root {
+ public void bar() {}
+}
+
+class C extends Root {
+
+}
+
+
+aspect A {
+ public void C.foo() throws IOException { }
+}