No need to have nested try blocks
.. because the catch block catches everything and rethrows it
This commit is contained in:
parent
788b88b7af
commit
c25fd78ca0
|
@ -109,7 +109,6 @@ public abstract class ByteToMessageDecoder
|
||||||
OutputMessageBuf out = OutputMessageBuf.get();
|
OutputMessageBuf out = OutputMessageBuf.get();
|
||||||
try {
|
try {
|
||||||
while (in.isReadable()) {
|
while (in.isReadable()) {
|
||||||
try {
|
|
||||||
int outSize = out.size();
|
int outSize = out.size();
|
||||||
int oldInputLength = in.readableBytes();
|
int oldInputLength = in.readableBytes();
|
||||||
decode(ctx, in, out);
|
decode(ctx, in, out);
|
||||||
|
@ -131,14 +130,13 @@ public abstract class ByteToMessageDecoder
|
||||||
if (isSingleDecode()) {
|
if (isSingleDecode()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (t instanceof CodecException) {
|
if (t instanceof CodecException) {
|
||||||
throw (CodecException) t;
|
throw (CodecException) t;
|
||||||
} else {
|
} else {
|
||||||
throw new DecoderException(t);
|
throw new DecoderException(t);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
if (out.drainToNextInbound(ctx)) {
|
if (out.drainToNextInbound(ctx)) {
|
||||||
decodeWasNull = false;
|
decodeWasNull = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user