Skip to content

Commit

Permalink
Fix Sonar Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Dec 21, 2021
1 parent 6189b10 commit 525172b
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,21 @@ protected void applyCommonOverrides(@Nullable RabbitListenerEndpoint endpoint, C
instance.setListenerId(endpoint.getId());
endpoint.setupListenerContainer(instance);
}
if (instance.getMessageListener() instanceof AbstractAdaptableMessageListener) {
AbstractAdaptableMessageListener messageListener = (AbstractAdaptableMessageListener) instance
.getMessageListener();
Object iml = instance.getMessageListener();
if (iml instanceof AbstractAdaptableMessageListener) {
AbstractAdaptableMessageListener messageListener = (AbstractAdaptableMessageListener) iml;
JavaUtils.INSTANCE // NOSONAR
.acceptIfNotNull(this.beforeSendReplyPostProcessors,
messageListener::setBeforeSendReplyPostProcessors)
.acceptIfNotNull(this.retryTemplate, messageListener::setRetryTemplate)
.acceptIfCondition(this.retryTemplate != null && this.recoveryCallback != null,
this.recoveryCallback, messageListener::setRecoveryCallback)
.acceptIfNotNull(this.defaultRequeueRejected, messageListener::setDefaultRequeueRejected)
.acceptIfNotNull(endpoint.getReplyPostProcessor(), messageListener::setReplyPostProcessor)
.acceptIfNotNull(endpoint.getReplyContentType(), messageListener::setReplyContentType);
.acceptIfNotNull(this.defaultRequeueRejected, messageListener::setDefaultRequeueRejected);
if (endpoint != null) {
JavaUtils.INSTANCE
.acceptIfNotNull(endpoint.getReplyPostProcessor(), messageListener::setReplyPostProcessor)
.acceptIfNotNull(endpoint.getReplyContentType(), messageListener::setReplyContentType);
}
messageListener.setConverterWinsContentType(endpoint.isConverterWinsContentType());
}
}
Expand Down

0 comments on commit 525172b

Please sign in to comment.