INT-3723: Fix HTTP Module for Recent SF Changes

JIRA: https://jira.spring.io/browse/INT-3723

Since `RequestMappingHandlerMapping` has reverted to `@RequestMapping` parsing,
restore the previous logic with `@RequestMapping` generation in the `IntegrationRequestMappingHandlerMapping`

Use `AnnotationUtils.synthesizeAnnotation` instead of direct annotation creation through the inline impl
This commit is contained in:
Artem Bilan
2015-05-30 09:22:32 -04:00
committed by Gary Russell
parent 1f91d4b832
commit 0fdc63007a
2 changed files with 7 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ subprojects { subproject ->
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '4.0.1.RELEASE'
springSocialTwitterVersion = '1.1.0.RELEASE'
springRetryVersion = '1.1.2.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.RC1'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.2.0.BUILD-SNAPSHOT'
springWsVersion = '2.2.1.RELEASE'
xmlUnitVersion = '1.5'
xstreamVersion = '1.4.7'

View File

@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
@@ -173,6 +174,7 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin
Map<String, Object> requestMappingAttributes = new HashMap<String, Object>();
requestMappingAttributes.put("name", endpoint.getComponentName());
requestMappingAttributes.put("value", requestMapping.getPathPatterns());
requestMappingAttributes.put("path", requestMapping.getPathPatterns());
requestMappingAttributes.put("method", requestMapping.getRequestMethods());
requestMappingAttributes.put("params", requestMapping.getParams());
@@ -180,8 +182,10 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin
requestMappingAttributes.put("consumes", requestMapping.getConsumes());
requestMappingAttributes.put("produces", requestMapping.getProduces());
return createRequestMappingInfo(AnnotationAttributes.fromMap(requestMappingAttributes),
getCustomTypeCondition(endpoint.getClass()));
org.springframework.web.bind.annotation.RequestMapping requestMappingAnnotation =
AnnotationUtils.synthesizeAnnotation(requestMappingAttributes,
org.springframework.web.bind.annotation.RequestMapping.class, null);
return createRequestMappingInfo(requestMappingAnnotation, getCustomTypeCondition(endpoint.getClass()));
}
@Override