Skip to content

Commit

Permalink
Sonar Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Dec 16, 2018
1 parent c931a4c commit d6b3007
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1196,13 +1196,14 @@ public <R, S> boolean receiveAndReply(String queueName, ReceiveAndReplyCallback<
private <R, S> boolean doReceiveAndReply(final String queueName, final ReceiveAndReplyCallback<R, S> callback,
final ReplyToAddressCallback<S> replyToAddressCallback) throws AmqpException {

return execute(channel -> {
Message receiveMessage = receiveForReply(queueName, channel);
if (receiveMessage != null) {
return sendReply(callback, replyToAddressCallback, channel, receiveMessage);
}
return false;
}, obtainTargetConnectionFactory(this.receiveConnectionFactorySelectorExpression, queueName));
Boolean result = execute(channel -> {
Message receiveMessage = receiveForReply(queueName, channel);
if (receiveMessage != null) {
return sendReply(callback, replyToAddressCallback, channel, receiveMessage);
}
return false;
}, obtainTargetConnectionFactory(this.receiveConnectionFactorySelectorExpression, queueName));
return result == null ? false : result;
}

@Nullable
Expand Down Expand Up @@ -1307,7 +1308,7 @@ else if (logger.isDebugEnabled()) {
}

@SuppressWarnings(UNCHECKED)
private <R, S> Boolean sendReply(final ReceiveAndReplyCallback<R, S> callback,
private <R, S> boolean sendReply(final ReceiveAndReplyCallback<R, S> callback,
final ReplyToAddressCallback<S> replyToAddressCallback, Channel channel, Message receiveMessage)
throws Exception { // NOSONAR TODO change to IOException in 2.2.

Expand Down Expand Up @@ -2027,8 +2028,9 @@ private void cleanUpAfterAction(Channel channel, boolean invokeScope, RabbitReso
}
}

@Nullable
private <T> T invokeAction(ChannelCallback<T> action, ConnectionFactory connectionFactory, Channel channel)
throws Exception {
throws Exception { // NOSONAR see the callback

if (this.confirmsOrReturnsCapable == null) {
determineConfirmsReturnsCapability(connectionFactory);
Expand Down

0 comments on commit d6b3007

Please sign in to comment.