Thanks Andy,
Tested and running as I expected ;-)

Le 07/12/2012 22:48, Andy Clement a écrit :
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)

cheers,
Andy


On 7 December 2012 07:42, <[email protected] <mailto:[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 ?


    Cordialement / Best regards

    Jean-Louis Pasturel





    
_________________________________________________________________________________________________________________________

    Ce message et ses pieces jointes peuvent contenir des informations
    confidentielles ou privilegiees et ne doivent donc
    pas etre diffuses, exploites ou copies sans autorisation. Si vous
    avez recu ce message par erreur, veuillez le signaler
    a l'expediteur et le detruire ainsi que les pieces jointes. Les
    messages electroniques etant susceptibles d'alteration,
    France Telecom - Orange decline toute responsabilite si ce message
    a ete altere, deforme ou falsifie. Merci.

    This message and its attachments may contain confidential or
    privileged information that may be protected by law;
    they should not be distributed, used or copied without authorisation.
    If you have received this email in error, please notify the sender
    and delete this message and its attachments.
    As emails may be altered, France Telecom - Orange is not liable
    for messages that have been modified, changed or falsified.
    Thank you.

    _______________________________________________
    aspectj-users mailing list
    [email protected] <mailto:[email protected]>
    https://dev.eclipse.org/mailman/listinfo/aspectj-users




_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to