various errorprone fixes.

Motivation:

Continuing to make netty happy when compiling through errorprone.

Modification:

Mostly comments, some minor switch statement changes.

Result:

No more compiler errors!
This commit is contained in:
Derek Perez 2017-08-15 23:13:29 -07:00 committed by Norman Maurer
parent 9180b98e13
commit b4e5d3bf63
4 changed files with 11 additions and 1 deletions

View File

@ -271,6 +271,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
crc.update(in.readUnsignedByte()); // operating system
gzipState = GzipState.FLG_READ;
// fall through
case FLG_READ:
if ((flags & FEXTRA) != 0) {
if (in.readableBytes() < 2) {
@ -284,6 +285,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
xlen |= xlen1 << 8 | xlen2;
}
gzipState = GzipState.XLEN_READ;
// fall through
case XLEN_READ:
if (xlen != -1) {
if (in.readableBytes() < xlen) {
@ -294,6 +296,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
crc.update(xtra);
}
gzipState = GzipState.SKIP_FNAME;
// fall through
case SKIP_FNAME:
if ((flags & FNAME) != 0) {
if (!in.isReadable()) {
@ -308,6 +311,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
} while (in.isReadable());
}
gzipState = GzipState.SKIP_COMMENT;
// fall through
case SKIP_COMMENT:
if ((flags & FCOMMENT) != 0) {
if (!in.isReadable()) {
@ -322,6 +326,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
} while (in.isReadable());
}
gzipState = GzipState.PROCESS_FHCRC;
// fall through
case PROCESS_FHCRC:
if ((flags & FHCRC) != 0) {
if (in.readableBytes() < 4) {
@ -331,6 +336,7 @@ public class JdkZlibDecoder extends ZlibDecoder {
}
crc.reset();
gzipState = GzipState.HEADER_END;
// fall through
case HEADER_END:
return true;
default:

View File

@ -242,6 +242,8 @@ public class JdkZlibEncoder extends ZlibEncoder {
case ZLIB:
sizeEstimate += 2; // first two magic bytes
break;
default:
// no op
}
}
return ctx.alloc().heapBuffer(sizeEstimate);

View File

@ -273,6 +273,7 @@ class Snappy {
switch (state) {
case READY:
state = State.READING_PREAMBLE;
// fall through
case READING_PREAMBLE:
int uncompressedLength = readPreamble(in);
if (uncompressedLength == PREAMBLE_NOT_FULL) {
@ -286,6 +287,7 @@ class Snappy {
}
out.ensureWritable(uncompressedLength);
state = State.READING_TAG;
// fall through
case READING_TAG:
if (!in.isReadable()) {
return;

View File

@ -440,8 +440,8 @@ public final class NioEventLoop extends SingleThreadEventLoop {
if (wakenUp.get()) {
selector.wakeup();
}
// fall through
default:
// fallthrough
}
cancelledKeys = 0;