Given these pointcuts taken from the following resource:
http://maverick-amey.blogspot.ru/2007/12/using-cflow-and-cflowbelow-in-pointcuts.html
pointcut methodCalls() :
call(public void Foo.*(..)) ;
pointcut methodCallFromWebTier() :
methodCalls() && cflow(call(* com.webtier.*+.*(..)));
The methodCallFromWebTier
pointcut is supposed to match all the calls made to any public method of the Foo
class with any arguments which returns void provided that (the && operator) the call is inside the control flow of any call made to a method of:
- Any class (and its subclasses) in the com.webtier package;
- Any abstract class (its subclasses) in the com.webtier package;
- Any interface implementation in the com.webtier package of any interface in the com.webtier package;
Now, if the pointcut would have been this instead:
pointcut methodCallFromWebTier() :
methodCalls() && cflow(call(* com.webtier.*.*(..)));
Therefore without the + subtype TypePattern operator, would the pointcut be the same? I mean, it still matches everything (any class, abstract class subclass, interface implementation) provided that this everything is inside the com.webtier package, so I don't really see the usage for the + sign here...
Am I wrong? Are there some edge cases that perhaps I don't see?
Is the plus sign really necessary in this example?
Thanks for the attention!