ijuma commented on code in PR #13359: URL: https://github.com/apache/kafka/pull/13359#discussion_r1128578938
########## storage/src/main/java/org/apache/kafka/storage/internals/log/LazyIndex.java: ########## @@ -166,20 +166,25 @@ public File file() { @SuppressWarnings("unchecked") public T get() throws IOException { - if (indexWrapper instanceof IndexValue<?>) - return ((IndexValue<T>) indexWrapper).index; - else if (indexWrapper instanceof IndexFile) { + IndexWrapper wrapper = indexWrapper; + if (wrapper instanceof IndexValue<?>) + return ((IndexValue<T>) wrapper).index; Review Comment: This change is not strictly necessary with the way the code behaves today (we never change from `IndexValue` to something else), but it's cleaner not to access the field again given that we are doing it without a lock here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org