summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-01-07 23:19:58 +0000
committerjhugunin <jhugunin>2003-01-07 23:19:58 +0000
commit1e068fe485d7539ad938712b6bed5812fadf7df7 (patch)
tree619006429e187de543eb94bc8c331f17b9cab2ad /tests/bugs
parent360b569d3a63fcd40828a5ef41fe90b91a16aa72 (diff)
downloadaspectj-1e068fe485d7539ad938712b6bed5812fadf7df7.tar.gz
aspectj-1e068fe485d7539ad938712b6bed5812fadf7df7.zip
more tests from bugzilla
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/DeclareSoftCf.java31
-rw-r--r--tests/bugs/ExceptionsOnInters.java23
-rw-r--r--tests/bugs/InterFieldArrays.java27
3 files changed, 81 insertions, 0 deletions
diff --git a/tests/bugs/DeclareSoftCf.java b/tests/bugs/DeclareSoftCf.java
new file mode 100644
index 000000000..2c9e5581e
--- /dev/null
+++ b/tests/bugs/DeclareSoftCf.java
@@ -0,0 +1,31 @@
+// from Bug 28921
+import org.aspectj.lang.*;
+
+public class DeclareSoftCf {
+
+ public static void a(){
+ b();
+ }
+ /**
+ * Method b.
+ */
+ private static void b() {
+ throw new RuntimeException("Orig");
+ }
+
+ public static void main(String[] args) {
+ try {
+ a();
+ } catch (SoftException e) {
+ System.out.println(e.getWrappedThrowable());
+ }
+ }
+
+ public static interface Checked{
+ }
+
+ static aspect Softner{
+ declare parents : Exception+ && !RuntimeException implements Checked;
+ declare soft : Checked : within(DeclareSoftCf); // ERR: Checked not a Throwable
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/ExceptionsOnInters.java b/tests/bugs/ExceptionsOnInters.java
new file mode 100644
index 000000000..58bb5ef58
--- /dev/null
+++ b/tests/bugs/ExceptionsOnInters.java
@@ -0,0 +1,23 @@
+// from Bug 29106
+
+public class ExceptionsOnInters {
+ public static void main(String args[]) {
+ try {
+ ExceptionsOnInters.bomb();
+ } catch (BombException e) {
+ System.err.println(e);
+ }
+ }
+}
+
+aspect Bomb {
+ public static void ExceptionsOnInters.bomb() throws BombException {
+ throw new BombException("KABOOM");
+ }
+}
+
+class BombException extends Exception {
+ public BombException(String message) {
+ super(message);
+ }
+}
diff --git a/tests/bugs/InterFieldArrays.java b/tests/bugs/InterFieldArrays.java
new file mode 100644
index 000000000..e44e9f57c
--- /dev/null
+++ b/tests/bugs/InterFieldArrays.java
@@ -0,0 +1,27 @@
+import org.aspectj.testing.Tester;
+
+public class InterFieldArrays {
+ public static void main(String[] args) {
+ Foo foo = new Foo();
+ Tester.checkEqual(foo.bar.length, 3);
+ Tester.checkEqual(foo.bar1.length, 3);
+
+ foo.bar2 = new int[] { 21, 22, 23};
+ Tester.checkEqual(foo.bar2.length, 3);
+
+ Tester.checkEqual(foo.bar[2], 3);
+ Tester.checkEqual(foo.bar1[2], 13);
+ Tester.checkEqual(foo.bar2[2], 23);
+
+ int[] a = foo.getInts();
+ }
+}
+
+class Foo { }
+aspect Bar {
+ int[] Foo.bar = { 1, 2, 3 };
+ int[] Foo.bar1 = new int[] { 11, 12, 13};
+ int[] Foo.bar2 = null;
+
+ int[] Foo.getInts() { return new int[] { 1, 2, 3}; }
+} \ No newline at end of file