aboutsummaryrefslogtreecommitdiffstats
path: root/tests/design
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-08-18 08:28:26 +0000
committeracolyer <acolyer>2004-08-18 08:28:26 +0000
commitf913f6597088b5aa5a97d8dced01ffcc12df74f3 (patch)
tree44ea4493ef8ec80af106da562fcb72055ad4013c /tests/design
parent7fd50c75ae779195b87922c5ffd839ac7a6910bf (diff)
downloadaspectj-f913f6597088b5aa5a97d8dced01ffcc12df74f3.tar.gz
aspectj-f913f6597088b5aa5a97d8dced01ffcc12df74f3.zip
tests for enh 42743 (commented out) should we decide to do it.
Diffstat (limited to 'tests/design')
-rw-r--r--tests/design/soft/DeclareSoft.aj29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/design/soft/DeclareSoft.aj b/tests/design/soft/DeclareSoft.aj
new file mode 100644
index 000000000..37da96725
--- /dev/null
+++ b/tests/design/soft/DeclareSoft.aj
@@ -0,0 +1,29 @@
+public class DeclareSoft {
+
+ public void throwException() throws Exception {
+ throw new Exception("This should be softened");
+ }
+
+ public void throwRuntimeException() {
+ throw new RuntimeException("Under enh 42743 this should not be softened");
+ }
+
+ public static void main(String[] args) throws Exception {
+ DeclareSoft ds = new DeclareSoft();
+ try {
+ ds.throwException();
+ } catch (org.aspectj.lang.SoftException se) {}
+ try {
+ ds.throwRuntimeException();
+ } catch(org.aspectj.lang.SoftException se) {
+ throw new RuntimeException("Runtime exception was innappropriately softened");
+ } catch (RuntimeException ex) {}
+ }
+
+}
+
+aspect Softener {
+
+ declare soft: Exception : execution(* DeclareSoft.throw*(..));
+
+} \ No newline at end of file