Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Infinite advice call problem

Hi Erik!

On Tuesday 07 January 2003 18:09, hilsdale@xxxxxxxx wrote:
> but this won't work either.  You're working with constructor
> _executions_, which occur within the constructor (think of
> them being "callee-side").

Thanks, I guess I have been looking at my code too long to see this.

> 1. Change to constructor call join points, and filter out
>    the offending calling points with within. 

This is what I wanted. 

> 2. Use cflow to stomp on even indirect recursion
>
>     after(MemoryFault mf):
>             target(mf) &&
>             execution(MemoryFault.new(..)) &&
>             ! cflowbelow(call(Object MemoryFault.clone())
>                          && within(Constructor)) {
>        MemoryFault other = (MemoryFault) mf.clone();
>     }

How does this  ! cflowbelow work, why do you group the "call" and 
"within" under cflowbelow? Is that a control flow where a call to clone 
was made within the Constructor aspect?
Does this depend on whether I write call first or within first, i.e. is 
the above equal to
	! cflowbelow(within(Constructor) && call(Object MemoryFault.clone()))
Can this also be written as 
	!cflowbelow(call(Object MemoryFault.clone())) &&
	!cflowbelow(within(Constructor))
(I remember some warning that the !, && and || are not really boolean 
operators / logic)?

>     Note that I've stomped on the indirect recursion rather
>     specifically, picking out exactly one call in the world.
>     In the future, if you use AspectJ 1.1, you might use the
>     new adviceexecution pointcut to pick out all advice
>     executions from the Constructor aspect (This doesn't
>     work in 1.1b2 because of a bug that's being fixed):

Ah, nice idea.

> Let me know if this doens't answer your question,

Yes, it does; thanks a lot.

Robert


Back to the top