You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/22 08:01:04 UTC

[GitHub] [cloudstack] shwstppr commented on a change in pull request #5231: api: Fix pagination for list PublicIPAddresses

shwstppr commented on a change in pull request #5231:
URL: https://github.com/apache/cloudstack/pull/5231#discussion_r674580201



##########
File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
##########
@@ -2197,7 +2197,11 @@ private void abstractDataStoreClustersList(List<StoragePool> storagePools, List<
             sc2.setParameters("ids", freeAddrIds.toArray());
             addrs.addAll(_publicIpAddressDao.search(sc2, searchFilter)); // Allocated + Free
         }
-
+        List<? extends IpAddress> wPagination = com.cloud.utils.StringUtils.applyPagination(addrs, cmd.getStartIndex(), cmd.getPageSizeVal());
+        if (wPagination != null) {
+            Pair<List<? extends IpAddress>, Integer> listWPagination = new Pair<List<? extends IpAddress>, Integer>(wPagination, addrs.size());
+            return listWPagination;

Review comment:
       ```suggestion
               return new Pair<>(wPagination, addrs.size());
   ```
   shorter




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org