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

fix/#407 the value in values.yml can be set to empty #409

Merged
merged 2 commits into from
Feb 28, 2019

Conversation

jiachen1120
Copy link
Contributor

Related issue: #407

Copy link
Contributor

@ddobrin ddobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I maybe suggest that we do not use a static variable for transferring data between methods?

The snippet:
...
// Throw exception when no parsing result found
if (value == null && !fileContainsKey) {
throw new ConfigException(
""${" + m.group(1) + "}" appears in config file cannot be expanded");
// Return directly when the parsing result don't need to be casted to String
...

can actually be moved into the getValue() method, if you wish to do so, and ascertain both the null value and the fileContainsKey boolean.

How does this sound?

…ariable for transferring data

- added test case
@jiachen1120
Copy link
Contributor Author

jiachen1120 commented Feb 26, 2019

@ddobrin Sounds great! 👍Thanks! I already changed to what you suggested. Also, a test case is added to test null value scenario.

@stevehu stevehu merged commit 2ec870e into develop Feb 28, 2019
@stevehu stevehu deleted the fix/#407-no-value branch February 28, 2019 14:04
younggwon1 pushed a commit to younggwon1/light-4j that referenced this pull request Feb 10, 2024
…knt#409)

* fix/networknt#407 the value in values.yml can be set to empty

* - moved some code block into the getValue() to prevent using static variable for transferring data
- added test case
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

Successfully merging this pull request may close these issues.

4 participants