diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyCodecAdapter.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyCodecAdapter.java index 24d5d00f926..5f3b7848079 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyCodecAdapter.java +++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyCodecAdapter.java @@ -83,19 +83,11 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf input, List out NettyChannel channel = NettyChannel.getOrAddChannel(ctx.channel(), url, handler); - Object msg; - - int saveReaderIndex; - try { // decode object. do { - saveReaderIndex = message.readerIndex(); - try { - msg = codec.decode(channel, message); - } catch (IOException e) { - throw e; - } + int saveReaderIndex = message.readerIndex(); + Object msg = codec.decode(channel, message); if (msg == Codec2.DecodeResult.NEED_MORE_INPUT) { message.readerIndex(saveReaderIndex); break;