> In fact !publicCallsAndCallers(*) allows me to reuse pointcuts with
> parameters denied.
> However my first problem persists. Shouldn't "publicCallsAndCallers" be
> capturing all of the pointcuts in the first place?

Note that a pointcut this(foo) only matches if the executing object is of type 
Foo (assuming that foo is declared as type Foo). So this(..) does matching and 
binding both at the same time! (the same holds for target and args and for the 
variables bound by after-returning advice)

pointcut publicCallsAndCallers(Object caller): call(public * *.*.*(..)) && 
this(caller) && !within(Doubts);

This point cut matches whenever "this", i.e. the executing object (the actual 
runtime type, not the declared type) is of type Object. This is indeed always 
the case - with one exception: calls made from static methods, because there is 
no caller object and hence, this(Object) (which is the "matching part" of 
this(caller)) will not match.

Even if you use publicCallsAndCallers(*) you are just ignoring the variable 
binding, *not* the matching part. Hence, it will still match no static calls.

Cheers,
Eric

--
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada




_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to