Skip to main content

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

aspect a {
   pointcut a2CalledFromA1():
    call(void A.a2()) && withincode(void A.a1());
}

Andy.

2008/5/12 Marko Asplund <marko.asplund@xxxxxxxxxx>:
> Hi,
>
>  How can I pick out direct calls to a certain method from a particular
>  method?
>  For example how can I define a pointcut that picks out calls to a2()
>  from a1() in class A below?
>
>  I've tried the following pointcut definition but it doesn't seem to work
>  as expected:
>
>  aspect a {
>   pointcut a2CalledFromA1():
>     execution(void A.a1()) && call(void A.a2());
>  }
>
>
>  class A {
>   void a1() {
>     a2();
>   }
>
>   void a2() {
>   }
>
>  }
>
>
>
>  _______________________________________________
>  aspectj-users mailing list
>  aspectj-users@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-users
>

Back to the top