aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/HandlerSignature.java
blob: 8c65486a3c453a945998133ccf4fb900ed15c908 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import org.aspectj.testing.Tester;
import java.util.*;

/** @testcase PR#883 Getting signature from handler join point */
public class HandlerSignature {

    public static void main(String[] args) {
        C c = new C();
        U.ee("caught");
        try {
            c.run();
        } catch (Error e) {
            U.e("caught");
        }
        Tester.checkAllEvents();
    }
    static {
        // U.ee("X");
    }
}

class C {
    public void run() {
        throw new Error("");
    }
}

class U {
    static void e(String event) {
        System.err.println(event);
        Tester.event(event);
    }
    static void ee(String event) {
        Tester.expectEvent(event);
    }
}

aspect A {
    static {
        U.ee("before handler");
        //U.ee("after handler");
    }

    before() : handler(*) {
      thisJoinPoint.getSignature().getModifiers();   
      U.e("before handler");
    }
    /*
      after returning join points not implemented
    after() returning: handler(*) {
      thisJoinPoint.getSignature().getModifiers();   
      U.e("after handler");
    }
    */
}