Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
manueljordan opened this issue Jul 1, 2023 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@manueljordan
Copy link

manueljordan commented Jul 1, 2023

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 1, 2023
@sbrannen sbrannen changed the title Documentation: Remove @Aspect for classes containing only @Pointcut declarations Remove @Aspect for classes containing only @Pointcut declarations in reference documentation Jul 1, 2023
@sbrannen sbrannen added type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) labels Jul 1, 2023
@sbrannen sbrannen self-assigned this Jul 1, 2023
@sbrannen sbrannen removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 1, 2023
@sbrannen sbrannen added this to the 6.0.11 milestone Jul 1, 2023
@sbrannen
Copy link
Member

sbrannen commented Jul 1, 2023

Good catch!

This has been addressed for inclusion in 6.0.11.

@manueljordan
Copy link
Author

Thank You ... here always to share my 2 cents - In Spring We Trust!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants