Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] can not build thisJoinPoint lazily for this advice since it has no suitable guard

Are you turning up all lint messages to error? Since noGuardForLazyTjp is not an error by default.

The message is telling you that thisJoinPoint arguments are expensive to build and your pointcuts have no conditional components (like an if clause) that could be woven into the code to avoid always building them.  In many cases you don’t care but if building a highly performance use case you might care - hence it is a configurable lint message that you can turn between ignore/warning/error depending on how much you care in your scenario. For your ‘test aspect’ (which I presume that is) you probably don’t care. But I don’t know who is turning it up to error level.

Andy

On Sep 25, 2015, at 2:29 AM, xeonmailinglist <xeonmailinglist@xxxxxxxxx> wrote:

Hi,

In this code of AspectJ [1], when I try to compile the code I get the following error related to thisJoinPoint. What is the purpose of this error? What should I do to correct this?

[1] Example of aspects

aspect Foo {
  before(): execution(* map(..)) {
     System.out.println(thisJoinPoint);
  }
  before(): execution(* reduce(..)) {
     System.out.println(thisJoinPoint);
  }
  before(): execution(* cleanup(..)) {
     System.out.println(thisJoinPoint);
  }

}

[2] Compilation error

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.7:compile (default) on project medusa-java: AJC compiler errors:
[ERROR] error at before(): execution(* cleanup(..)) {
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] /home/xeon/repositories/git/medusa-java/src/main/java/org/apache/hadoop/mapred/aspects/MapReduceCalls.aj:27:0::0 can not build thisJoinPoint lazily for this advice since it has no suitable guard [Xlint:noGuardForLazyTjp]

Cheers,

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top