<run class="test.Test3"/>
</ajc-test>
+ <ajc-test dir="bugs" pr="31423"
+ title="Pointcut adviceexecution() does not work">
+ <compile files="AdviceExec.java"/>
+ <run class="AdviceExec"/>
+ </ajc-test>
+
</suite>
--- /dev/null
+// for Bug#: 31423
+import org.aspectj.testing.Tester;
+
+
+public class AdviceExec {
+ public static void main(String[] args) {
+ Tester.checkEqual(Aspect1.ran, 2, "Aspect1 ran");
+ Tester.checkEqual(Aspect2.ran, 2, "Aspect2 ran");
+ }
+}
+
+aspect Aspect1 {
+ static int ran = 0;
+ before() : execution(* AdviceExec.*(..)) {
+ //System.out.println("Reached " + thisJoinPoint);
+ ran++;
+ }
+
+ void around(): execution(* AdviceExec.*(..)) {
+ ran++;
+ proceed();
+ }
+}
+
+aspect Aspect2 {
+ static int ran = 0;
+ before() : adviceexecution() && !within(Aspect2) {
+ //System.out.println("Reached " + thisJoinPoint);
+ ran++;
+ }
+}
public boolean fastMatch(JavaClass jc) { return true; }
public FuzzyBoolean match(Shadow shadow) {
-
-
if (shadow.getKind() != kind) return FuzzyBoolean.NO;
if (!signature.matches(shadow.getSignature(), shadow.getIWorld())) return FuzzyBoolean.NO;
world.getLint().unresolvableMember.signal(member.toString(), getSourceLocation());
return false;
}
+ if (kind == Member.ADVICE) return true;
+
if (!modifiers.matches(sig.getModifiers())) return false;
if (kind == Member.STATIC_INITIALIZATION) {