aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/PR590a.java
blob: e7e8d3a85c2fcc79224472a6f96c77ec63f8c7ed (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
32
33
34
35
36
37
import org.aspectj.testing.Tester;

public class PR590a {
    public static void main (String args []) {
        staticMethod ();
        new PR590a().instanceMethod("bar");
    }

    public static String staticMethod () {
        return null;
    }

    public String instanceMethod(String a) {
        return "foo";
    }
} 

aspect A {
    static Object fieldX = Boolean.TRUE;
    //static Object Integer = Boolean.TRUE;  // just to screw with you

    pointcut pc(Object s): call(!static String PR590a.*(..)) && args(s);

    before(): target(Byte) { } //sanity check
    //before(): target(BlurghXXX) { } //sanity check, warning in -Xlint



    after () returning (Object s): pc(s) {} //ERR CE 29

    after () throwing (Object e): pc(e) {} //ERR CE 31

    // before(): target(fieldX) { } //ERR, but not handled yet

    //before(): target(Integer) { } //ERR -- finds field rather than type, but not handled yet
}