Sonar fixes

This commit is contained in:
Gary Russell
2018-10-26 18:33:19 -04:00
parent 93558fdd3c
commit 8ce3aa2eb8
2 changed files with 3 additions and 4 deletions

View File

@@ -352,7 +352,7 @@ public class KafkaListenerAnnotationBeanPostProcessor<K, V>
Method defaultMethod = null;
for (Method method : multiMethods) {
Method checked = checkProxy(method, bean);
if (AnnotationUtils.findAnnotation(method, KafkaHandler.class).isDefault()) {
if (AnnotationUtils.findAnnotation(method, KafkaHandler.class).isDefault()) { // NOSONAR never null
final Method toAssert = defaultMethod;
Assert.state(toAssert == null, () -> "Only one @KafkaHandler can be marked 'isDefault', found: "
+ toAssert.toString() + " and " + method.toString());

View File

@@ -110,13 +110,12 @@ public class MethodKafkaListenerEndpoint<K, V> extends AbstractKafkaListenerEndp
if (method != null) {
SendTo ann = AnnotationUtils.getAnnotation(method, SendTo.class);
if (ann != null) {
if (method.getReturnType().equals(void.class)) {
if (this.logger.isWarnEnabled()) {
if (method.getReturnType().equals(void.class)
&& this.logger.isWarnEnabled()) {
this.logger.warn("Method "
+ method
+ " has a void return type; @SendTo is ignored" +
(this.errorHandler == null ? "" : " unless the error handler returns a result"));
}
}
String[] destinations = ann.value();
if (destinations.length > 1) {