| Re: [aspectj-users] If pointcut and side effects |
| Interesting. It would certainly feel more intuitive if pointcuts were evaluated in order relative to the advice they're associated with. Of course, evaluation must if needed happen at the join point - the problem is when there are multiple advice at the same join point. It can't all happen at the same time. Btw, this issue doesn't stop with the if, but goes for other dynamic checks as well, e.g. when around advice changes the arguments to the join point, which apparently impacts the args pointcut of a lower-precedence advice. This example is constructed; I don't know if things like this are likely to happen in real programs: public class C1 { public static void main(String... args) { C1 c1 = new C1(); c1.m(c1); } public void m(C1 c) { System.out.println("m"); } } public class C2 extends C1 {} public aspect A { void around(C1 c1) : call(void m(..)) && args(c1) { System.out.println("around in"); proceed(new C2()); System.out.println("around out"); } before() : call(void m(..)) && args(C2) { System.out.println("before"); } } around in before m around out Jon On Jun 22, 2006, at 10:58 AM, Wes wrote:
|