Skip to content

Commit 8ce3aa2

Browse files
committed
Sonar fixes
1 parent 93558fd commit 8ce3aa2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ private void processMultiMethodListeners(Collection<KafkaListener> classLevelLis
352352
Method defaultMethod = null;
353353
for (Method method : multiMethods) {
354354
Method checked = checkProxy(method, bean);
355-
if (AnnotationUtils.findAnnotation(method, KafkaHandler.class).isDefault()) {
355+
if (AnnotationUtils.findAnnotation(method, KafkaHandler.class).isDefault()) { // NOSONAR never null
356356
final Method toAssert = defaultMethod;
357357
Assert.state(toAssert == null, () -> "Only one @KafkaHandler can be marked 'isDefault', found: "
358358
+ toAssert.toString() + " and " + method.toString());

spring-kafka/src/main/java/org/springframework/kafka/config/MethodKafkaListenerEndpoint.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ private String getReplyTopic() {
110110
if (method != null) {
111111
SendTo ann = AnnotationUtils.getAnnotation(method, SendTo.class);
112112
if (ann != null) {
113-
if (method.getReturnType().equals(void.class)) {
114-
if (this.logger.isWarnEnabled()) {
113+
if (method.getReturnType().equals(void.class)
114+
&& this.logger.isWarnEnabled()) {
115115
this.logger.warn("Method "
116116
+ method
117117
+ " has a void return type; @SendTo is ignored" +
118118
(this.errorHandler == null ? "" : " unless the error handler returns a result"));
119-
}
120119
}
121120
String[] destinations = ann.value();
122121
if (destinations.length > 1) {

0 commit comments

Comments
 (0)