Skip to content

Converters added directly to the bean factory's conversion service are not used for property binding when @ConfigurationPropertiesBinding bean is defined #26089

@philwebb

Description

@philwebb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions