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

Sample template generation creates templates that set values #615

Closed
eeverman opened this issue Sep 22, 2021 · 1 comment
Closed

Sample template generation creates templates that set values #615

eeverman opened this issue Sep 22, 2021 · 1 comment
Assignees
Milestone

Comments

@eeverman
Copy link
Owner

eeverman commented Sep 22, 2021

Describe the bug
The andhow.properties file template that is generate creates unexpected values for Properties that don't have defaults. For instance, this is a sample output for a StrProp value that doesn't have a default:

org.yarnandtail.andhow.load.std.StdJndiLoader.CONFIG.ADDED_JNDI_ROOTS = [String]

If someone used this auto-generated template and didn't edit this line, the value would be set to [String]. This is not the intention.

To Reproduce
Either force template generation or fail a startup.

Expected behavior / Actual behavior
The template should be usable as generated without side-effects. Its OK to write in default values, since this will have no effect. However, if the property [Type] is written into values that have no default, the user may not notice that the template has values set and get unintended values.

The type is already listed - AndHow should just leave the entries empty, which would be interpreted as not set.
For JNDI sample entries, it probably just needs to comment out the xml that actually sets the value.

Implementation note: I've decided to not have any value writing in properties files, even if there is a default (just leave the value portion empty always).

Environment (please complete the following information):
All

@eeverman
Copy link
Owner Author

Fixed by #619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant