Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Singling out one function in the intersection of cflows


Marc-Andre,

Yes. Try this:

public aspect Aspect {

        before () : execution(void third()) && cflow(execution(void second())) && cflow(execution(void first())) {
                System.out.println("Aspect.before() " + thisJoinPoint);
        }
}

public class Test {

        public void first () {
                second();
        }
       
        public void second () {
                third();
        }
       
        public void third () {
                System.out.println("Test.third()");
        }
       
        public static void main(String[] args) {
                new Test().first();
                new Test().second();
                new Test().third();
        }

}

Aspect.before() execution(void test.Test.third())
Test.third()
Test.third()
Test.third()

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Marc-André Laverdière <mlaverd@xxxxxxxxxxx>
Sent by: aspectj-users-bounces@xxxxxxxxxxx

11/12/2006 21:58

Please respond to
m_laverd@xxxxxxxxxxxxxxxxxx; Please respond to
aspectj-users@xxxxxxxxxxx

To
<aspectj-users@xxxxxxxxxxx>
cc
Subject
[aspectj-users] Singling out one function in the intersection of        cflows





Hello,

I was wondering if I can extract a single function that would match cflow(a) && cflow(b).
My understanding is that they will 'return' sets of matching functions, but I need to extract only one point
in order to create a generic solution.

Any ways I can do that?

Thx,

MA




Be one of the first to try Windows Live Mail. Windows Live Mail._______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top