[
https://issues.apache.org/jira/browse/KAFKA-8750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17816390#comment-17816390
]
Andrew Schofield commented on KAFKA-8750:
-----------------------------------------
I've reviewed the code and also a bunch of other similar routines in the Kafka
codebase which do progressive calculation such as crc32 calculation. All of
them have methods marked with `@SuppressWarnings("fallthrough")` which is
required to suppress the compiler warnings and tell the reader that the
fallthrough is intentional.
> Utils#murmur2() method switch case block don't have break
> ---------------------------------------------------------
>
> Key: KAFKA-8750
> URL: https://issues.apache.org/jira/browse/KAFKA-8750
> Project: Kafka
> Issue Type: Bug
> Components: clients
> Reporter: yangkun
> Priority: Major
>
> Utils#murmur2() is as following, switch case block don't have break.
>
> {code:java}
> public static int murmur2(final byte[] data) {
> ...
> switch (length % 4) {
> case 3:
> h ^= (data[(length & ~3) + 2] & 0xff) << 16;
> // no break
> case 2:
> h ^= (data[(length & ~3) + 1] & 0xff) << 8;
> // no break
> case 1:
> h ^= data[length & ~3] & 0xff;
> h *= m;
> }
> ...
> return h;
> }
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)