Make inByte/MsgBuf final

This commit is contained in:
Trustin Lee 2013-02-13 15:16:40 -08:00
parent a1540a49d3
commit dc8ae16e61

View File

@ -53,8 +53,8 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
// child executor. // child executor.
final EventExecutor executor; final EventExecutor executor;
private MessageBuf<Object> inMsgBuf; private final MessageBuf<Object> inMsgBuf;
private ByteBuf inByteBuf; private final ByteBuf inByteBuf;
private MessageBuf<Object> outMsgBuf; private MessageBuf<Object> outMsgBuf;
private ByteBuf outByteBuf; private ByteBuf outByteBuf;
@ -168,6 +168,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
handler.getClass().getSimpleName() + ".newInboundBuffer() returned neither " + handler.getClass().getSimpleName() + ".newInboundBuffer() returned neither " +
ByteBuf.class.getSimpleName() + " nor " + MessageBuf.class.getSimpleName() + ": " + buf); ByteBuf.class.getSimpleName() + " nor " + MessageBuf.class.getSimpleName() + ": " + buf);
} }
} else {
inByteBuf = null;
inMsgBuf = null;
} }
if (handler instanceof ChannelOutboundHandler) { if (handler instanceof ChannelOutboundHandler) {
@ -200,6 +203,8 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
this.name = name; this.name = name;
this.handler = handler; this.handler = handler;
executor = null; executor = null;
inByteBuf = null;
inMsgBuf = null;
needsLazyBufInit = true; needsLazyBufInit = true;
} }