Skip to content

Commit 433ef4c

Browse files
garyrussellartembilan
authored andcommitted
Address Sonar reports for recent commits
1 parent 648aeb8 commit 433ef4c

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ protected Object extractRequestBody(ServletServerHttpRequest request) throws IOE
497497
}
498498
throw new MessagingException(
499499
"Could not convert request: no suitable HttpMessageConverter found for expected type ["
500-
+ expectedType.getName() + "] and content type [" + contentType + "]");
500+
+ expectedType != null ? expectedType.getName() : "null"
501+
+ "] and content type [" + contentType + "]");
501502
}
502503

503504
}

spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGateway.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected void doInit() {
148148
protected Object handleRequestMessage(Message<?> requestMessage) {
149149
String collectionName =
150150
this.collectionNameExpression.getValue(this.evaluationContext, requestMessage, String.class);
151-
151+
// TODO: 5.2 assert not null
152152
Object result;
153153

154154
if (this.collectionCallback != null) {
@@ -158,10 +158,10 @@ protected Object handleRequestMessage(Message<?> requestMessage) {
158158
Query query = buildQuery(requestMessage);
159159

160160
if (this.expectSingleResult) {
161-
result = this.mongoTemplate.findOne(query, this.entityClass, collectionName);
161+
result = this.mongoTemplate.findOne(query, this.entityClass, collectionName); // NOSONAR
162162
}
163163
else {
164-
result = this.mongoTemplate.find(query, this.entityClass, collectionName);
164+
result = this.mongoTemplate.find(query, this.entityClass, collectionName); // NOSONAR
165165
}
166166
}
167167

spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ protected void onInit() {
102102
protected void handleMessageInternal(Message<?> message) {
103103
String topic = this.topicExpression.getValue(this.evaluationContext, message, String.class);
104104
Object value = this.messageConverter.fromMessage(message, Object.class);
105+
// TODO: 5.2 assert both not null
105106

106107
if (value instanceof byte[]) {
107-
this.template.convertAndSend(topic, value);
108+
this.template.convertAndSend(topic, value); // NOSONAR
108109
}
109110
else {
110-
this.template.convertAndSend(topic, ((RedisSerializer<Object>) this.serializer).serialize(value));
111+
this.template.convertAndSend(topic, ((RedisSerializer<Object>) this.serializer).serialize(value)); // NOSONAR
111112
}
112113
}
113114

spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ protected void handleMessageInternal(Message<?> message) throws Exception {
125125
}
126126

127127
String queueName = this.queueNameExpression.getValue(this.evaluationContext, message, String.class);
128+
// TODO: 5.2 assert both not null
128129
if (this.leftPush) {
129-
this.template.boundListOps(queueName).leftPush(value);
130+
this.template.boundListOps(queueName).leftPush(value); // NOSONAR
130131
}
131132
else {
132-
this.template.boundListOps(queueName).rightPush(value);
133+
this.template.boundListOps(queueName).rightPush(value); // NOSONAR
133134
}
134135
}
135136

0 commit comments

Comments
 (0)