Skip to content

ApplicationConversionService is not binary compatibility with 2.0.x #14938

@jpmsilva

Description

@jpmsilva

Starting with 2.1.0.M4, org.springframework.boot.convert.ApplicationConversionService.getSharedInstance() now returns an ApplicationConversionService instead of a ConversionService.

While ApplicationConversionService inherits from ConversionService, this does break binary compatibility according to Java rules.
This means that client code that called ApplicationConversionService.getSharedInstance() needs to be recompiled to work with Spring Boot 2.1, and will not be backward compatible with prior Spring Boot versions.

Currently this affects jasypt-spring-boot, as seen in ulisesbocchio/jasypt-spring-boot#102

While I understand that breaking changes must sometimes be introduced, I was wondering if there is a strong reason for this change, and if it might still be reversed if not?

I checked Spring Boot's code base, and it appears that only the following methods require that ApplicationConversionService.getSharedInstance() returns a ConfigurableConversionService (not an ApplicationConversionService).

The commit that introduces this change was 0c00508, with the comment

Update SpringApplication to automatically register the shared ApplicationConversionService instance with the BeanFactory and Environment.

Thanks in advance

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions