Fix some Sonar smells
This commit is contained in:
@@ -89,7 +89,7 @@ public class AnnotationConfigParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
public Set<MethodMetadata> getDeclaredMethods() {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("The class doesn't support this operation");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class MessageHistoryParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
public Set<MethodMetadata> getDeclaredMethods() {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("The class doesn't support this operation");
|
||||
}
|
||||
|
||||
}, parserContext.getRegistry());
|
||||
|
||||
@@ -161,8 +161,6 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator im
|
||||
SPEL_COMPILERS.put(SpelCompilerMode.MIXED, EXPRESSION_PARSER_MIXED);
|
||||
}
|
||||
|
||||
private MessageHandlerMethodFactory messageHandlerMethodFactory;
|
||||
|
||||
private final Object targetObject;
|
||||
|
||||
private final JsonObjectMapper<?, ?> jsonObjectMapper;
|
||||
@@ -197,6 +195,8 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator im
|
||||
|
||||
private boolean useSpelInvoker;
|
||||
|
||||
private volatile MessageHandlerMethodFactory messageHandlerMethodFactory;
|
||||
|
||||
private volatile boolean initialized;
|
||||
|
||||
public MessagingMethodInvokerHelper(Object targetObject, Method method, Class<?> expectedType,
|
||||
@@ -515,10 +515,26 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator im
|
||||
: IntegrationContextUtils.MESSAGE_HANDLER_FACTORY_BEAN_NAME);
|
||||
}
|
||||
|
||||
private void configureLocalMessageHandlerFactory() {
|
||||
BeanFactory beanFactory = getBeanFactory();
|
||||
|
||||
ConfigurableCompositeMessageConverter messageConverter = new ConfigurableCompositeMessageConverter();
|
||||
messageConverter.setBeanFactory(beanFactory);
|
||||
messageConverter.afterPropertiesSet();
|
||||
|
||||
IntegrationMessageHandlerMethodFactory localHandlerMethodFactory =
|
||||
new IntegrationMessageHandlerMethodFactory(this.canProcessMessageList);
|
||||
localHandlerMethodFactory.setMessageConverter(messageConverter);
|
||||
localHandlerMethodFactory.setBeanFactory(beanFactory);
|
||||
localHandlerMethodFactory.afterPropertiesSet();
|
||||
|
||||
this.messageHandlerMethodFactory = localHandlerMethodFactory;
|
||||
}
|
||||
/*
|
||||
* This should not be needed in production but we have many tests
|
||||
* This should not be needed in production, but we have many tests
|
||||
* that don't run in an application context.
|
||||
*/
|
||||
|
||||
private void initializeHandler(HandlerMethod candidate) {
|
||||
ExpressionParser parser;
|
||||
if (candidate.useSpelInvoker == null) {
|
||||
@@ -537,22 +553,6 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator im
|
||||
candidate.initialized = true;
|
||||
}
|
||||
|
||||
private void configureLocalMessageHandlerFactory() {
|
||||
BeanFactory beanFactory = getBeanFactory();
|
||||
|
||||
ConfigurableCompositeMessageConverter messageConverter = new ConfigurableCompositeMessageConverter();
|
||||
messageConverter.setBeanFactory(beanFactory);
|
||||
messageConverter.afterPropertiesSet();
|
||||
|
||||
IntegrationMessageHandlerMethodFactory localHandlerMethodFactory =
|
||||
new IntegrationMessageHandlerMethodFactory(this.canProcessMessageList);
|
||||
localHandlerMethodFactory.setMessageConverter(messageConverter);
|
||||
localHandlerMethodFactory.setBeanFactory(beanFactory);
|
||||
localHandlerMethodFactory.afterPropertiesSet();
|
||||
|
||||
this.messageHandlerMethodFactory = localHandlerMethodFactory;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Object invokeHandlerMethod(HandlerMethod handlerMethod, ParametersWrapper parameters) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user