From d0283bf177b1c9997a005f4db90ff7c228244e77 Mon Sep 17 00:00:00 2001 From: tigger <25095994+yangjiacheng@users.noreply.github.com> Date: Fri, 1 Jun 2018 16:05:55 +0800 Subject: [PATCH] =?UTF-8?q?DATAREST-296=20-=20ResourceMetadataHandlerMetho?= =?UTF-8?q?dArgumentResolver=20now=20properly=20implements=20=E2=80=A6.sup?= =?UTF-8?q?ports(=E2=80=A6).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ResourceMetadataHandlerMethodArgumentResolver.supports(…) now properly checks for ResourceMetadata. It previously checked for RepositoryInformation which is probably a left-over from a previous state of the codebase and has been unnoticed so far as the class is only used as a direct dependency of other HandlerMethodArgumentResolvers. --- .../config/ResourceMetadataHandlerMethodArgumentResolver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java index 30eddd777..feef191f4 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/ResourceMetadataHandlerMethodArgumentResolver.java @@ -19,7 +19,6 @@ import static org.springframework.util.ClassUtils.*; import static org.springframework.util.StringUtils.*; import org.springframework.core.MethodParameter; -import org.springframework.data.repository.core.RepositoryInformation; import org.springframework.data.repository.support.Repositories; import org.springframework.data.rest.core.mapping.ResourceMappings; import org.springframework.data.rest.core.mapping.ResourceMetadata; @@ -36,6 +35,7 @@ import org.springframework.web.method.support.ModelAndViewContainer; * * @author Jon Brisbin * @author Oliver Gierke + * @author jiacheng Yang */ public class ResourceMetadataHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { @@ -69,7 +69,7 @@ public class ResourceMetadataHandlerMethodArgumentResolver implements HandlerMet */ @Override public boolean supportsParameter(MethodParameter parameter) { - return isAssignable(parameter.getParameterType(), RepositoryInformation.class); + return isAssignable(parameter.getParameterType(), ResourceMetadata.class); } /*