Removed useless hardcoded Strings in EnvUtils.#4007
Merged
kezhenxu94 merged 3 commits intoapolloconfig:masterfrom Sep 29, 2021
Merged
Removed useless hardcoded Strings in EnvUtils.#4007kezhenxu94 merged 3 commits intoapolloconfig:masterfrom
EnvUtils.#4007kezhenxu94 merged 3 commits intoapolloconfig:masterfrom
Conversation
The previous code used a switch statement that did nothing more than just checking if a given name mathces a hardcoded string. The same functionality can be implemented with a Java native functionality that is way faster and easier to read.
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
|
recheck |
kezhenxu94
reviewed
Sep 29, 2021
kezhenxu94
reviewed
Sep 29, 2021
kezhenxu94
approved these changes
Sep 29, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous code used a switch statement that did nothing more than
just checking if a given name matches a hardcoded string. The same
functionality can be implemented with a Java native functionality that
is way faster and easier to read.
What's the purpose of this PR
Improve the functionality and readability of an Utility class inside the core package. Additionally I added more test cases to improve coverage and make sure the previous code works as intended.
Which issue(s) this PR fixes:
NONE
Brief changelog
Improvement of the an utility class
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean testto make sure this pull request doesn't break anything.CHANGESlog.