【发布时间】:2017-03-29 17:49:45
【问题描述】:
我在为具有多个参数的方法创建 before 方面时遇到了一些问题。
public class Sample {
public boolean myCall(String s, String s1, String s3, ByteBuffer bytes, int i, int g) {
System.out.println("Calling real sample");
}
}
这方面不匹配。我只需要在覆盖代码中使用 ByteBuffer 参数即可。
pointcut sampleCall(ByteBuffer bytes) :
execution(boolean com.example.Sample.myCall (..)) && args(bytes);
before(ByteBuffer bytes) : sampleCall(bytes) {
System.out.println("Before sample");
}
【问题讨论】: