From 585049b66c7068d609055a138f2eac2de6769fbc Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Tue, 21 Feb 2023 14:12:55 +0100 Subject: [PATCH] Avoid obsolete inspection of DefaultedPageable. The instance can never be null and thus we don't actually have to check for that. --- .../data/rest/webmvc/RepositoryEntityController.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java index 8ece7e8d5..8535e46dc 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java @@ -198,10 +198,7 @@ class RepositoryEntityController extends AbstractRepositoryRestController implem throw new ResourceNotFoundException(); } - Iterable results = pageable.getPageable() != null // - ? invoker.invokeFindAll(pageable.getPageable()) // - : invoker.invokeFindAll(sort); - + Iterable results = invoker.invokeFindAll(pageable.getPageable()); ResourceMetadata metadata = resourceInformation.getResourceMetadata(); Optional baseLink = Optional.of(getDefaultSelfLink());