Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17413

SpringFactoriesLoader should tolerate whitespace

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.17
    • Fix Version/s: 4.3.21, 5.0.11, 5.1.2
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      The original issue was raised at https://github.com/spring-projects/spring-boot/issues/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.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            pfoermer Philipp Foermer
            Last updater:
            Spring Issuemaster
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 36 weeks, 5 days ago