package a;
Class X
public fX(int i, String s);
package b;
Class Y
public fY(String arg1, String arg2, int arg3){
...
ClassX.fX(1,"testY");
}
Class Z
public fZ(int n, int m){
ClassX.fX(2,"testZ");
}
I need such a pointcut and advice that it will point to immediately after calling the ClassX.fX (1, ββ"testY") method and give me access to ClassY.fY (String arg1, String arg2, int arg3) function call arguments (for example , arg1, arg2 and arg3) at the same time,
I tried this one but it did not work.
pointcut ParameterPointCut(String arg1, String arg2, int arg3) :
withincode (public String ClassY.fY(String,String,int))&&
call(public String ClassX.fX(int, String)) &&
args(arg1,arg2,arg3);
after(String arg1, String arg2, int arg3): ParameterPointCut(arg1,arg2,arg3){
System.out.println("arg1 =" + arg1);
}
What will be the pointcut and advice changes to accept these values ββin the right place?
Thanks in advance.
source
share