Skip to content
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

Should any accomodation be made for trimming trailing whitespace in config sources like properties files? #672

Open
scottkurz opened this issue Feb 1, 2021 · 1 comment
Milestone

Comments

@scottkurz
Copy link

Description

With Java source of:

@Inject
@ConfigProperty(name = "flag")
private boolean flag;

and an entry with a trailing space in src/main/resources/META-INF/microprofile-config.properties like:

flag=true<space>

I was surprised to see the boolean false value injected, .. until I noticed the space.

Though I can appreciate how this could be considered user error, since in general, IIUC, trailing whitespace is significant when loading properties files in Java, it still seemed worth raising in case anyone had any opinion that this should be treated specially in MP Config, for this particular source or perhaps other sources too?

(I did open an issue on the tooling project here to display a warning:
eclipse/lsp4mp#128 (comment) )

Versions:

MP Config v1.4
v20.0.0.12 - Open Liberty

@Emily-Jiang
Copy link
Member

I think both preceeding space and tailing spaces can be trimed.

@radcortez radcortez added this to the MP Config 2.1 milestone Mar 4, 2021
@Emily-Jiang Emily-Jiang modified the milestones: MP Config 3.x, Config 4.0 Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants