diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodParameterMessageMapper.java b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodParameterMessageMapper.java index 2bf364903e..db9f8470bc 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodParameterMessageMapper.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodParameterMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; @@ -33,7 +34,9 @@ import org.springframework.integration.annotation.Headers; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageHeaders; import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; +import org.springframework.util.ReflectionUtils; import org.springframework.util.StringUtils; /** @@ -130,7 +133,7 @@ public class MethodParameterMessageMapper implements InboundMessageMapper annotations = CollectionUtils.arrayToList(annotationArray); + for (Object o : annotations) { if (o instanceof Header) { this._headerAnnotation = (Header) o; } else if (Headers.class.isInstance(o)) { - Assert.isAssignable(Map.class, this.getParameterType(), + Assert.isAssignable(Map.class, this.parameter.getParameterType(), "parameter with the @Headers annotation must be assignable to java.util.Map"); this._hasHeadersAnnotation = true; } @@ -271,8 +286,8 @@ public class MethodParameterMessageMapper implements InboundMessageMapper getParameterType() { + return this.parameter.getParameterType(); + } } + }