Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] if and loop pointcuts

At the time we designed the language, we could think of no compelling
use cases for pointcuts related to if and do. So we didn't spend any
time thinking about them.

Since then I've heard a couple of examples of when these might be useful,
most having to do with coverage problems.

I'm starting to think something like this could be added to the language
and prove useful. But I don't see it yet.  One problem is designing the
pointcuts to be stable. Unstable pointcuts are those that are defined in
terms that are vulnerable to small seemingly unrelated changes to the program.
The classic example is the line number pointcut, that says something like when
executing expressions or statements at this line number. 

Could you give an example of the kind of pointcut and advice you would like 
to write?


> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx 
> [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Diana 
> Szentivanyi
> Sent: Tuesday, August 12, 2003 6:53 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] if and loop pointcuts
> 
> 
> 		Hello!
> 		
>   Is there any way to express in AspectJ the fact that the 
> control flow is 
> inside an if statement or a loop (while, for) statement?
>   
>   I am thinking here about the possibility to detect when a 
> field is accessed 
> (read or written) inside an if (or loop) statement:
>   
>   For example, to define a pointcut:
>   
>   pointcut access_a_inside_if(): (get(int a) || set(int a)) && 
> cflow(if_statement);
>   
>   
>       Thank you for any help,
>       
>          Regards,
>            Diana.
>   		
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 




Back to the top