Skip to content

Commit 8f4ddc1

Browse files
committed
Clarify Javadoc for FallbackPageable in PageableHandlerMethodArgumentResolverSupport.
Closes #2551
1 parent 92d8de0 commit 8f4ddc1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ public abstract class PageableHandlerMethodArgumentResolverSupport {
6060
private boolean oneIndexedParameters = false;
6161

6262
/**
63-
* Configures the {@link Pageable} to be used as fallback in case no {@link PageableDefault} or
64-
* {@link PageableDefault} (the latter only supported in legacy mode) can be found at the method parameter to be
65-
* resolved.
63+
* Configures the {@link Pageable} to be used as fallback in case no {@link PageableDefault} can be found at the
64+
* method parameter to be resolved.
6665
* <p>
67-
* If you set this to {@literal Optional#empty()}, be aware that you controller methods will get {@literal null}
68-
* handed into them in case no {@link Pageable} data can be found in the request. Note, that doing so will require you
69-
* supply bot the page <em>and</em> the size parameter with the requests as there will be no default for any of the
70-
* parameters available.
66+
* If you set this to {@literal Pageable#unpaged()}, be aware that your controller methods will get an {@code unpaged}
67+
* instance handed into them in case no {@link Pageable} data can be found in the request.
7168
*
7269
* @param fallbackPageable the {@link Pageable} to be used as general fallback.
7370
*/
@@ -251,7 +248,7 @@ private Pageable getDefaultFromAnnotationOrFallback(MethodParameter methodParame
251248

252249
private static Pageable getDefaultPageRequestFrom(MethodParameter parameter, PageableDefault defaults) {
253250

254-
Integer defaultPageNumber = defaults.page();
251+
int defaultPageNumber = defaults.page();
255252
Integer defaultPageSize = getSpecificPropertyOrDefaultFromValue(defaults, "size");
256253

257254
if (defaultPageSize < 1) {

0 commit comments

Comments
 (0)