Ported bug fix for Hades #425 - PageRequest should reject 0 page size.
Applied patch provided by Stevo Slavic, thanks!
This commit is contained in:
@@ -72,7 +72,7 @@ public class PageRequest implements Pageable {
|
||||
"Page index must not be less than zero!");
|
||||
}
|
||||
|
||||
if (0 > size) {
|
||||
if (0 >= size) {
|
||||
throw new IllegalArgumentException(
|
||||
"Page size must not be less than or equal to zero!");
|
||||
}
|
||||
|
||||
@@ -43,6 +43,13 @@ public class PageRequestUnitTests {
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void preventsZeroSize() {
|
||||
|
||||
new PageRequest(0, 0);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void equalsRegardsSortCorrectly() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user