--- /dev/null
+package x;
+
+abstract aspect Aspect {
+
+ abstract pointcut scope();
+
+ before(): call(* foo(..)) && cflow(execution(* toplevel(..))) && scope() {
+ System.out.println("advice fired");
+ }
+}
\ No newline at end of file
--- /dev/null
+package a;
+
+public class ClassToAdvise {
+
+ public void toplevel() {
+ foo();
+ }
+
+ public void foo() {}
+
+}
\ No newline at end of file
--- /dev/null
+package a;
+
+public class ClassWithMain {
+ public static void main(String []argv) {
+ new ClassToAdvise().toplevel();
+ new ClassToAdvise().foo();
+ }
+}
\ No newline at end of file
--- /dev/null
+<aspectj>
+ <aspects>
+ <concrete-aspect name="x.Aspect2" extends="x.Aspect">
+ <pointcut name="scope" expression="within(*)"/>
+ </concrete-aspect>
+ </aspects>
+ <!-- weaver options="-verbose -showWeaveInfo -debug"-->
+ <weaver>
+ <include within="a..*"/>
+ </weaver>
+</aspectj>
\ No newline at end of file
//public void testAfterThrowingAnnotationStyle_pr211674_1() { runTest("after throwing annotation style problem - 1");}
//public void testAfterThrowingAnnotationStyle_pr211674_2() { runTest("after throwing annotation style problem - 2");}
- // Testing some issues with declare at type
+ // crappy solution - see the bug
+// public void testCflowLtwProblem_pr166647_1() { runTest("ltw and cflow problem"); }
+
+ // Testing some issues with declare at type
public void testDeclareAtTypeProblems_pr211052_1() { runTest("declare atType problems - 1"); }
public void testDeclareAtTypeProblems_pr211052_2() { runTest("declare atType problems - 2"); }
public void testDeclareAtTypeProblems_pr211052_3() { runTest("declare atType problems - 3"); }
<!-- AspectJ v1.6.0 Tests -->
<suite>
+
+ <ajc-test dir="bugs154/pr166647" title="ltw and cflow problem">
+ <compile options="-1.5" files="ClassToAdvise.java,ClassWithMain.java" outjar="code.jar"/>
+ <compile options="-1.5 -Xlint:ignore" files="Aspect.java" outjar="aspects.jar"/>
+ <run class="a.ClassWithMain" classpath="aspects.jar;code.jar" ltw="aop1.xml">
+ <stdout>
+ <line text="advice fired"/>
+ </stdout>
+ <stderr>
+ </stderr>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs154/pr211052" title="declare atType problems - 1">
<compile options="-1.5" files="MyPojo.java"/>
<run class="MyPojo"/>