Source:
<code>public void channelRead(ChannelHandlerContext ctx, Object msg) { try { if (msg instanceof CorfuMsg) { CorfuMsg m = ((CorfuMsg) msg); AbstractServer handler = handlerMap.get(m.getMsgType()); if (handler == null) { log.warn("channelRead: Received unregistered message {}, dropping", m); } else { if (messageIsValid(m, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Message routed to {}: {}", handler.getClass().getSimpleName(), msg); } try { handler.handleMessage(m, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", m != null ? m.getMsgType() : "UNKNOWN", t.getClass().getSimpleName(), t.getMessage(), t); } } } } else if (msg instanceof RequestMsg) { RequestMsg request = ((RequestMsg) msg); RequestPayloadMsg payload = request.getPayload(); if (log.isDebugEnabled()) { log.debug("channelRead: Request from {}", payload.getPayloadCase().toString(), ctx.channel().remoteAddress()); } AbstractServer handler = requestTypeHandlerMap.get(payload.getPayloadCase()); if (handler == null) { log.warn("channelRead: Received unregistered request {}, dropping", payload.getPayloadCase().toString()); } else { <START> if (requestIsValid(request, ctx)) { <END> if (log.isTraceEnabled()) { log.trace("channelRead: Request routed to {}: {}", handler.getClass().getSimpleName(), request); } try { handler.handleRequest(request, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", payload.getPayloadCase().toString(), t.getClass().getSimpleName(), t.getMessage(), t); } } } } } catch (Exception e) { log.error("channelRead: Exception during read!", e); } }</code><technical_language>this is more a check - sends out a message. split check action for clarity perhaps</technical_language>

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof CorfuMsg) { CorfuMsg m = ((CorfuMsg) msg); AbstractServer handler = handlerMap.get(m.getMsgType()); if (handler == null) { log.warn("channelRead: Received unregistered message {}, dropping", m); } else { if (messageIsValid(m, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Message routed to {}: {}", handler.getClass().getSimpleName(), msg); } try { handler.handleMessage(m, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", m != null ? m.getMsgType() : "UNKNOWN", t.getClass().getSimpleName(), t.getMessage(), t); } } } } else if (msg instanceof RequestMsg) { RequestMsg request = ((RequestMsg) msg); RequestPayloadMsg payload = request.getPayload(); AbstractServer handler = requestTypeHandlerMap.get(payload.getPayloadCase()); if (handler == null) { log.warn("channelRead: Received unregistered request {}, dropping", payload.getPayloadCase()); } else { if (validateRequest(request, ctx)) { if (log.isTraceEnabled()) { log.trace("channelRead: Request routed to {}: {}", handler.getClass().getSimpleName(), request); } try { handler.handleMessage(request, ctx, this); } catch (Throwable t) { log.error("channelRead: Handling failed due to {}:{}", payload.getPayloadCase(), t.getClass().getSimpleName(), t.getMessage(), t); } } } } else { log.error("channelRead: Unknown message of class received", msg.getClass()); } }