I don’t honestly know about Spring AOP and using if() like that. From the documentation:
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html#aop-pointcuts-designators <http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html#aop-pointcuts-designators> That lists the supported designators and if() is not on the list I’m afraid. Could be worth asking on stack overflow about how to achieve what you want in Spring AOP. cheers, Andy > On Sep 19, 2016, at 6:42 AM, Mohan Radhakrishnan > <[email protected]> wrote: > > Hi, > This should be supported. Isn't it. I use Spring Tool Suite and > @EnableAspectJAutoProxy > > Thanks, > Mohan > > @Pointcut("execution(* > com.pearson.nextgen.enterprise.service.CourseService.getCoursesByInstitutionId(String)) > && if()") > public static boolean courseSearch() { > return Boolean.getBoolean( mockOrNot.get() ); > } > > > Caused by: org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: > Point > cut expression 'execution(* > com.pearson.nextgen.enterprise.service.CourseService > .getCoursesByInstitutionId(String)) && if()' contains unsupported pointcut > primi > tive 'if' > at > org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi > tives(PointcutParser.java:435) > at > org.aspectj.weaver.tools.PointcutParser.validateAgainstSupportedPrimi > tives(PointcutParser.java:413) > at > org.aspectj.weaver.tools.PointcutParser.resolvePointcutExpression(Poi > ntcutParser.java:311) > at > org.aspectj.weaver.reflect.InternalUseOnlyPointcutParser.resolvePoint > cutExpression(InternalUseOnlyPointcutParser.java:36) > at > org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate > .getDeclaredPointcuts(Java15ReflectionBasedReferenceTypeDelegate.java:307) > at > org.aspectj.weaver.ReferenceType.getDeclaredPointcuts(ReferenceType.j > ava:884) > _______________________________________________ > aspectj-users mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe from > this list, visit > https://dev.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://dev.eclipse.org/mailman/listinfo/aspectj-users
