chia7712 commented on code in PR #17441: URL: https://github.com/apache/kafka/pull/17441#discussion_r1797523298
########## clients/src/main/java/org/apache/kafka/common/utils/ByteBufferUnmapper.java: ########## @@ -87,10 +87,7 @@ public static void unmap(String resourceDescription, ByteBuffer buffer) throws I private static MethodHandle lookupUnmapMethodHandle() { final MethodHandles.Lookup lookup = lookup(); try { - if (Java.IS_JAVA9_COMPATIBLE) - return unmapJava9(lookup); - else - return unmapJava7Or8(lookup); Review Comment: please remove `unmapJava7Or8` ########## clients/src/main/java/org/apache/kafka/common/utils/Crc32C.java: ########## @@ -37,10 +37,7 @@ public final class Crc32C { private static final ChecksumFactory CHECKSUM_FACTORY; Review Comment: `private static final ChecksumFactory CHECKSUM_FACTORY = new Java9ChecksumFactory();` ########## clients/src/main/java/org/apache/kafka/common/utils/Java.java: ########## @@ -36,10 +36,6 @@ static Version parseVersion(String versionString) { return new Version(majorVersion, minorVersion); } - // Having these as static final provides the best opportunity for compiler optimization - public static final boolean IS_JAVA9_COMPATIBLE = VERSION.isJava9Compatible(); Review Comment: please remove `isJava9Compatible` and `isJava11Compatible` ########## clients/src/main/java/org/apache/kafka/common/utils/Crc32C.java: ########## @@ -37,10 +37,7 @@ public final class Crc32C { private static final ChecksumFactory CHECKSUM_FACTORY; static { - if (Java.IS_JAVA9_COMPATIBLE) - CHECKSUM_FACTORY = new Java9ChecksumFactory(); - else - CHECKSUM_FACTORY = new PureJavaChecksumFactory(); Review Comment: please remove PureJavaChecksumFactory -- 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