[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Combining call and execution pointcuts

ïï
Gopinathan Balaji wrote:
ï> Try:
> 
> aspect a {
>  pointcut a2CalledFromA1():
>    cflow(execution(void A.a1())) && call(void A.a2());
>}

Thanks for the reply, Balaji.

Sorry, for not being complete enough with my sample code.
I'd like the pointcut to only pick out direct calls to a2() from a1(),
excluding any calls to a2() further down in a1()'s control flow.
The class actually looks more like this:

ïclass A {
  void a1() {
    a2(); // this should be picked out
    someMethodThatCallsA2FurtherDownTheCallChain(); // should exclude
calls to a2 from this and other control flows below a1
  }

  void a2() {
  }

}


marko