aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/staticMethAdv/Driver.java
blob: 9946c0f07f66495d0286950d2875d7109afb2d3f (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
import org.aspectj.testing.Tester;

// PR#151

public class Driver {
    public static void main(String[] args) { test(); }
    public static void test() {
        Tester.checkEqual(C.set(), "C-advised-set", "");
    }    
    
    static advice(C c): c && * *(..) {
        before {
            if (c != null) 
                Tester.check(false, "c == null");
            else 
    	        c.s += "-advised";
        }
    } 
}

class C {
    static String s = "C";
    
    static String set() {
        s += "-set";
        return s;
    }
}