You could use an lint option to turn that off. See
https://www.baeldung.com/aspectj where he uses:
<Xlint>ignore</Xlint>
Andy
On Fri, 26 Oct 2018 at 01:08, Mikael Petterson <[email protected]>
wrote:
> Hi Andy!
>
> I managed to solve the test compilation problem for my aspect using
> stackoverflow 😊
>
> Now when I compile I see the following warning:
>
> [WARNING] can not build thisJoinPoint lazily for this advice since it
> has no suitable guard [Xlint:noGuardForLazyTjp]
>
> /repo/eraonel/git/java-runtime-stats/target/classes!com/ericsson/commonlibrary/javaruntimestats/aspects/DeprecatedMethodsAspect.class:34
>
>
>
> What do I need to do to get rid of the warning?
>
>
> br,
>
>
> //mikael
>
>
> This is my aspect:
>
>
> public aspect DeprecatedMethodsAspect {
>
> private DeprecatedMethods deprecatedMethods = new
> DeprecatedMethodsImpl();
>
> //Pointcuts to match joinpoint.
> pointcut deprecated() :
> @annotation(Deprecated) && (call(public * *(..)) ||
> call(*.new(..)));
>
> pointcut beta() :
> @annotation(com.google.common.annotations.Beta);
>
> pointcut deprecatedMethods() :
> deprecated() && !beta();
>
>
> before() : deprecatedMethods() { //This is the line that compiler
> warns for.
> deprecatedMethods.collect(thisJoinPoint);
> }
>
> @VisibleForTesting
> public void setDeprecatedMethods(DeprecatedMethods deprecatedMethods) {
> this.deprecatedMethods = deprecatedMethods;
> }
>
>
>
> }
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://www.eclipse.org/mailman/listinfo/aspectj-users