[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Capture args with withincode and call
- From: "bora.erbas" <bora.erbas@xxxxxxxxx>
- Date: Tue, 13 Feb 2007 06:34:46 -0800 (PST)
- Delivered-to: email@example.com
Exactly, this has to be done using cflow.
Thanks a lot.
Eric Bodden-2 wrote:
> You cannot do this with withincode because withincode is a pure
> lexical pointcut. It defines a region of code, no event, and a region
> of code can expose no arguments. But you can use cflow(call(*
> C.method1(A, B)) && args (c,d)). Note that the args is *within* the
> brackets of the cflow pointcut.
> On 2/13/07, bora.erbas <bora.erbas@xxxxxxxxx> wrote:
>> 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
>> 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)
>> 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?
>> View this message in context:
>> Sent from the AspectJ - users mailing list archive at Nabble.com.
>> aspectj-users mailing list
> Eric Bodden
> Sable Research Group
> McGill University, MontrÃal, Canada
> aspectj-users mailing list
View this message in context: http://www.nabble.com/Capture-args-with-withincode-and-call-tf3220219.html#a8945304
Sent from the AspectJ - users mailing list archive at Nabble.com.