aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-03-13 19:16:53 +0000
committerjhugunin <jhugunin>2003-03-13 19:16:53 +0000
commit56cc4f27afaf591f8cebb2450513cc6eb7d51299 (patch)
tree0279a7e07f317888c2ddbee33a63ce4d5ff7c342 /tests
parent21f9d5a71fa19792e0268a97955efdb8bf5d7916 (diff)
downloadaspectj-56cc4f27afaf591f8cebb2450513cc6eb7d51299.tar.gz
aspectj-56cc4f27afaf591f8cebb2450513cc6eb7d51299.zip
test and fix for Bugzilla Bug 34925 v1_1_0_RC1
compiler crash on yesterday's rc1 build
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml6
-rw-r--r--tests/bugs/ConvertToUnchecked.java68
-rw-r--r--tests/jimTests.xml2
3 files changed, 76 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index c524c7191..2f591fff5 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5762,4 +5762,10 @@
<run class="AspectInitError"/>
</ajc-test>
+ <ajc-test dir="bugs" pr="34925"
+ title="declare soft and throw statements">
+ <compile files="ConvertToUnchecked.java"/>
+ <run class="ConvertToUnchecked"/>
+ </ajc-test>
+
</suite>
diff --git a/tests/bugs/ConvertToUnchecked.java b/tests/bugs/ConvertToUnchecked.java
new file mode 100644
index 000000000..2c7eb6c42
--- /dev/null
+++ b/tests/bugs/ConvertToUnchecked.java
@@ -0,0 +1,68 @@
+
+import org.aspectj.testing.Tester;
+
+/** Bugzilla Bug 34925
+ compiler crash on yesterday's rc1 build
+ */
+import java.io.*;
+
+public aspect ConvertToUnchecked {
+
+ public static void main(String[] args) {
+ try {
+ Foo foo = new Foo("hello");
+ Tester.check(false, "shouldn't get here");
+ } catch (PersistenceException pe) {
+ }
+ }
+
+ // convert IOExceptions in Foo to PersistenceException
+ pointcut module() : within(Foo);
+
+ after() throwing (IOException e) : module() {
+ throw new PersistenceException(e);
+ }
+ declare soft: (IOException): module();
+}
+
+class PersistenceException extends RuntimeException
+{
+ public PersistenceException(Throwable cause) {
+ super(cause);
+ }
+}
+
+
+class Root {
+ Root(String s) throws IOException {
+ }
+}
+
+class Foo extends Root {
+ Foo(String s) {
+ super(s);
+ }
+
+ static {
+ if (false) {
+ getFile();
+ throw new IOException("bar");
+ }
+
+ }
+
+ {
+ if (false) throw new IOException("bar");
+ }
+
+ File f = getFile();
+
+ static File getFile() throws IOException {
+ throw new IOException("bad");
+ }
+
+
+ public void m() {
+ throw new IOException("hi");
+ }
+} \ No newline at end of file
diff --git a/tests/jimTests.xml b/tests/jimTests.xml
index 7c1c4af1f..a0ad71ec7 100644
--- a/tests/jimTests.xml
+++ b/tests/jimTests.xml
@@ -1,6 +1,8 @@
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
+
+
<!--
<ajc-test dir="new" pr="885"