Skip to content
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

SpringFactoriesLoader should tolerate whitespace [SPR-17413] #21946

spring-issuemaster opened this issue Oct 19, 2018 · 1 comment

SpringFactoriesLoader should tolerate whitespace [SPR-17413] #21946

spring-issuemaster opened this issue Oct 19, 2018 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Oct 19, 2018

Philipp Foermer opened SPR-17413 and commented

The original issue was raised at spring-projects/spring-boot#14903 for Spring Boot 1.5.13.RELEASE, but mentioned, that the issue must be created for springframework.

Provided a custom auto configuration definition in META-INF/spring.factories of the following form for Spring Boot:
"org.springframework.boot.autoconfigure.EnableAutoConfiguration=FQNClassA, FQNClassB".

Spring failed to load the configuration class " FQNClassB", because no whitespace trimming was done.

Proposed improvement:
As a java identifier can not have got any whitespace in it, whitespace trimming should be applied for a class token by SpringFactoriesLoader.
In my opinion this would make a definition more robust, as whitespace mistakes are harder to review and this might be an unexpected behaviour from user perspective as whitespace is expected to be ignored.

Affects: 4.3.17

Referenced from: commits dd2ce20, 1107963, 46bc145

Backported to: 5.0.11, 4.3.21

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Oct 22, 2018

Juergen Hoeller commented

Like in other configuration places, we leniently handle whitespace around such class names in spring.factories entries now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.