summaryrefslogtreecommitdiffstats
path: root/tests/new/adviceOnStaticMeth/Driver.java
blob: 629fd776d31f3d811c18f3245c023b5bf50a2593 (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
import org.aspectj.testing.Tester;

// PR#221

public class Driver {
    public static String s = "s";
    
    public static void main(String[] args) { test(); }

    public static void test() {
        Tester.checkEqual(doIt(), s, "advice worked"); 
    }
    
    public static String doIt() {
        return s;
    }
}

aspect Outer {
    pointcut staticMeth(): within(Driver) && execution(String doIt());

    /*static*/ before(): staticMeth() {
        Driver.s += ":a";
    }    

}