File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
main/java/org/springframework/data/domain
test/java/org/springframework/data/domain Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 24
24
*
25
25
* @author Thomas Darimont
26
26
* @author Oliver Gierke
27
+ * @author Alex Bondarev
27
28
*/
28
29
public abstract class AbstractPageRequest implements Pageable , Serializable {
29
30
@@ -74,7 +75,7 @@ public int getPageNumber() {
74
75
* @see org.springframework.data.domain.Pageable#getOffset()
75
76
*/
76
77
public long getOffset () {
77
- return page * size ;
78
+ return ( long ) page * ( long ) size ;
78
79
}
79
80
80
81
/*
Original file line number Diff line number Diff line change 22
22
23
23
/**
24
24
* @author Thomas Darimont
25
+ * @author Alex Bondarev
25
26
*/
26
27
public abstract class AbstractPageRequestUnitTests {
27
28
@@ -75,4 +76,12 @@ public void equalsHonoursPageAndSize() {
75
76
public void preventsPageSizeLessThanOne () {
76
77
newPageRequest (0 , 0 );
77
78
}
79
+
80
+ @ Test
81
+ public void getOffsetShouldNotCauseOverflow () {
82
+
83
+ AbstractPageRequest request = newPageRequest (Integer .MAX_VALUE , Integer .MAX_VALUE );
84
+
85
+ assertThat (request .getOffset ()).isGreaterThan (Integer .MAX_VALUE );
86
+ }
78
87
}
You can’t perform that action at this time.
0 commit comments