Regarding the current Reference Documentation, the Declaring a Pointcut page contains two sections. The first is the Combining Pointcut Expressions where the following appears:
package com.xyz;
@Aspect
public class Pointcuts {
@Pointcut("execution(public * *(..))")
public void publicMethod() {}
@Pointcut("within(com.xyz.trading..*)")
public void inTrading() {}
@Pointcut("publicMethod() && inTrading()")
public void tradingOperation() {}
}
And the Sharing Named Pointcut Definitions section where the following appears:
package com.xyz;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class CommonPointcuts {
/**
* A join point is in the web layer if the method is defined
* in a type in the com.xyz.web package or any sub-package
* under that.
*/
@Pointcut("within(com.xyz.web..*)")
public void inWebLayer() {}
....
}
The point is that @Aspect
is unnecessary when the class only declares methods with @Pointcut
.
Comment From: sbrannen
Good catch!
This has been addressed for inclusion in 6.0.11.
Comment From: manueljordan
Thank You ... here always to share my 2 cents - In Spring We Trust!