diff --git a/spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java b/spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java index b6c3883fec..bd5ec1917e 100644 --- a/spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java +++ b/spring-web/src/main/java/org/springframework/web/method/HandlerMethod.java @@ -494,7 +494,7 @@ public class HandlerMethod { } } if (!existingType) { - merged.add(paramAnn); + merged.add(adaptAnnotation(paramAnn)); } } anns = merged.toArray(new Annotation[0]); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java index 3a278e231f..84fd0b1c40 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapterIntegrationTests.java @@ -411,9 +411,9 @@ public class RequestMappingHandlerAdapterIntegrationTests { private interface HandlerIfc { String handleInInterface( - @CookieValue("cookie") int cookie, - @PathVariable("pathvar") String pathvar, - @RequestHeader("header") String header, + @CookieValue("cookie") int cookieV, + @PathVariable("pathvar") String pathvarV, + @RequestHeader("header") String headerV, @RequestHeader(defaultValue = "#{systemProperties.systemHeader}") String systemHeader, @RequestHeader Map headerMap, @RequestParam("dateParam") Date dateParam, @@ -459,9 +459,9 @@ public class RequestMappingHandlerAdapterIntegrationTests { } public String handle( - @CookieValue("cookie") int cookie, - @PathVariable("pathvar") String pathvar, - @RequestHeader("header") String header, + @CookieValue("cookie") int cookieV, + @PathVariable("pathvar") String pathvarV, + @RequestHeader("header") String headerV, @RequestHeader(defaultValue = "#{systemProperties.systemHeader}") String systemHeader, @RequestHeader Map headerMap, @RequestParam("dateParam") Date dateParam, @@ -481,7 +481,7 @@ public class RequestMappingHandlerAdapterIntegrationTests { Model model, UriComponentsBuilder builder) { - model.addAttribute("cookie", cookie).addAttribute("pathvar", pathvar).addAttribute("header", header) + model.addAttribute("cookie", cookieV).addAttribute("pathvar", pathvarV).addAttribute("header", headerV) .addAttribute("systemHeader", systemHeader).addAttribute("headerMap", headerMap) .addAttribute("dateParam", dateParam).addAttribute("paramMap", paramMap) .addAttribute("paramByConvention", paramByConvention).addAttribute("value", value) @@ -498,9 +498,9 @@ public class RequestMappingHandlerAdapterIntegrationTests { @Override public String handleInInterface( - int cookie, - String pathvar, - String header, + int cookieV, + String pathvarV, + String headerV, String systemHeader, Map headerMap, Date dateParam, @@ -520,7 +520,7 @@ public class RequestMappingHandlerAdapterIntegrationTests { Model model, UriComponentsBuilder builder) { - model.addAttribute("cookie", cookie).addAttribute("pathvar", pathvar).addAttribute("header", header) + model.addAttribute("cookie", cookieV).addAttribute("pathvar", pathvarV).addAttribute("header", headerV) .addAttribute("systemHeader", systemHeader).addAttribute("headerMap", headerMap) .addAttribute("dateParam", dateParam).addAttribute("paramMap", paramMap) .addAttribute("paramByConvention", paramByConvention).addAttribute("value", value)