CLOUDSTACK-9788: Fix exception listNetworks with pagesize=0

This commit is contained in:
Wei Zhou 2017-02-16 12:01:44 +01:00
parent 6dced70aa8
commit c883e294d3
1 changed files with 2 additions and 2 deletions

View File

@ -296,8 +296,8 @@ public class StringUtils {
public static <T> List<T> applyPagination(final List<T> originalList, final Long startIndex, final Long pageSizeVal) {
// Most likely pageSize will never exceed int value, and we need integer to partition the listToReturn
final boolean applyPagination = startIndex != null && pageSizeVal != null
&& startIndex <= Integer.MAX_VALUE && startIndex >= Integer.MIN_VALUE && pageSizeVal <= Integer.MAX_VALUE
&& pageSizeVal >= Integer.MIN_VALUE;
&& startIndex <= Integer.MAX_VALUE && startIndex >= 0 && pageSizeVal <= Integer.MAX_VALUE
&& pageSizeVal > 0;
List<T> listWPagination = null;
if (applyPagination) {
listWPagination = new ArrayList<>();