aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/NotAndPointcut.java
blob: 4dc0e48c92f430ca3712291b938b16e08a62c203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import org.aspectj.testing.Tester;

public class NotAndPointcut {
    static String str = "";

    public static void main(String args[]){
        new NotAndPointcut().showBug();
	Tester.checkEqual(str, "ran", "advice didn't run");
    }

    public void showBug(){
    }
}

aspect BugInPCD {
    pointcut p(): execution(* NotAndPointcut.showBug(..)) && 
	! ( target(NotAndPointcut) && call(* NotAndPointcut.*(..)));

    before(): p(){
	NotAndPointcut.str += "ran";
    }
}