summaryrefslogtreecommitdiffstats
path: root/tests/new/NoCalledMethodName.java
blob: 6b5bf8117b4febb149a35eb8389a606c4938cd48 (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
import org.aspectj.testing.*;

/*
 * Advice is not getting the calledMethodName.
 */

public class NoCalledMethodName {
    public static void main(String[] args) {
        new NoCalledMethodName().go(args);
    }

    void go(String[] args) {
        Tester.check("Go was called");
    }
}

aspect NoCalledMethodNameAspect of eachobject(instanceof(NoCalledMethodName)) {

    pointcut p2(NoCalledMethodName f): receptions(void go(..)) && instanceof(f);
    
    around(NoCalledMethodName f) returns void: p2(f) {
        String s = thisJoinPoint.methodName;
    }
}