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

Avoid early getMostSpecificMethod resolution in CommonAnnotationBeanPostProcessor #31967

Closed
jhoeller opened this issue Jan 7, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

jhoeller commented Jan 7, 2024

In the course of #21843, it turns out that CommonAnnotationBeanPostProcessor uses an inverted loop where ClassUtils.getMostSpecificMethod is called at the outer level before actually finding an annotation, whereas AutowiredAnnotationBeanPostProcessor only calls ClassUtils.getMostSpecificMethod for actually annotated methods. Aligning CABPP with AABPP in that respect can avoid significant overhead on startup.

@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jan 7, 2024
@jhoeller jhoeller added this to the 6.1.3 milestone Jan 7, 2024
@jhoeller jhoeller self-assigned this Jan 7, 2024
@jhoeller jhoeller added the for: backport-to-6.0.x Marks an issue as a candidate for backport to 6.0.x label Jan 7, 2024
@github-actions github-actions bot added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-6.0.x Marks an issue as a candidate for backport to 6.0.x labels Jan 7, 2024
@jhoeller jhoeller added the for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x label Jan 7, 2024
@github-actions github-actions bot removed the for: backport-to-5.3.x Marks an issue as a candidate for backport to 5.3.x label Jan 7, 2024
jhoeller added a commit that referenced this issue Jan 7, 2024
This is aligned with AutowiredAnnotationBeanPostProcessor now.

Closes gh-31967

(cherry picked from commit 9912a52)
jhoeller added a commit that referenced this issue Jan 7, 2024
This is aligned with AutowiredAnnotationBeanPostProcessor now.

Closes gh-31967

(cherry picked from commit 9912a52)
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) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant