--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.CLASS)
+public @interface Ann
+{
+}
+
--- /dev/null
+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(..));
+}
--- /dev/null
+public class Test
+{
+ public void m() {
+ new Test2().m2();
+ }
+}
--- /dev/null
+public class Test2
+{
+ @Ann
+ public void m2() throws Exception {
+ throw new Exception();
+ }
+}
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");
}
<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">