Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Capture args with withincode and call

I felt like I should add some more details.
This is the problem I need to solve:
In a specific (private static) method call of a class (e.g. X.m1) I need to
list all the calls which has a target class of some type (e.g. Y).
But at the same time I need to capture the arguments to X.m1(arg1, arg2) as
well. But when capturing the arguments for the X.m1 the captured calls to
class Y are also confined to the calls with the same type/order of the
arguments of X.m1. So I want to list all calls to the methods of class Y
with any arguments. Is this possible using AspectJ constructs?

pointcut withinPrivateBaseMethod(ArgClass a, ArgClass b) :
   withincode(private static Z X.m1(ArgClass, ArgClass)) &&
   args(a, b);

pointcut allCallsToYFromPrivateBaseMethod(ArgClass a, ArgClass b) :
   withinPrivateBaseMethod(a, b) &&
   call(* Y.*(..));


So this has the problem I mentioned above.
Any ideas?
Cheers.
-- 
View this message in context: http://www.nabble.com/Capture-args-with-withincode-and-call-tf3220219.html#a8943569
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top