Repository navigation
Add ParseUtil decode methods and forbid direct JDK parse/decode calls - #3437
Conversation
Add decodeIntOrDefault and decodeLongOrDefault to ParseUtil, wrapping Integer.decode/Long.decode with null/exception safety and a default value. Forbid direct use of Integer.parseUnsignedInt, Long.parseUnsignedLong, Integer.decode, and Long.decode via forbidden-apis config, enforcing that all parsing goes through ParseUtil's safe wrappers. Refactor existing callers: - FreeBsdCentralProcessor: Long.decode/Integer.decode → ParseUtil - AbstractCentralProcessorTest: Long.parseUnsignedLong → ParseUtil - ParseUtilTest: Integer.parseUnsignedInt → ParseUtil
|
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 (6)
📜 Recent review details⏰ Context from checks skipped due to timeout. (10)
🧰 Additional context used🧠 Learnings (3)📚 Learning: 2026-04-12T19:22:09.716ZApplied to files:
📚 Learning: 2026-07-06T19:25:59.225ZApplied to files:
📚 Learning: 2026-04-12T19:34:56.879ZApplied to files:
🔇 Additional comments (7)
📝 WalkthroughWalkthroughAdds ChangesSafe Decoding Utilities and Adoption
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3437 +/- ##
============================================
- Coverage 75.20% 75.13% -0.08%
Complexity 76 76
============================================
Files 580 580
Lines 21609 21617 +8
Branches 3588 3588
============================================
- Hits 16252 16242 -10
- Misses 3329 3340 +11
- Partials 2028 2035 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
ParseUtil.decodeIntOrDefault(String, int)andParseUtil.decodeLongOrDefault(String, long)— safe wrappers aroundInteger.decode/Long.decodewith null handling and default valuesInteger.parseUnsignedInt,Long.parseUnsignedLong,Integer.decode, andLong.decodeviaconfig/forbidden-apis.txt, enforcing that all number parsing goes throughParseUtil's safe wrappersParseUtilmethodsTest plan
decodeIntOrDefault(hex, decimal, octal, null, invalid)decodeLongOrDefault(same cases)forbiddenapis:checkpasses across all modulesinstallpasses (all existing tests green)Summary by CodeRabbit
New Features
Bug Fixes
Tests