aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/JoinPointFields.java
blob: 14cb0bd2c7a36affb96068a4c01d0b301f0a9f41 (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.Tester;

import org.aspectj.lang.reflect.*;

public class JoinPointFields {
    public static void main(String[] args) {
        Tester.checkEqual(new JoinPointFields().foo("xxx-"), "xxx-arg", "parameterNames");
    }

    public String foo(String arg) {
        return arg;
    }
}

aspect A {
    String around(String arg):
        this(JoinPointFields) &&
        execution(String foo(String)) &&
        args(arg)
        {
            return arg + (((MethodSignature)thisJoinPoint.getSignature()).
                          getParameterNames())[0];
        }
}