Skip to content

Commit 18584b1

Browse files
MINOR: ignore null judgement in LogCleaner (#19524)
about https://github.com/apache/kafka/pull/19387/files#r2052025917 Reviewers: PoAn Yang <[email protected]>, Chia-Ping Tsai <[email protected]>, TengYao Chi <[email protected]>
1 parent ae771d7 commit 18584b1

File tree

1 file changed

+2
-3
lines changed
  • storage/src/main/java/org/apache/kafka/storage/internals/log

1 file changed

+2
-3
lines changed

Diff for: storage/src/main/java/org/apache/kafka/storage/internals/log/LogCleaner.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,14 @@ private boolean cleanFilthiestLog() throws LogCleaningException {
556556
} else {
557557
// there's a log, clean it
558558
this.lastPreCleanStats = preCleanStats;
559-
LogToClean cleanable = null;
559+
LogToClean cleanable = ltc.get();
560560
try {
561-
cleanable = ltc.get();
562561
cleanLog(cleanable);
563562
cleaned = true;
564563
} catch (ThreadShutdownException e) {
565564
throw e;
566565
} catch (Exception e) {
567-
throw new LogCleaningException(cleanable != null ? cleanable.log() : null, e.getMessage(), e);
566+
throw new LogCleaningException(cleanable.log(), e.getMessage(), e);
568567
}
569568
}
570569

0 commit comments

Comments
 (0)