You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converters added directly to the bean factory's conversion service are not used for property binding when @ConfigurationPropertiesBinding bean is defined
#26089
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.
Currently If @ConfigurationPropertiesBinding beans are detected then a new ConverterService is created for use with the binder. This means that any converters added to the BeanFactory converter service will not apply. We mostly got away with this in 2.4 because ApplicationConverterService.getSharedInstance() was used with both the BeanFactory and the Binder. In addition it used to be possible to modify the shared instance which means the bug would only appear if @ConfigurationPropertiesBinding beans were used and if the BeanFactory conversion service has been customized (see this part of the code).
Although this bug is present in 2.4.x, I think we should only apply the fix in 2.5.0. It's requires some quite invasive changes.
It's also more critical in 2.5 since #26088 will change the shared instance to be unmodifiable.
See #24891 for an example of this bug manifesting itself with Spring Security.
The text was updated successfully, but these errors were encountered:
wilkinsona
changed the title
Allow @ConfigurationPropertiesBinding converts to be combined with a customized BeanFactory ConversionService
Converters added directly to the bean factory's conversion service are not used for property binding when @ConfigurationPropertiesBinding bean is defined
Apr 14, 2021
Currently If
@ConfigurationPropertiesBinding
beans are detected then a newConverterService
is created for use with the binder. This means that any converters added to theBeanFactory
converter service will not apply. We mostly got away with this in 2.4 becauseApplicationConverterService.getSharedInstance()
was used with both theBeanFactory
and theBinder
. In addition it used to be possible to modify the shared instance which means the bug would only appear if@ConfigurationPropertiesBinding
beans were used and if theBeanFactory
conversion service has been customized (see this part of the code).Although this bug is present in 2.4.x, I think we should only apply the fix in 2.5.0. It's requires some quite invasive changes.
It's also more critical in 2.5 since #26088 will change the shared instance to be unmodifiable.
See #24891 for an example of this bug manifesting itself with Spring Security.
The text was updated successfully, but these errors were encountered: