@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory;
@@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.core.GenericTypeResolver ;
import org.springframework.core.MethodParameter ;
import org.springframework.http.HttpInputMessage ;
import org.springframework.http.InvalidMediaTypeException ;
import org.springframework.http.MediaType ;
import org.springframework.http.converter.GenericHttpMessageConverter ;
import org.springframework.http.converter.HttpMessageConverter ;
@ -115,10 +116,17 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
@@ -115,10 +116,17 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
protected < T > Object readWithMessageConverters ( HttpInputMessage inputMessage ,
MethodParameter methodParam , Type targetType ) throws IOException , HttpMediaTypeNotSupportedException {
MediaType contentType = inputMessage . getHeaders ( ) . getContentType ( ) ;
if ( contentType = = null ) {
contentType = MediaType . APPLICATION_OCTET_STREAM ;
}
MediaType contentType ;
try {
contentType = inputMessage . getHeaders ( ) . getContentType ( ) ;
}
catch ( InvalidMediaTypeException ex ) {
throw new HttpMediaTypeNotSupportedException ( ex . getMessage ( ) ) ;
}
if ( contentType = = null ) {
contentType = MediaType . APPLICATION_OCTET_STREAM ;
}
Class < ? > contextClass = methodParam . getDeclaringClass ( ) ;
Map < TypeVariable , Type > map = GenericTypeResolver . getTypeVariableMap ( contextClass ) ;