Skip to content

META-INF/spring.factories: EnableAutoConfiguration should tolerate whitespace #14903

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

Closed
pfoermer opened this issue Oct 19, 2018 · 2 comments
Closed
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@pfoermer
Copy link

Used Spring Boot Version: 1.5.13.RELEASE

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

Problem:
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 in EnableAutoConfiguration key.
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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 19, 2018
@wilkinsona
Copy link
Member

Thanks for the report. The code that reads the class names from META-INF/spring.factories is in org.springframework.core.io.support.SpringFactoriesLoader which is part of Spring Framework. If you'd like to pursue this, please open a Spring Framework JIRA ticket.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 19, 2018
@pfoermer
Copy link
Author

@wilkinsona Thank you for the hints. Created https://jira.spring.io/browse/SPR-17413.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants