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

Lines in application.properties with just pound character (#) cause property on next line to be skipped #24341

Closed
johnprince opened this issue Dec 6, 2020 · 2 comments
Labels
status: duplicate A duplicate of another issue

Comments

@johnprince
Copy link

On upgrading to 2.4.0, lines in application.properties which only have the pound/hash character (#), without a trailing space or comment, cause the next line to be skipped, and so the property to be ignored. I typically use these lines to make the file more readable.

I couldn't find anything in the docs suggesting this was intentional, and it is not the standard behavior of java.util.Properties, so it was unexpected (for me, at least) and took some time to track down.

The problem seems to be in the CharacterReader of OriginTrackedPropertiesLoader, specifically in skipComment.

The workaround is simple enough, of course (just add a space or comment after the pound). But it seems unexpected enough to either be a bug, or to merit clear documentation.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 6, 2020
@markbigler
Copy link
Contributor

I think this issue has already been reported here: #24228.

@snicoll
Copy link
Member

snicoll commented Dec 6, 2020

That's right, closing as duplicate.

@snicoll snicoll closed this as completed Dec 6, 2020
@snicoll snicoll added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants