Skip to content

Commit 1bc6f39

Browse files
committed
Fix Sonar Issues
1 parent 3020619 commit 1bc6f39

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-kafka-test/src/main/java/org/springframework/kafka/test/EmbeddedKafkaBroker.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ public class EmbeddedKafkaBroker implements InitializingBean, DisposableBean {
147147
method = TestUtils.class.getDeclaredMethod("boundPort", KafkaBroker.class, SecurityProtocol.class);
148148
}
149149
catch (NoSuchMethodException | SecurityException e1) {
150-
throw new IllegalStateException("Failed to determine TestUtils.boundPort() method; client version: "
150+
IllegalStateException isx = new IllegalStateException("Failed to determine TestUtils.boundPort() method; client version: "
151151
+ AppInfoParser.getVersion(), e);
152+
isx.addSuppressed(e1);
153+
throw isx;
152154
}
153155
}
154156
BOUND_PORT_METHOD = method;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,10 +1939,8 @@ else if (this.syncCommits) {
19391939
private void commitAsync(Map<TopicPartition, OffsetAndMetadata> commits) {
19401940
this.consumer.commitAsync(commits, (offsetsAttempted, exception) -> {
19411941
this.commitCallback.onComplete(offsetsAttempted, exception);
1942-
if (exception == null) {
1943-
if (this.fixTxOffsets) {
1944-
this.lastCommits.putAll(commits);
1945-
}
1942+
if (exception == null && this.fixTxOffsets) {
1943+
this.lastCommits.putAll(commits);
19461944
}
19471945
});
19481946
}

0 commit comments

Comments
 (0)