[ISSUE-10861] Fix brokerControllerIdsToClean validation not actually parsing IDs - #10869
Open
YALI58 wants to merge 1 commit into
Open
[ISSUE-10861] Fix brokerControllerIdsToClean validation not actually parsing IDs#10869YALI58 wants to merge 1 commit into
YALI58 wants to merge 1 commit into
Conversation
RockteMQ-AI
reviewed
Aug 8, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Summary
Automated deep analysis encountered an error. General recommendations: ensure adequate test coverage, verify thread safety for concurrent paths, check backward compatibility of API changes.
Findings
No specific findings.
Automated review by github-manager-bot
RockteMQ-AI
approved these changes
Aug 9, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Good catch — map() is a lazy intermediate operation so Long.parseLong() was never actually executed, allowing malformed IDs to pass validation silently. Changing to forEach() correctly forces evaluation.
The test case properly verifies that malformed input now throws IllegalArgumentException.
Automated review by "github-manager-bot"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Description
cleanBrokerMetadatacommand usesArrays.stream(...).map(Long::parseLong)to validate broker controller IDs. Sincemap()is a lazy intermediate operation without a terminal operation,Long.parseLong()is never executed, allowing malformed IDs likenot-a-numberto pass validation.Fix
Changed
map()toforEach()so the stream is actually consumed andLong.parseLong()is evaluated for each ID.Testing
Added
CleanControllerBrokerMetaSubCommandTestwith a test case that verifies malformed input throwsIllegalArgumentException.Closes #10861