Skip to content

Commit 63e56a7

Browse files
committed
Fix Sonar Issue
1 parent 34e1950 commit 63e56a7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,17 +3159,23 @@ private OffsetAndMetadata createOffsetAndMetadata(long offset) {
31593159

31603160
private final class ConsumerAwareListenerMetadata implements ListenerMetadata {
31613161

3162+
ConsumerAwareListenerMetadata() {
3163+
}
3164+
31623165
@Override
3166+
@Nullable
31633167
public String getListenerId() {
31643168
return getBeanName();
31653169
}
31663170

31673171
@Override
3172+
@Nullable
31683173
public String getGroupId() {
31693174
return ListenerConsumer.this.consumerGroupId;
31703175
}
31713176

31723177
@Override
3178+
@Nullable
31733179
public byte[] getListenerInfo() {
31743180
return ListenerConsumer.this.listenerinfo;
31753181
}

spring-kafka/src/main/java/org/springframework/kafka/listener/ListenerMetadata.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616

1717
package org.springframework.kafka.listener;
1818

19+
import org.springframework.lang.Nullable;
20+
1921
/**
2022
* Metadata associated to a {@link org.springframework.kafka.annotation.KafkaListener}.
2123
*
2224
* @author Francois Rosiere
25+
* @author Gary Russell
2326
* @since 2.8.5
2427
* @see org.springframework.kafka.annotation.KafkaListener
2528
*/
@@ -29,17 +32,21 @@ public interface ListenerMetadata {
2932
* Return the listener id.
3033
* @return the listener id.
3134
*/
35+
@Nullable
3236
String getListenerId();
3337

3438
/**
3539
* Return the group id.
3640
* @return the group id.
3741
*/
42+
@Nullable
3843
String getGroupId();
3944

4045
/**
4146
* Return the listener info.
4247
* @return the listener info.
4348
*/
49+
@Nullable
4450
byte[] getListenerInfo();
51+
4552
}

0 commit comments

Comments
 (0)