-
Notifications
You must be signed in to change notification settings - Fork 643
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
"Refactor to use getOrDefault method for default values #59" #1815
base: master
Are you sure you want to change the base?
Conversation
ignoreBuild = config.containsKey("ignoreBuild") ? Boolean.parseBoolean(config.get("ignoreBuilder")) : false; | ||
basedir = config.getOrDefault("basedir", "src/main/docker"); | ||
composeFile = config.getOrDefault("composeFile", "docker-compose.yml"); | ||
ignoreBuild = Boolean.parseBoolean(config.getOrDefault("ignoreBuild", "false")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation slightly off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I'll fix the indentation and push again
…alues and fixed the indentation
…alues and fixed the indentation issue:fabric8io#1814
I am really sorry about the indentation I've made necessary changes and raised another PR kindly let me know if you want any other modifications, Thank you |
Quality Gate passedIssues Measures |
@Er-Sadiq : polite ping, are you still working on this? |
@rohanKanojia Hi , I've made necessary changes and updated the PR I am not sure went wrong then |
@Er-Sadiq : my comment still doesn't seem to be addressed #1815 (comment) I could be wrong here, perhaps you forgot to push changes? |
@rohanKanojia no I did push in fact i merged it in the previous pr itself but then some tests are failing for macos i guess |
@rohanKanojia kindly let me know how do you want me to fix it as of now |
@Er-Sadiq : These failures are not related to your changes. Please take a look at the changes in your branch (I'm only asking to fix the indentation): |
@rohanKanojia I am so sorry you were right ,I forgot to update the branch :{ sorry |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1815 +/- ##
============================================
+ Coverage 65.87% 66.27% +0.40%
- Complexity 2306 2346 +40
============================================
Files 172 174 +2
Lines 10194 10342 +148
Branches 1408 1431 +23
============================================
+ Hits 6715 6854 +139
- Misses 2926 2928 +2
- Partials 553 560 +7
|
Quality Gate passedIssues Measures |
Fix #1814
This pull request refactors the DockerComposeConfiguration constructor to use Java's built-in getOrDefault method available on the Map interface for assigning default values. This change enhances code readability and simplifies the logic for default value assignment.
Changes Made
Replaced the usage of ternary operators with getOrDefault for retrieving configuration values from the config map.
Updated the assignment of basedir, composeFile, and ignoreBuild fields to use getOrDefault.