Skip to content

Commit 0db2321

Browse files
committed
Fix Sonar issue
1 parent e138fc0 commit 0db2321

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,10 @@ private boolean determineCommitCurrent(Properties consumerProperties) {
694694
return true;
695695
}
696696
String autoOffsetReset = consumerProperties.getProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG);
697-
return !this.autoCommit
698-
&& (autoOffsetReset == null || autoOffsetReset.equals("latest"))
699-
&& (AssignmentCommitOption.LATEST_ONLY.equals(this.autoCommitOption)
700-
|| AssignmentCommitOption.LATEST_ONLY_NO_TX.equals(this.autoCommitOption));
697+
boolean resetLatest = autoOffsetReset == null || autoOffsetReset.equals("latest");
698+
boolean latestOnlyOption = AssignmentCommitOption.LATEST_ONLY.equals(this.autoCommitOption)
699+
|| AssignmentCommitOption.LATEST_ONLY_NO_TX.equals(this.autoCommitOption);
700+
return !this.autoCommit && resetLatest && latestOnlyOption;
701701
}
702702

703703
private long obtainMaxPollInterval(Properties consumerProperties) {

0 commit comments

Comments
 (0)