MINOR: ignore null judgement in LogCleaner (#19524)

about https://github.com/apache/kafka/pull/19387/files#r2052025917

Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai
 <chia7712@gmail.com>, TengYao Chi <frankvicky@apache.org>
This commit is contained in:
Xuan-Zhang Gong 2025-04-21 21:22:56 +08:00 committed by GitHub
parent ae771d73d1
commit 18584b11ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -556,15 +556,14 @@ public class LogCleaner implements BrokerReconfigurable {
} else {
// there's a log, clean it
this.lastPreCleanStats = preCleanStats;
LogToClean cleanable = null;
LogToClean cleanable = ltc.get();
try {
cleanable = ltc.get();
cleanLog(cleanable);
cleaned = true;
} catch (ThreadShutdownException e) {
throw e;
} catch (Exception e) {
throw new LogCleaningException(cleanable != null ? cleanable.log() : null, e.getMessage(), e);
throw new LogCleaningException(cleanable.log(), e.getMessage(), e);
}
}