Skip to content

Commit c4d63af

Browse files
committed
Merge pull request #1946 from ustcweizhou/pagesizeIs0
CLOUDSTACK-9788: Fix exception listNetworks with pagesize=0 * pr/1946: CLOUDSTACK-9788: Fix exception listNetworks with pagesize=0 Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2 parents c6f0ba7 + c883e29 commit c4d63af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/src/main/java/com/cloud/utils/StringUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ public static String mapToString(final Map<String, String> map) {
296296
public static <T> List<T> applyPagination(final List<T> originalList, final Long startIndex, final Long pageSizeVal) {
297297
// Most likely pageSize will never exceed int value, and we need integer to partition the listToReturn
298298
final boolean applyPagination = startIndex != null && pageSizeVal != null
299-
&& startIndex <= Integer.MAX_VALUE && startIndex >= Integer.MIN_VALUE && pageSizeVal <= Integer.MAX_VALUE
300-
&& pageSizeVal >= Integer.MIN_VALUE;
299+
&& startIndex <= Integer.MAX_VALUE && startIndex >= 0 && pageSizeVal <= Integer.MAX_VALUE
300+
&& pageSizeVal > 0;
301301
List<T> listWPagination = null;
302302
if (applyPagination) {
303303
listWPagination = new ArrayList<>();

0 commit comments

Comments
 (0)