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>
This commit is contained in:
Rajani Karuturi 2017-02-28 05:35:51 +05:30
commit c4d63af149
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<>();