Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] What does "no suitable guard" mean?

It means AspectJ is unable to make the 'lazy tjp' optimization because
you haven't put a guard on the advice that makes it possible (with a
suitable 'guard' - something like an if() pcd in your pointcut, we can
build the thisJoinPoint object conditionally on the advice executing -
if you have no guard then we always build the thisJoinPoint object). 
The default setting for the options relating to this optimization are
'ignore' so I assume you are turning on the lint warnings for your
projects? (or do we have a bug where this isnt off by default?)

If you don't care, turn off the lint options for:

canNotImplementLazyTjp = ignore

If you do guard the advice correctly (if it makes sense for your
advice), your code may well run faster because we don't always spend
time constructing thisJoinPoint.


On 23/04/06, Moritz Post <moritzpost@xxxxxx> wrote:
> Hello
> I can't answer that question. But I do have the same problem/warning on my
> aspects advice:
> "can not build thisJoinPoint lazily for this advice since it has no suitable
> guard."
> This happens when I insert the JoinPoint object into a method on my aspectj5
> method.
> Greets
> Moritz Post
> > I get a lot of warnings about "no suitable guard for lazy instantiation".
> >
> > What exactly does this mean?  Is there anything I should do
> > (including, turning off the warning)?
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx

Back to the top