Skip to content

Validator resolution can no longer be lazy #31137

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
wilkinsona opened this issue Aug 30, 2023 · 0 comments
Closed

Validator resolution can no longer be lazy #31137

wilkinsona opened this issue Aug 30, 2023 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@wilkinsona
Copy link
Member

Affects: 6.1.0-SNAPSHOT

#28990 added support for configuring MethodValidationPostProcessor with a Supplier<Validator> that would then be used to resolve the Validator lazily. This laziness appears to have been lost as get() is called on the Supplier during afterPropertiesSet() processing. The problem becomes apparent when upgrading Spring Boot to 6.1.0-SNAPSHOT as methodValidationPostProcessorValidatorDependencyDoesNotTriggerEarlyInitialization in ValidationAutoConfigurationTests fails.

The regression can be worked around by reverting spring-projects/spring-boot@639f980 but it leaves setValidationProvider without a purpose. We'd also prefer not to have to use a lazy proxy in Boot.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 30, 2023
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Sep 1, 2023
@jhoeller jhoeller added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 2, 2023
@jhoeller jhoeller added this to the 6.1.0-RC1 milestone Sep 2, 2023
@jhoeller jhoeller self-assigned this Sep 2, 2023
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: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants