Skip to content

Lazy Validator resolution in MethodValidationPostProcessor #28990

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

Closed
jhoeller opened this issue Aug 22, 2022 · 0 comments
Closed

Lazy Validator resolution in MethodValidationPostProcessor #28990

jhoeller opened this issue Aug 22, 2022 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

In the course of our implicit JDK proxy registration attempts in #28980, we got reminded that MethodValidationPostProcessor was used with lazy Validator initialization in Spring Boot: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.java#L72

Due to the lack of lazy initialization support in MethodValidationPostProcessor itself, Boot had to resort to @Lazy with creates a lazy resolution proxy for the Validator interface at dependency injection time. With explicit lazy resolution support through configuring an ObjectProvider<Validator> on MethodValidationPostProcessor, this should not be necessary and therefore not require a proxy hint anymore.

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: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant