public class MyClass {
public void myMethod(String a, String b, String c, String d, String e, String f) {
return true;
}
}
public aspect MyAspect {
pointcut myPointcut(String a, String b, String c, String d, String e, String f):
execution (public void myMethod(String, String, String, String, String, String)) &&
target(MyClass) &&
args(a, b, c, d, e, f);
after(String a, String b, String c, String d, String e, String f) : myPointcut(a, b, c, d, e, f) {
// I only need parameter "b"
}
}
我有什么方法可以只将 arg 传递String b
给我的建议,因为我在这里不需要其他的?
我尝试了以下方法:
pointcut myPointcut(String b):
execution (public void myMethod(String, String, String, String, String, String)) &&
target(MyClass) &&
args(b);
after(String b) : myPointcut(b) {
// I only need parameter "b"
}
但我收到以下警告:
advice defined in MyAspect has not been applied [Xlint:adviceDidNotMatch]