fix: resolve SonarCloud issue in App.java #2865#3236
Conversation
PR SummaryThis PR resolves a SonarCloud issue in Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
✅ LGTM!
Review Summary
Files Processed (1)
- dirty-flag/src/main/java/com/iluwatar/dirtyflag/App.java (1 hunk)
Actionable Comments (0)
Skipped Comments (1)
-
dirty-flag/src/main/java/com/iluwatar/dirtyflag/App.java [76-77]
enhancement: "Remove sleep for production."
|
Hi @iluwatar, |
There was a problem hiding this comment.
✅ LGTM!
Review Summary
Commits Considered (1)
- a8bffc1: Merge branch 'master' into fix/sonar-high-issue-dirty-flag-app
Files Processed (0)
Actionable Comments (0)
Skipped Comments (0)
|
|
Looks good! Thank you for the contribution 🎉 @all-contributors please add @2897robo for code |
|
I've put up a pull request to add @2897robo! 🎉 |



What does this PR do?
This PR resolves a high severity issue (java:S2095) reported by SonarCloud in
App.java.The issue was that
ScheduledExecutorServicewas not properly closed, potentially leading to resource leakage.🔗 SonarCloud issue: https://sonarcloud.io/project/issues?id=iluwatar_java-design-patterns&open=AZXOQp-k7L73unJ7u3kj
What did I do?
ScheduledExecutorServicewithtry-finallyto ensure proper shutdownThread.sleep(45000)for demonstration purposes to allow task completion before shutdownReferences
Fixes #2865