Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] execution Vs. call pointcut

Hello all,

I have two different aspect classes to count the number of non-static method calls for an execution of a test program. The first aspect class count methods on "call" join points:

pointcut methodCalls() : call (!static * test..*(..));
before(): methodCalls() {
counter.methodCallCounter();}

while the second aspect class count methods on "execution" join points:

pointcut methodCalls() : execution (!static * test..*(..));
before(): methodCalls() {
counter.methodCallCounter();}

methodCallCounter() is static method in counter class.

The number of method calls for small test program is the same. But when I change the test program with the larger program the number of method calls on the second aspect class (with execution pointcut) was more than the number of method calls on the aspect class with call pointcut. This is reasonable since the call join point does not pick out the calls made with super and therefore does not count them. 

However I encountered a case where for the specific execution of program the number non-static method calls on the aspect class with "call pointcut" was higher than the number of method calls on the aspect class with "execution pointcut". I can not find any interpretation why this is happening. Any idea about the reason of second situation is appreciated.

Thanks in advance,
Hossein    






Back to the top