diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-08-23 12:19:58 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-08-23 12:19:58 -0700 |
commit | 76d695ff1a6f8863a1b64f17e38a5ffee170f09f (patch) | |
tree | 2626329dfe39c9587ff7617c81d3620a529e34a3 /tests/bugs171 | |
parent | 5ef30bda739949d9f01b2b1792322382018e2be1 (diff) | |
download | aspectj-76d695ff1a6f8863a1b64f17e38a5ffee170f09f.tar.gz aspectj-76d695ff1a6f8863a1b64f17e38a5ffee170f09f.zip |
387444
Diffstat (limited to 'tests/bugs171')
-rw-r--r-- | tests/bugs171/pr387444/Code.java | 12 | ||||
-rw-r--r-- | tests/bugs171/pr387444/Code2.java | 33 |
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/bugs171/pr387444/Code.java b/tests/bugs171/pr387444/Code.java new file mode 100644 index 000000000..4407908f6 --- /dev/null +++ b/tests/bugs171/pr387444/Code.java @@ -0,0 +1,12 @@ +import java.io.*; + +public class Code { + public void m() { // throws IOException { + try (FileReader reader = new FileReader("test.txt")) { + System.out.println(""); + } + } +} +aspect X { + declare soft: IOException: within(*); +} diff --git a/tests/bugs171/pr387444/Code2.java b/tests/bugs171/pr387444/Code2.java new file mode 100644 index 000000000..6bc83d392 --- /dev/null +++ b/tests/bugs171/pr387444/Code2.java @@ -0,0 +1,33 @@ +import java.io.*; +import org.aspectj.lang.*; + +public class Code2 { + public static void main(String[]argv) { + try { + new Code2().m(); + } catch (SoftException se) { + System.out.println(se.getWrappedThrowable().getMessage()); + } + } + + public void m() { + try (MyReader reader = new MyReader()) { + System.out.println(""); + } + } +} +aspect X { + declare soft: MyException: within(Code2); +} + +class MyReader implements AutoCloseable { + public void close() throws MyException { + throw new MyException("foo"); + } +} + +class MyException extends Exception { + public MyException(String s) { + super(s); + } +} |