And if you want to detect myMethod() on A and all its subclasses, overridden or 
not, use this:

execution(* mypackage.A+.myMethod())
--
Alexander Kriegisch


Am 07.12.2012 um 22:48 schrieb Andy Clement <[email protected]>:

> Yep that is normal behaviour. The joinpoint for the method is only 
> mypackage.A.myMethod()
> 
> If you wanted to detect myMethod() running on a B, use this:
> 
> execution(* myMethod()) && this(mypackage.B)
> 
> 
> 
> On 7 December 2012 07:42, <[email protected]> wrote:
> hello,
> just a question about methods implemented in Abstract Classes :
> 
> package mypackage;
> public abstract class A {
>         public void myMethod() { System .out.println("myMethod in Abstract
> Class");
>         }
> }
> 
> package mypackage;
> public class B extends A {
> }
> 
> 
> package mypackage;
>         public class Main {
>         public static void main(String[] args) {
>                 B b=new B();
>                 b.myMethod();
>         }
> }
> 
> the aspect with this pointcut below doesn't weave :
> 
> public final pointcut methods(): execution( * mypackage.B.myMethod());
> after methods() {
> System.out.println("does-it weave ?");
> }
> 
> the pointcut : execution( * mypackage.A.myMethod()); correctly weaves.
> 
> Is it the normal behaviour ?
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to