Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] a newbie question

> I am wondering why a method call does not generate a join point 
> when it appears in an "if" pcd. 

This has been a long-known undocumented limitation that's now under 
official consideration:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=108962

The semantics appendix to the programming guide notes

  The order of evaluation for pointcut expression components at a join point 
  is undefined. Writing if pointcuts that have side-effects is considered 
  bad style and may also lead to potentially confusing or even changing 
  behavior with regard to when or if the test code will run

One problem with permitting join points in if-PCD's is whether it will 
constrain other implementations unnecessarily. However, there has always
been a strong belief that any code under the control of the implementation
should give rise to join points, so the aspects can enforce the
guarantees they make.

Feel free to continue the discussion in the bug.

Thanks,
Wes

------------Original Message------------
From: "Jie Ouyang" <ouyang.jie@xxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Date: Fri, Mar-31-2006 1:53 PM
Subject: [aspectj-users] a newbie question
I am wondering why a method call does not generate a join point when it appears in an "if" pcd. For example we have a method member
int foo(){return ...} of class A and an "if" pcd if(a.foo()<100). The call of foo in the pcd is not catched by call(int A.foo()). Are there any documents stating the reason of this design? Thanks.



Jie _______________________________________________ 
aspectj-users mailing list 
aspectj-users@xxxxxxxxxxx 
https://dev.eclipse.org/mailman/listinfo/aspectj-users 



Back to the top