yyqdbngt opened a new pull request, #2972:
URL: https://github.com/apache/rocketmq-dashboard/pull/2972

   ## Summary
   The in-memory paging default methods on the `InstanceProvider` SPI
   (`listTopicsPage`, `getTopicConsumersPage`, `listConsumerGroupsPage`) assumed
   their backing list calls return a non-null list and a positive page size:
   a null list NPE'd on `size()`, and a non-positive page size produced
   `to < from` so `subList(from, to)` threw IndexOutOfBoundsException. The
   defaults now null-coalesce the backing list to an empty list and clamp the
   page size to zero for the slice bound, matching the clamping
   `Pagination.pageOffset` already applies.
   
   ## Why
   These defaults are the SPI contract every provider inherits; the current
   Apache path happens to validate page/pageSize upstream, but any provider or
   future caller that does not should get an empty page, not a 500.
   
   ## Testing
   ```
   cd server && mvn -Dtest="InstanceProviderTest" test
   ```
   Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
   New regression tests: `listTopicsPageShouldTolerateNullTopicListTest`,
   `listConsumerGroupsPageShouldTolerateNullGroupListTest` (null backing lists
   yield empty pages instead of NPE) and
   `getTopicConsumersPageShouldTolerateNonPositivePageSizeTest` (negative page
   size yields an empty slice with the real total instead of IOWBE).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to