From dc8ae16e61c2852bee16c12b612df2b9c8c588b0 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 13 Feb 2013 15:16:40 -0800 Subject: [PATCH] Make inByte/MsgBuf final --- .../io/netty/channel/DefaultChannelHandlerContext.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java index 652297e564..b75b372c43 100755 --- a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java @@ -53,8 +53,8 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements // child executor. final EventExecutor executor; - private MessageBuf inMsgBuf; - private ByteBuf inByteBuf; + private final MessageBuf inMsgBuf; + private final ByteBuf inByteBuf; private MessageBuf outMsgBuf; private ByteBuf outByteBuf; @@ -168,6 +168,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements handler.getClass().getSimpleName() + ".newInboundBuffer() returned neither " + ByteBuf.class.getSimpleName() + " nor " + MessageBuf.class.getSimpleName() + ": " + buf); } + } else { + inByteBuf = null; + inMsgBuf = null; } if (handler instanceof ChannelOutboundHandler) { @@ -200,6 +203,8 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements this.name = name; this.handler = handler; executor = null; + inByteBuf = null; + inMsgBuf = null; needsLazyBufInit = true; }