aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs153
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs153')
-rw-r--r--tests/bugs153/pr125981/SampleTest.java28
-rw-r--r--tests/bugs153/pr151772/Softener.aj22
-rw-r--r--tests/bugs153/pr151772/Softener2.aj23
3 files changed, 73 insertions, 0 deletions
diff --git a/tests/bugs153/pr125981/SampleTest.java b/tests/bugs153/pr125981/SampleTest.java
new file mode 100644
index 000000000..3712281ce
--- /dev/null
+++ b/tests/bugs153/pr125981/SampleTest.java
@@ -0,0 +1,28 @@
+public class SampleTest {
+ public interface ByteReadingStrategy {
+ void readBytes(java.io.InputStream str);
+ }
+
+ public ByteReadingStrategy byteReadingStrategy;
+
+ private final ByteReadingStrategy offsetBuf = new ByteReadingStrategy() {
+ public void readBytes(java.io.InputStream str) {
+ str.read();
+ }
+ };
+
+ private class NamedByteReadingStrategy {
+ public void readBytes(java.io.InputStream str) {
+ str.read();
+ }
+ };
+
+ public void foo(){}
+}
+
+aspect Soften {
+ pointcut softenedTests() :
+ within(SampleTest+) && execution(* *(..)) && !execution(* *(..) throws Exception+);
+
+ declare soft: Exception+: softenedTests();
+}
diff --git a/tests/bugs153/pr151772/Softener.aj b/tests/bugs153/pr151772/Softener.aj
new file mode 100644
index 000000000..4e021e170
--- /dev/null
+++ b/tests/bugs153/pr151772/Softener.aj
@@ -0,0 +1,22 @@
+import java.sql.SQLException;
+
+public aspect Softener {
+
+ // expect this to soften the exception thrown
+ declare soft: Throwable : execution(* *.run());
+}
+
+class SoftenInner {
+ public static void main(String args[]) {
+ new SoftenInner().foo();
+ }
+
+ public void foo() {
+ new Runnable() {
+ public void run() {
+ throw new SQLException("test");
+ }
+ }.run();
+ }
+
+}
diff --git a/tests/bugs153/pr151772/Softener2.aj b/tests/bugs153/pr151772/Softener2.aj
new file mode 100644
index 000000000..5e8555180
--- /dev/null
+++ b/tests/bugs153/pr151772/Softener2.aj
@@ -0,0 +1,23 @@
+import java.sql.SQLException;
+
+public aspect Softener2 {
+
+ // don't expect this to soften the exception thrown
+ declare soft: Throwable: execution(* SoftenInner.foo());
+
+}
+
+class SoftenInner {
+ public static void main(String args[]) {
+ new SoftenInner().foo();
+ }
+
+ public void foo() {
+ new Runnable() {
+ public void run() {
+ throw new SQLException("test");
+ }
+ }.run();
+ }
+
+}