Sonar fixes - False positives

This commit is contained in:
Gary Russell
2018-10-25 15:54:49 -04:00
parent 0dca5bcded
commit 9e91234545
3 changed files with 6 additions and 6 deletions

View File

@@ -687,7 +687,7 @@ public class AsyncRabbitTemplate implements AsyncAmqpTemplate, ChannelAwareMessa
}
AsyncRabbitTemplate.this.pending.remove(this.correlationId);
if (this.channelHolder != null && AsyncRabbitTemplate.this.directReplyToContainer != null) {
AsyncRabbitTemplate.this.directReplyToContainer.releaseConsumerFor(this.channelHolder, false, null);
AsyncRabbitTemplate.this.directReplyToContainer.releaseConsumerFor(this.channelHolder, false, null); // NOSONAR
}
return super.cancel(mayInterruptIfRunning);
}
@@ -742,7 +742,7 @@ public class AsyncRabbitTemplate implements AsyncAmqpTemplate, ChannelAwareMessa
if (RabbitFuture.this.channelHolder != null
&& AsyncRabbitTemplate.this.directReplyToContainer != null) {
AsyncRabbitTemplate.this.directReplyToContainer
.releaseConsumerFor(RabbitFuture.this.channelHolder, false, null);
.releaseConsumerFor(RabbitFuture.this.channelHolder, false, null); // NOSONAR
}
setException(new AmqpReplyTimeoutException("Reply timed out", RabbitFuture.this.requestMessage));
}

View File

@@ -1516,7 +1516,7 @@ public abstract class AbstractMessageListenerContainer extends RabbitAccessor
// so the channel exposed (because exposeListenerChannel is false) will be closed
resourceHolder.setSynchronizedWithTransaction(false);
}
ConnectionFactoryUtils.releaseResources(resourceHolder);
ConnectionFactoryUtils.releaseResources(resourceHolder); // NOSONAR - null check in method
if (boundHere) {
// unbind if we bound
TransactionSynchronizationManager.unbindResource(this.getConnectionFactory());

View File

@@ -38,12 +38,12 @@ public class Delivery {
private final byte[] body;
public Delivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body,
String queue) { //NOSONAR
public Delivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body, // NOSONAR
String queue) {
this.consumerTag = consumerTag;
this.envelope = envelope;
this.properties = properties;
this.body = body;
this.body = body; // NOSONAR
this.queue = queue;
}