Validator resolution can no longer be lazy #31137
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Affects: 6.1.0-SNAPSHOT
#28990 added support for configuring
MethodValidationPostProcessor
with aSupplier<Validator>
that would then be used to resolve theValidator
lazily. This laziness appears to have been lost asget()
is called on theSupplier
duringafterPropertiesSet()
processing. The problem becomes apparent when upgrading Spring Boot to 6.1.0-SNAPSHOT asmethodValidationPostProcessorValidatorDependencyDoesNotTriggerEarlyInitialization
inValidationAutoConfigurationTests
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.The text was updated successfully, but these errors were encountered: