Ported bug fix for Hades #425 - PageRequest should reject 0 page size.

Applied patch provided by Stevo Slavic, thanks!
This commit is contained in:
Oliver Gierke
2011-01-21 02:01:46 +01:00
parent 2f11dd80fd
commit bd68d421da
2 changed files with 8 additions and 1 deletions

View File

@@ -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!");
}

View File

@@ -43,6 +43,13 @@ public class PageRequestUnitTests {
}
@Test(expected = IllegalArgumentException.class)
public void preventsZeroSize() {
new PageRequest(0, 0);
}
@Test
public void equalsRegardsSortCorrectly() {