DATACMNS-377 - Prevent page sizes less than one.

PageRequest now actively prevents page sizes less than one. PageableHandlerMethodArgumentResolver falls back to default page size if it detects a page size less than one. It also rejects invalid default configuration using @PageableDefault.
This commit is contained in:
Oliver Gierke
2013-10-07 10:47:25 +02:00
parent 59e9af4950
commit 93b2d39cf1
4 changed files with 67 additions and 8 deletions

View File

@@ -68,8 +68,8 @@ public class PageRequest implements Pageable, Serializable {
throw new IllegalArgumentException("Page index must not be less than zero!");
}
if (size < 0) {
throw new IllegalArgumentException("Page size must not be less than zero!");
if (size < 1) {
throw new IllegalArgumentException("Page size must not be less than one!");
}
this.page = page;