Fix new Sonar smells
This commit is contained in:
@@ -335,7 +335,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
|
||||
DefaultMessageSenderObservationConvention.INSTANCE,
|
||||
() -> new MessageSenderContext(messageToSend, getComponentName()),
|
||||
this.observationRegistry)
|
||||
.observe(() -> sendInternal(messageToSend, timeout));
|
||||
.observe(() -> sendInternal(messageToSend, timeout)); // NOSONAR - never null
|
||||
}
|
||||
|
||||
private boolean sendWithMetrics(Message<?> message, long timeout) {
|
||||
|
||||
@@ -174,14 +174,13 @@ public class DefaultConfiguringBeanFactoryPostProcessor
|
||||
BeanDefinition nullChannelDefinition = null;
|
||||
BeanFactory beanFactoryToUse = this.beanFactory;
|
||||
do {
|
||||
if (beanFactoryToUse instanceof ConfigurableListableBeanFactory listable) {
|
||||
if (listable.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
|
||||
nullChannelDefinition =
|
||||
listable.getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
|
||||
}
|
||||
if (beanFactoryToUse instanceof ConfigurableListableBeanFactory listable &&
|
||||
listable.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
|
||||
|
||||
nullChannelDefinition = listable.getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
|
||||
}
|
||||
if (beanFactoryToUse instanceof HierarchicalBeanFactory) {
|
||||
beanFactoryToUse = ((HierarchicalBeanFactory) beanFactoryToUse).getParentBeanFactory();
|
||||
if (beanFactoryToUse instanceof HierarchicalBeanFactory hierarchicalBeanFactory) {
|
||||
beanFactoryToUse = hierarchicalBeanFactory.getParentBeanFactory();
|
||||
}
|
||||
}
|
||||
while (nullChannelDefinition == null);
|
||||
@@ -455,7 +454,7 @@ public class DefaultConfiguringBeanFactoryPostProcessor
|
||||
return BeanDefinitionBuilder.genericBeanDefinition(IntegrationMessageHandlerMethodFactory.class)
|
||||
.addConstructorArgValue(listCapable)
|
||||
.addPropertyReference("messageConverter",
|
||||
IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME);
|
||||
IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ public interface CheckedFunction<T, R> {
|
||||
return apply(t1);
|
||||
}
|
||||
catch (Throwable t) { // NOSONAR
|
||||
if (t instanceof RuntimeException runtimeException) {
|
||||
if (t instanceof RuntimeException runtimeException) { // NOSONAR
|
||||
throw runtimeException;
|
||||
}
|
||||
else if (t instanceof Error error) {
|
||||
else if (t instanceof Error error) { // NOSONAR
|
||||
throw error;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user