Spring AOP Unsupported Pointcut

ID

java.spring_aop_unsupported_pointcut

Severity

low

Remediation Complexity

trivial

Remediation Risk

low

Remediation Effort

low

Resource

Reliability

Language

Java

Tags

best-practice, spring

Description

Reports AspectJ pointcut designators that are not supported by Spring AOP. Spring AOP is a proxy-based framework that supports only a subset of AspectJ designators: execution, within, this, target, args, @target, @args, @within, @annotation, and bean. Unsupported designators such as call, get, set, handler, etc. either fail silently or throw an exception at startup.

Rationale

Reliability — Using an unsupported designator causes an UnsupportedPointcutPrimitiveException at application startup, or the advice is silently never triggered.

Remediation

Non-compliant code

@Pointcut("call(* com.example.*.*(..))")
public void unsupported() {}

Compliant code

@Pointcut("execution(* com.example.*.*(..))")
public void supported() {}