@@ -47,6 +47,7 @@ default void update(byte[] b, int off, int len) {
4747 * An abstract class implementing {@link ChecksumByteBuffer}
4848 * with a 32-bit checksum and a lookup table.
4949 */
50+ @ SuppressWarnings ("innerassignment" )
5051 abstract class CrcIntTable implements ChecksumByteBuffer {
5152 /** Current CRC value with bit-flipped. */
5253 private int crc ;
@@ -98,14 +99,21 @@ private static int update(int crc, ByteBuffer b, int[] table) {
9899
99100 // loop unroll - duff's device style
100101 switch (b .remaining ()) {
101- case 7 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
102- case 6 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
103- case 5 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
104- case 4 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
105- case 3 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
106- case 2 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
107- case 1 : crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
108- default : // noop
102+ case 7 :
103+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
104+ case 6 :
105+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
106+ case 5 :
107+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
108+ case 4 :
109+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
110+ case 3 :
111+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
112+ case 2 :
113+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
114+ case 1 :
115+ crc = (crc >>> 8 ) ^ table [((crc ^ b .get ()) & 0xff )];
116+ default : // noop
109117 }
110118
111119 return crc ;
0 commit comments