Remove unreachable code

This commit is contained in:
Trustin Lee 2013-02-08 23:16:54 +09:00
parent 44ea0a116f
commit 0746199ca4

View File

@ -401,17 +401,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
@Override @Override
public ByteBuf inboundByteBuffer() { public ByteBuf inboundByteBuffer() {
if (inByteBuf == null) { if (inByteBuf == null) {
if (handler() instanceof ChannelInboundHandler) { throw new NoSuchBufferException(String.format(
throw new NoSuchBufferException(String.format( "the handler '%s' has no inbound byte buffer; it does not implement %s.",
"the handler '%s' has no inbound byte buffer; it implements %s, but " + name, ChannelInboundByteHandler.class.getSimpleName()));
"its newInboundBuffer() method created a %s.",
name, ChannelInboundHandler.class.getSimpleName(),
MessageBuf.class.getSimpleName()));
} else {
throw new NoSuchBufferException(String.format(
"the handler '%s' has no inbound byte buffer; it does not implement %s.",
name, ChannelInboundHandler.class.getSimpleName()));
}
} }
return inByteBuf; return inByteBuf;
} }
@ -420,17 +412,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> MessageBuf<T> inboundMessageBuffer() { public <T> MessageBuf<T> inboundMessageBuffer() {
if (inMsgBuf == null) { if (inMsgBuf == null) {
if (handler() instanceof ChannelInboundHandler) { throw new NoSuchBufferException(String.format(
throw new NoSuchBufferException(String.format( "the handler '%s' has no inbound message buffer; it does not implement %s.",
"the handler '%s' has no inbound message buffer; it implements %s, but " + name, ChannelInboundMessageHandler.class.getSimpleName()));
"its newInboundBuffer() method created a %s.",
name, ChannelInboundHandler.class.getSimpleName(),
ByteBuf.class.getSimpleName()));
} else {
throw new NoSuchBufferException(String.format(
"the handler '%s' has no inbound message buffer; it does not implement %s.",
name, ChannelInboundHandler.class.getSimpleName()));
}
} }
return (MessageBuf<T>) inMsgBuf; return (MessageBuf<T>) inMsgBuf;
} }
@ -448,17 +432,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
@Override @Override
public ByteBuf outboundByteBuffer() { public ByteBuf outboundByteBuffer() {
if (outByteBuf == null) { if (outByteBuf == null) {
if (handler() instanceof ChannelOutboundHandler) { throw new NoSuchBufferException(String.format(
throw new NoSuchBufferException(String.format( "the handler '%s' has no outbound byte buffer; it does not implement %s.",
"the handler '%s' has no outbound byte buffer; it implements %s, but " + name, ChannelOutboundByteHandler.class.getSimpleName()));
"its newOutboundBuffer() method created a %s.",
name, ChannelOutboundHandler.class.getSimpleName(),
MessageBuf.class.getSimpleName()));
} else {
throw new NoSuchBufferException(String.format(
"the handler '%s' has no outbound byte buffer; it does not implement %s.",
name, ChannelOutboundHandler.class.getSimpleName()));
}
} }
return outByteBuf; return outByteBuf;
} }
@ -467,17 +443,9 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> MessageBuf<T> outboundMessageBuffer() { public <T> MessageBuf<T> outboundMessageBuffer() {
if (outMsgBuf == null) { if (outMsgBuf == null) {
if (handler() instanceof ChannelOutboundHandler) { throw new NoSuchBufferException(String.format(
throw new NoSuchBufferException(String.format( "the handler '%s' has no outbound message buffer; it does not implement %s.",
"the handler '%s' has no outbound message buffer; it implements %s, but " + name, ChannelOutboundMessageHandler.class.getSimpleName()));
"its newOutboundBuffer() method created a %s.",
name, ChannelOutboundHandler.class.getSimpleName(),
ByteBuf.class.getSimpleName()));
} else {
throw new NoSuchBufferException(String.format(
"the handler '%s' has no outbound message buffer; it does not implement %s.",
name, ChannelOutboundHandler.class.getSimpleName()));
}
} }
return (MessageBuf<T>) outMsgBuf; return (MessageBuf<T>) outMsgBuf;
} }