[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] create pointcuts to external library code

Hi all

Let's assume that Java JRE would contain these two classes

package java.foo.moo;

class Foo1{
    public void method1(Foo2 obj){
        obj.method2();
    }
}

package java.foo.moo;
class Foo2{
    public void method2(Foo2 obj){
        System.out.println("capture this");
    }
}

How can I match to the method2 call (let's assume that method2 is only invoked from Foo1)
neither of this works:


pointcut foo1() : execution(public void java.foo.moo.Foo2.method2(Foo2));
pointcut foo2() : call(public void java.foo.moo.Foo2.method2(Foo2));

I assume the trick why it does not work is because neither the invocation point nor the declaration of the method is in the code defined by me.

Thanks Denes