From 7f4146154201d2d0fffc2f08c7e1766ef1a70536 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 18 Jul 2019 10:04:23 -0400 Subject: [PATCH] Fix new Sonar smell --- .../support/converter/AbstractJackson2MessageConverter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractJackson2MessageConverter.java b/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractJackson2MessageConverter.java index 790f891a18..1607d84721 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractJackson2MessageConverter.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractJackson2MessageConverter.java @@ -248,7 +248,8 @@ public Object fromMessage(Message message, @Nullable Object conversionHint) thro MessageProperties properties = message.getMessageProperties(); if (properties != null) { String contentType = properties.getContentType(); - if ((this.assumeSupportedContentType && (contentType == null || contentType.equals(MessageProperties.DEFAULT_CONTENT_TYPE))) + if ((this.assumeSupportedContentType // NOSONAR Boolean complexity + && (contentType == null || contentType.equals(MessageProperties.DEFAULT_CONTENT_TYPE))) || (contentType != null && contentType.contains(this.supportedContentType.getSubtype()))) { String encoding = properties.getContentEncoding(); if (encoding == null) { @@ -323,7 +324,7 @@ protected Message createMessage(Object objectToConvert, MessageProperties messag @Override protected Message createMessage(Object objectToConvert, MessageProperties messageProperties, - @Nullable Type genericType) + @Nullable Type genericType) throws MessageConversionException { byte[] bytes;