Skip to content

Respect PaginationHandler.handle() stop signal in ResultUtils.processClassNames#3224

Open
vasiliy-mikhailov wants to merge 1 commit into
alibaba:masterfrom
vasiliy-mikhailov:fix/resultutils-respect-handler-stop
Open

Respect PaginationHandler.handle() stop signal in ResultUtils.processClassNames#3224
vasiliy-mikhailov wants to merge 1 commit into
alibaba:masterfrom
vasiliy-mikhailov:fix/resultutils-respect-handler-stop

Conversation

@vasiliy-mikhailov

@vasiliy-mikhailov vasiliy-mikhailov commented Jun 25, 2026

Copy link
Copy Markdown

ResultUtils.processClassNames ignores the boolean returned by PaginationHandler.handle(...). The handler's own Javadoc documents the contract:

@return  true 继续处理剩余数据, false 终止处理

(true = keep processing the remaining data, false = stop). Because the return value is discarded, a handler that returns false to stop early still receives every remaining segment.

This guards the in-loop call so that a false return ends processing. Adds a regression test (ResultUtilsTest.testHandleReturnFalseStopsProcessing) that fails before the change — the handler returning false is still invoked for all 3 segments (expected:<1> but was:<3>) — and passes after.

AI assistance disclosure

This contribution was produced with the help of an AI pipeline. The pipeline processed a large amount of source code to surface suspected bugs, reproduced a subset of them with failing unit tests and generated candidate fixes, and prepared pull requests from the ones that held up. Each PR was then reviewed and verified by a human before being opened: the fix and test were checked by hand and the test was confirmed to fail before the change and pass after.

…ClassNames

PaginationHandler.handle() documents its boolean return as: true keep processing, false stop. processClassNames ignored it, so a handler returning false still received every remaining segment. Guard the in-loop call so a false return ends processing. Adds a regression test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant