[ISSUE #10546] Add default implementation for rejectRequest() in NettyRequestProcessor#10547
Conversation
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Converts boolean rejectRequest() to a default method in NettyRequestProcessor interface and removes 26 redundant return false overrides across broker processors, reducing ~128 lines of boilerplate.
Findings
- [Info]
NettyRequestProcessor.java:29— Clean use of Java 8 default methods. Project targets Java 11, fully compatible. - [Info] 26 processor classes had their
return falseoverrides removed. Verified thatSendMessageProcessorandPullMessageProcessor(which contain actual rejection logic) are not modified — their overrides are preserved. - [Info]
AbstractSendMessageProcessor.javais correctly included (it had areturn falseoverride), whileSendMessageProcessor(its subclass with real logic) is correctly excluded. - [Info] Test class
RemotingServerTest.javaanonymous inner class override also removed — consistent with the interface change.
Assessment
This is a semantically equivalent refactoring with zero behavioral change:
- All removed overrides returned
false, matching the new default - No public API changes
- No thread-safety or concurrency implications
- Backward compatible with all existing callers
Clean and well-scoped. 👍
Automated review by github-manager-bot
565a7f6 to
c88fdbc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #10547 +/- ##
=============================================
- Coverage 48.27% 48.20% -0.07%
+ Complexity 13435 13415 -20
=============================================
Files 1377 1378 +1
Lines 100844 100822 -22
Branches 13036 13036
=============================================
- Hits 48678 48601 -77
- Misses 46217 46264 +47
- Partials 5949 5957 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5450816 to
c88fdbc
Compare
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot (Re-review after new commit c88fdbc)
Summary
New commit confirmed — all redundant rejectRequest() overrides have been removed consistently across all NettyRequestProcessor implementations (Broker, NameServer, Proxy modules). The interface now provides the default implementation.
Assessment
- [Correctness] Clean refactoring. The
default boolean rejectRequest() { return false; }in the interface is semantically identical to the removed overrides. No behavioral change. - [Compatibility] Backward-compatible. Any external implementations that relied on the abstract method will now get the default. This is a safe change.
- [Tests]
RemotingServerTestupdated to verify the default behavior. Good.
LGTM — all core CI checks pass. Nice cleanup of boilerplate code. 👍
Automated by github-manager-bot
Which Issue(s) This PR Fixes
Fixes #10546
Brief Description
The
rejectRequest()method inNettyRequestProcessorinterface requires every implementation to provide an override, yet 20+ implementations across the codebase simplyreturn false, with onlySendMessageProcessorandPullMessageProcessorcontaining actual logic.This PR converts
boolean rejectRequest()todefault boolean rejectRequest() { return false; }and removes all redundantreturn falseoverrides, reducing ~128 lines of boilerplate code.How Did You Test This Change?
Existing unit tests remain unchanged and should all pass. This is a pure refactoring with no behavioral change.