diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-02-16 17:45:52 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-02-17 09:43:54 +0100 |
commit | caf680a41651e04268b7bd1d26152d5428e574d9 (patch) | |
tree | 87ceea69b5cb80e48a9ce8d83b08fd29122abafc /sonar-plugin-api | |
parent | c00a059069b34fc14716a5fb40f6eaa5a2cddfe3 (diff) | |
download | sonarqube-caf680a41651e04268b7bd1d26152d5428e574d9.tar.gz sonarqube-caf680a41651e04268b7bd1d26152d5428e574d9.zip |
SONAR-8804 Use api/projects/search in projects admin page
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java index 4cc2da8bb21..2f650bffe61 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Paging.java @@ -19,6 +19,8 @@ */ package org.sonar.api.utils; +import static com.google.common.base.Preconditions.checkArgument; + /** * @since 3.6 */ @@ -29,16 +31,9 @@ public class Paging { private final int total; private Paging(int pageSize, int pageIndex, int total) { - if (pageSize < 1) { - throw new IllegalArgumentException("Page size must be strictly positive. Got " + pageSize); - } - if (pageIndex < 1) { - throw new IllegalArgumentException("Page index must be strictly positive. Got " + pageIndex); - } - if (total < 0) { - throw new IllegalArgumentException("Total items must be positive. Got " + total); - } - + checkArgument(pageSize >= 1, "Page size must be strictly positive. Got %s", pageSize); + checkArgument(pageIndex >= 1, "Page index must be strictly positive. Got %s", pageIndex); + checkArgument(total >= 0, "Total items must be positive. Got %s", total); this.pageSize = pageSize; this.pageIndex = pageIndex; this.total = total; |