-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
The property values read from traditional application.properties configuration files are not trimmed. This can lead to undesired/strange behaviours at runtime:
- @ConditionalOnProperty annotation perform a simple equals between the expected and received value (without type conversion). A property value set to
'true '(notice the space at the end) is likely to fail the condition - developers must/should trim the injected string values themselves
Not trimming values out of properties files is error prone (you can't blame a user if they forgot a blank at the end of the line - they don't see it). It may be acceptable for XML files however: value is between start/end markers so the blank is visible.
Proposition is to update the PropertiesPropertySourceLoader so it automatically trims values read from .properties files.
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply