]> source.dussan.org Git - aspectj.git/commitdiff
307009: test and fix: declare soft and call joinpoint (matching on annotations)
authoraclement <aclement>
Thu, 29 Apr 2010 19:49:27 +0000 (19:49 +0000)
committeraclement <aclement>
Thu, 29 Apr 2010 19:49:27 +0000 (19:49 +0000)
tests/bugs169/pr307009/Ann.java [new file with mode: 0644]
tests/bugs169/pr307009/Bug.aj [new file with mode: 0644]
tests/bugs169/pr307009/Test.java [new file with mode: 0644]
tests/bugs169/pr307009/Test2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java
tests/src/org/aspectj/systemtest/ajc169/ajc169.xml

diff --git a/tests/bugs169/pr307009/Ann.java b/tests/bugs169/pr307009/Ann.java
new file mode 100644 (file)
index 0000000..c6d7689
--- /dev/null
@@ -0,0 +1,7 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.CLASS)
+public @interface Ann
+{
+}
+
diff --git a/tests/bugs169/pr307009/Bug.aj b/tests/bugs169/pr307009/Bug.aj
new file mode 100644 (file)
index 0000000..d7d94d0
--- /dev/null
@@ -0,0 +1,6 @@
+public aspect Bug {
+       // works when specifying *.aj *.java, fails when using -sourceroots!
+       declare soft : Exception : call(@Ann * *(..));
+       // this works in both cases!
+       //declare soft : Exception : call(* m2(..));
+}
diff --git a/tests/bugs169/pr307009/Test.java b/tests/bugs169/pr307009/Test.java
new file mode 100644 (file)
index 0000000..c93ce58
--- /dev/null
@@ -0,0 +1,6 @@
+public class Test
+{
+       public void m() {
+               new Test2().m2();
+       }
+}
diff --git a/tests/bugs169/pr307009/Test2.java b/tests/bugs169/pr307009/Test2.java
new file mode 100644 (file)
index 0000000..3352327
--- /dev/null
@@ -0,0 +1,7 @@
+public class Test2
+{
+       @Ann
+       public void m2() throws Exception {
+               throw new Exception();
+       }
+}
index e381e1b1d2029ccb9a0636363ef22e0a911a356c..040496b6cda94142f2d37764bb44c06173bc7523 100644 (file)
@@ -18,6 +18,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testDeclareSoftCall_307009_1() {
+               runTest("declare soft and call - 1");
+       }
+
+       public void testDeclareSoftCall_307009_2() {
+               runTest("declare soft and call - 2");
+       }
+
        public void testAmbiguousMethod_298665() {
                runTest("ambiguous method");
        }
index 06daa16cd1ac608094ec67b900105d6269d3b827..db502f80dede9b63e23f82e7da17d33ea0a1bcfe 100644 (file)
@@ -2,9 +2,20 @@
 
 <suite>
 
+   <ajc-test dir="bugs169/pr307009" title="declare soft and call - 1">
+       <compile files="Test.java Test2.java Ann.java Bug.aj" options="-1.5 -showWeaveInfo">
+               <message kind="weave" text="Softening exceptions in type 'Test' (Test.java:4) as defined by aspect 'Bug' (Bug.aj:3)"/>
+       </compile>
+   </ajc-test>
+
+   <ajc-test dir="bugs169/pr307009" title="declare soft and call - 2">
+       <compile files="Test2.java Test.java Ann.java Bug.aj" options="-1.5 -showWeaveInfo">
+               <message kind="weave" text="Softening exceptions in type 'Test' (Test.java:4) as defined by aspect 'Bug' (Bug.aj:3)"/>
+       </compile>
+   </ajc-test>
+   
    <ajc-test dir="bugs169/pr310043" title="rogue error">
        <compile files="B.java" classpath="code.jar" aspectpath="code.jar"/>
-
    </ajc-test>
    
    <ajc-test dir="bugs169/pr309743" title="itd marker annotations - 1">