Skip to content

SpringFactoriesLoader should tolerate whitespace [SPR-17413] #21946

Closed
@spring-projects-issues

Description

@spring-projects-issues

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.

Scenario:
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".

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 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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions