aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/pointcutParameter/Driver.java
blob: 7dc1c6194faa140f6d92f0b82cb2ea54ae6c10eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import org.aspectj.testing.Tester;

// PR#290 compiler crashes with eachobject and named pointcuts with parameters

public class Driver {

    public static String s = "";
    
    public static void main(String[] args){
        new C().go();
        Tester.checkEqual(s, "-before-go", "");
    }
   
}

class C {
    int x;
    
    public void go() {
        Driver.s += "-go";
    }
}

aspect A /*of eachobject(A.testPointcut(C))*/ {
    pointcut testPointcut(C c): target(c);

    before(C c): target(c) && call(* *(..)) {
	    Driver.s += "-before";
    }
}