Fix new Sonar reports
This commit is contained in:
committed by
Artem Bilan
parent
20718c05f0
commit
fb5854c480
@@ -490,12 +490,18 @@ public abstract class HttpRequestHandlingEndpointSupport extends BaseHttpInbound
|
||||
expectedType = requestPayloadType.resolve();
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: resolve() can return null, which is not valid for canRead().
|
||||
* Perhaps we should coerce to String/byte[] instead of attempting
|
||||
* to convert. However this might be a breaking change - 5.2?
|
||||
* Hence NOSONAR below.
|
||||
*/
|
||||
for (HttpMessageConverter<?> converter : this.messageConverters) {
|
||||
if (converter.canRead(expectedType, contentType)) {
|
||||
return converter.read((Class) expectedType, request);
|
||||
}
|
||||
}
|
||||
throw new MessagingException(
|
||||
throw new MessagingException( // NOSONAR might be null; see comment above.
|
||||
"Could not convert request: no suitable HttpMessageConverter found for expected type ["
|
||||
+ expectedType != null ? expectedType.getName() : "null"
|
||||
+ "] and content type [" + contentType + "]");
|
||||
|
||||
@@ -152,7 +152,7 @@ public class MongoDbOutboundGateway extends AbstractReplyProducingMessageHandler
|
||||
Object result;
|
||||
|
||||
if (this.collectionCallback != null) {
|
||||
result = this.mongoTemplate.execute(collectionName, this.collectionCallback);
|
||||
result = this.mongoTemplate.execute(collectionName, this.collectionCallback); // NOSONAR
|
||||
}
|
||||
else {
|
||||
Query query = buildQuery(requestMessage);
|
||||
|
||||
Reference in New Issue
Block a user