@@ -46,14 +46,18 @@ public void testToSelectOptions3() throws Exception {
4646 assertThat (SelectOptionsAccessor .getLimit (options ), is (5L ));
4747 }
4848
49- private static PageRequest pageRequest (int page , int size ) throws Exception {
50- try {
51- // Try PageRequest.of(int, int) added since Spring Data Commons 2.0
52- return (PageRequest ) PageRequest .class .getMethod ("of" , int .class , int .class ).invoke (null , page , size );
53- } catch (NoSuchMethodException e ) {
54- // If 'of' method is missing (In other words, Spring Data Commons version is less than 2.0),
55- // then it use constructor with two int arguments.
56- return PageRequest .class .getConstructor (int .class , int .class ).newInstance (page , size );
57- }
58- }
49+ private static PageRequest pageRequest (int page , int size ) throws Exception {
50+ try {
51+ // Try PageRequest.of(int, int) added since Spring Data Commons 2.0
52+ return (PageRequest ) PageRequest .class .getMethod ("of" , int .class , int .class )
53+ .invoke (null , page , size );
54+ }
55+ catch (NoSuchMethodException e ) {
56+ // If 'of' method is missing (In other words, Spring Data Commons version is
57+ // less than 2.0),
58+ // then it use constructor with two int arguments.
59+ return PageRequest .class .getConstructor (int .class , int .class ).newInstance (
60+ page , size );
61+ }
62+ }
5963}
0 commit comments