Source:
public Object fromMessage(Message message, @Nullable Object conversionHint) throws MessageConversionException { Object content = null; MessageProperties properties = message.getMessageProperties(); if (properties != null) { String contentType = properties.getContentType(); if (contentType != null && contentType.contains(this.supportedContentType.getSubtype())) { String encoding = properties.getContentEncoding(); if (encoding == null) { encoding = getDefaultCharset(); } try { JavaType inferredType = this.javaTypeMapper.getInferredType(properties); if (inferredType != null && this.useProjectionForInterfaces && inferredType.isInterface() && !inferredType.getRawClass().getPackage().getName().startsWith("java.util")) { if (this.projectingConverter == null) { this.projectingConverter = new ProjectingMessageConverter(this.objectMapper); } content = this.projectingConverter.convert(message, inferredType.getRawClass()); } else if (conversionHint instanceof ParameterizedTypeReference) { content = convertBytesToObject(message.getBody(), encoding, this.objectMapper.getTypeFactory().constructType( ((ParameterizedTypeReference<?>) conversionHint).getType())); } else if (getClassMapper() == null) { JavaType targetJavaType = getJavaTypeMapper() .toJavaType(message.getMessageProperties()); content = convertBytesToObject(message.getBody(), encoding, targetJavaType); } else { Class<?> targetClass = getClassMapper().toClass( message.getMessageProperties()); content = convertBytesToObject(message.getBody(), encoding, targetClass); } } catch (IOException e) { throw new MessageConversionException( "Failed to convert Message content", e); } } else { if (this.log.isWarnEnabled()) { this.log.warn("Could not convert incoming message with content-type [" + contentType + "], '" + this.supportedContentType.getSubtype() + "' keyword missing."); } } } if (content == null) { content = message.getBody(); } return content; }

Target:
public Object fromMessage(Message message, @Nullable Object conversionHint) throws MessageConversionException { Object content = null; MessageProperties properties = message.getMessageProperties(); if (properties != null) { String contentType = properties.getContentType(); if (contentType != null && contentType.contains(this.supportedContentType.getSubtype())) { String encoding = properties.getContentEncoding(); if (encoding == null) { encoding = getDefaultCharset(); } try { JavaType inferredType = this.javaTypeMapper.getInferredType(properties); if (inferredType != null && this.useProjectionForInterfaces && inferredType.isInterface() && !inferredType.getRawClass().getPackage().getName().startsWith("java.util")) { content = this.projectingConverter.convert(message, inferredType.getRawClass()); } else if (conversionHint instanceof ParameterizedTypeReference) { content = convertBytesToObject(message.getBody(), encoding, this.objectMapper.getTypeFactory().constructType( ((ParameterizedTypeReference<?>) conversionHint).getType())); } else if (getClassMapper() == null) { JavaType targetJavaType = getJavaTypeMapper() .toJavaType(message.getMessageProperties()); content = convertBytesToObject(message.getBody(), encoding, targetJavaType); } else { Class<?> targetClass = getClassMapper().toClass( message.getMessageProperties()); content = convertBytesToObject(message.getBody(), encoding, targetClass); } } catch (IOException e) { throw new MessageConversionException( "Failed to convert Message content", e); } } else { if (this.log.isWarnEnabled()) { this.log.warn("Could not convert incoming message with content-type [" + contentType + "], '" + this.supportedContentType.getSubtype() + "' keyword missing."); } } } if (content == null) { content = message.getBody(); } return content; }