Repository navigation
Apply ExceptionUtil to remaining FFM files - #3273
Conversation
Refactor 19 additional files in oshi-core-ffm to use ExceptionUtil static imports, eliminating catch(Throwable) boilerplate blocks. Total catch(Throwable) blocks eliminated across both PRs: ~98 (from 276 original down to 178 remaining). Files with complex patterns (non-final variable captures in lambdas, type inference issues with Optional returns, multi-statement catch blocks with error code checking) are left for follow-up work.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (19)
📝 WalkthroughWalkthroughThis PR systematically replaces manual try-catch exception handling with centralized ChangesException handling centralization via ExceptionUtil
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3273 +/- ##
============================================
+ Coverage 74.60% 74.65% +0.05%
Complexity 73 73
============================================
Files 407 407
Lines 16103 16090 -13
Branches 2554 2554
============================================
- Hits 12013 12012 -1
+ Misses 2607 2594 -13
- Partials 1483 1484 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Follow-up to #3272. Applies the
ExceptionUtilpattern to 19 additional files inoshi-core-ffm, eliminating ~98 total catch(Throwable) boilerplate blocks across both PRs.Changes
19 files refactored using static imports of
getOptionalInt,getOptional,getOptionalLong,getBooleanOrDefault,getIntOrDefault,getOrDefault,runSilently, andrunOrLog.Net: -112 lines (108 insertions, 220 deletions).
Remaining Work
178 catch(Throwable) blocks remain. These have patterns that don't mechanically convert:
Optional.empty()from multiple branches confuse type inferenceGetLastError, or have conditional logicThese can be addressed in future PRs with targeted manual refactoring.
Verification
Summary by CodeRabbit