I am using AspectJ in my Spring boot project for AOP.
I have declared a if() point cut:
public class myPointCuts {
// a global boolean variable, value can be updated at runtime.
public static boolean IS_RESULT_FINE;
@Pointcut("if()")
public static boolean isResultFine() {
return IS_RESULT_FINE;
}
}
At compile time, I get error:
Initialization of bean failed;
nested exception is org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: Pointcut expression 'if()' contains unsupported pointcut primitive 'if'
My declared dependencies:
implementation 'org.springframework:spring-aop:5.0.1.RELEASE'
implementation 'org.aspectj:aspectjweaver:1.9.4'
What is wrong with my if()
point cut expression ?