Skip to content

Commit b620f1b

Browse files
committed
Delete redundant null check Signed-off-by: kjy1994 <[email protected]>
1 parent ec154a3 commit b620f1b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,13 +1181,11 @@ public void commitTransaction() throws ProducerFencedException {
11811181

11821182
@Override
11831183
public void abortTransaction() throws ProducerFencedException {
1184+
Exception producerFailedToUse = this.producerFailed;
11841185
LOGGER.debug(() -> toString() + " abortTransaction()");
1185-
if (this.producerFailed != null) {
1186-
LOGGER.debug(() -> {
1187-
String message = this.producerFailed == null ? "" : this.producerFailed.getMessage();
1188-
return "abortTransaction ignored - previous txFailed: " + message
1189-
+ ": " + this;
1190-
});
1186+
if (producerFailedToUse != null) {
1187+
LOGGER.debug(() -> "abortTransaction ignored - previous txFailed: " + producerFailedToUse.getMessage()
1188+
+ ": " + this);
11911189
}
11921190
else {
11931191
try {

0 commit comments

Comments
 (0)