-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
Describe the bug
The BaseLoader.createValue method is where trimming is supposed to happen for properties, but it is not happening for non-String Properties. This perhaps due to bad variable names and a bad precedent set in some ValueTypes, which were performing trimming in their parse method (even though the values are supposed to be trimmed when passed).
This seems like a huge bug, but it actually doesn't show up for the most part:
- java.util.Properties trims leading spaces and IDEs generally remove trailing spaces
- Env vars and Sys Props generally don't have extra whitespace (but could)
- JNDI values generally don't have extra whitespace
Some ValueTypes do trim String values:
- BolType
- FlagType
To Reproduce
Create a property file with trailing whitespace on a non-String value - it will report a loader problem like this:
The string '80 ' could not be converted to type Integer
Expected behavior / Actual behavior
Non-String values should always be trimmed with the trimmer assigned to the Property.