Repository navigation
fix(settings): return defaults after repairing malformed settings (#481) - #487
jvondermarck merged 4 commits into
Conversation
loadSettings() deleted a bad settings.properties file and reloaded it, but dropped the recursive result and returned null. Return the repaired defaults instead. Fixes jvondermarck#481
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
👋 Hello @AzazelSensei, thank you for submitting in Dinosaur Exploder 🦖 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with the repository
/dinosaur-explodermainbranch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pullandgit merge masterlocally. - ✅ Verify all Dinosaur Exploder Continuous Integration (CI) checks are passing.
- ✅ Verify that you have well fill out the different checkboxes in the PR template.
⚠️ Check that your code is clean: no code redundancy, variable and method names are correct, your code is understandable to everyone, and so on.- 💡 Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee
✅ Code Formatting Check Passed!Great job! 🎉 Your code follows the Google Java Style Guide. 🤖 The DinoBot Team 🦖 |
Build preview 🚀Thanks for your contribution to this open-source project! ❤️ A new build has been generated for this pull request:
Tip This JAR lets you test the latest version of the game from this PR. ⏳ Note: Artifacts auto-expire after ~90 days. Happy testing & enjoy the game! 🎮 The DinoBot Team 🦖 |
jvondermarck
left a comment
There was a problem hiding this comment.
Looks good for me, thanks for the unit test!
Just please read my comment and if you have time and want, feel free to improve the whole file according to what I said. Thanks :)
Read, parse, and restore-defaults each live in their own method so the two nested try/catch blocks are gone.
|
Hey @AzazelSensei thanks for your update. I will merge once these Sonar issues are fixed: https://sonarcloud.io/project/issues?id=jvondermarck_dinosaur-exploder&pullRequest=487&s=IMPACT_RANK&sinceLeakPeriod=true&issueStatuses=OPEN%2CCONFIRMED |
readSettingsFile no longer returns null when the file is missing or unreadable. Sonar java:S1168 flagged both paths.
|
Fixed the two Sonar S1168 findings. readSettingsFile now returns an empty Properties instead of null when the file is missing or unreadable. |
|
Uh shit I merged another PR in the meantime and the guy changed this file, could you please |
Keep the malformed-settings fix and pick up updateMuteState from jvondermarck#489.
|
Merged main into this branch. Kept the malformed-settings fix and brought in updateMuteState from the other PR. |
|
|
Amazing, you rock! @AzazelSensei Thanks !! Please make sure to "Star" the project and if you have any ideas on new features on the game or whatever, please create new issues. goal here is to not let the project die |



✅ PR Checklist
type(scope): description (#issue)(scope and #issue optional)type: feat, fix, refactor, docs, test, chore📝 What does this PR do?
SettingsProvider.loadSettings()when a stored value is invalid, instead of falling through tonull.soundVolume=not-a-numberand checks the first call comes back with defaults and a valid file.🔗 Related Issue
📸 Screenshots / Demos (if applicable)
Note
🦖 No screenshots or demo provided.
💬 Extra Notes (Optional)
I ran
mvn -B -Dtest=SettingsProviderTest teston the malformed file from the issue. It failed on main and passed on this branch.