Skip to content

Remove @Aspect for classes containing only @Pointcut declarations in reference documentation #30790

@manueljordan

Description

@manueljordan

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions