You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2017/02/28 00:20:43 UTC

[03/10] git commit: updated refs/heads/master to fa85151

CLOUDSTACK-9788: Fix exception listNetworks with pagesize=0


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c883e294
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c883e294
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c883e294

Branch: refs/heads/master
Commit: c883e294d36f64d09bed2f7e22086ab413f28d33
Parents: 6dced70
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Thu Feb 16 12:01:44 2017 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Thu Feb 16 14:08:21 2017 +0100

----------------------------------------------------------------------
 utils/src/main/java/com/cloud/utils/StringUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c883e294/utils/src/main/java/com/cloud/utils/StringUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/main/java/com/cloud/utils/StringUtils.java b/utils/src/main/java/com/cloud/utils/StringUtils.java
index 71cebe1..9554e87 100644
--- a/utils/src/main/java/com/cloud/utils/StringUtils.java
+++ b/utils/src/main/java/com/cloud/utils/StringUtils.java
@@ -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<>();