import-bot (20212) [Avatar] Offline
#1
[Originally posted 11/29/03 by aop]

Hi Ramnivas:
In your Book,you give a pointcut example to catch nonrecursive call:
pointcut factorialOperation(int n) :
call(long *.factorial(int)) && args(n);
pointcut topLevelFactorialOperation(int n) :
factorialOperation(n)
&& !cflowbelow(factorialOperation(int));

----
This pointcut depend on factorial implementation(recursive),so if I change recursive to loop latter,it will make no sense.
If you expect factorial be recursive,then any method can be recursive,and any method pointcut should be wrote like this.
Regards
aop
import-bot (20212) [Avatar] Offline
#2
Re: pointcut catch nonrecursive call
[Originally posted 12/1/03 by ramnivas]

Hello,

If you change the factorial() to use a nonrecursive implementation, you wouldn't need to capture top-level operations using cflowbelow(). This is because the top-level operation would just be the call to the factorial method. However, the topLevelFactorialOperations() pointcut as defined will still work as expected. It is just that it will work harder than it needs to!

-Ramnivas