Source:
protected void processLine(final ChannelHandlerContext ctx, String message) { if (message.isEmpty()) return; DataFormat dataFormat = DataFormat.autodetect(message); switch (dataFormat) { case SOURCE_TAG: ReportableEntityHandler<ReportSourceTag> sourceTagHandler = sourceTagHandlerSupplier.get(); if (sourceTagHandler == null || sourceTagDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept " + "sourceTag-formatted data!"); return; } List<ReportSourceTag> output = Lists.newArrayListWithCapacity(1); try { sourceTagDecoder.decode(message, output, "dummy"); for (ReportSourceTag tag : output) { sourceTagHandler.report(tag); } } catch (Exception e) { sourceTagHandler.reject(message, formatErrorMessage("WF-300 Cannot parse: \"" + message + "\"", e, ctx)); } return; case EVENT: ReportableEntityHandler<Event> eventHandler = eventHandlerSupplier.get(); if (eventHandler == null || eventDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept event data!"); return; } List<Event> events = Lists.newArrayListWithCapacity(1); try { eventDecoder.decode(message, events, "dummy"); for (Event event : events) { eventHandler.report(event); } } catch (Exception e) { eventHandler.reject(message, formatErrorMessage("WF-300 Cannot parse: \"" + message + "\"", e, ctx)); } return; case HISTOGRAM: ReportableEntityHandler<ReportPoint> histogramHandler = histogramHandlerSupplier.get(); if (histogramHandler == null || histogramDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept " + "histogram-formatted data!"); return; } message = annotator == null ? message : annotator.apply(ctx, message); preprocessAndHandlePoint(message, histogramDecoder, histogramHandler, preprocessorSupplier, ctx); return; default: message = annotator == null ? message : annotator.apply(ctx, message); preprocessAndHandlePoint(message, wavefrontDecoder, wavefrontHandler, preprocessorSupplier, ctx); } }

Target:
protected void processLine(final ChannelHandlerContext ctx, String message) { if (message.isEmpty()) return; DataFormat dataFormat = DataFormat.autodetect(message); switch (dataFormat) { case SOURCE_TAG: ReportableEntityHandler<ReportSourceTag> sourceTagHandler = sourceTagHandlerSupplier.get(); if (sourceTagHandler == null || sourceTagDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept " + "sourceTag-formatted data!"); return; } List<ReportSourceTag> output = Lists.newArrayListWithCapacity(1); try { sourceTagDecoder.decode(message, output, "dummy"); for (ReportSourceTag tag : output) { sourceTagHandler.report(tag); } } catch (Exception e) { sourceTagHandler.reject(message, formatErrorMessage("WF-300 Cannot parse: \"" + message + "\"", e, ctx)); } return; case EVENT: ReportableEntityHandler<ReportEvent> eventHandler = eventHandlerSupplier.get(); if (eventHandler == null || eventDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept event data!"); return; } List<ReportEvent> events = Lists.newArrayListWithCapacity(1); try { eventDecoder.decode(message, events, "dummy"); for (ReportEvent event : events) { eventHandler.report(event); } } catch (Exception e) { eventHandler.reject(message, formatErrorMessage("WF-300 Cannot parse: \"" + message + "\"", e, ctx)); } return; case HISTOGRAM: ReportableEntityHandler<ReportPoint> histogramHandler = histogramHandlerSupplier.get(); if (histogramHandler == null || histogramDecoder == null) { wavefrontHandler.reject(message, "Port is not configured to accept " + "histogram-formatted data!"); return; } message = annotator == null ? message : annotator.apply(ctx, message); preprocessAndHandlePoint(message, histogramDecoder, histogramHandler, preprocessorSupplier, ctx); return; default: message = annotator == null ? message : annotator.apply(ctx, message); preprocessAndHandlePoint(message, wavefrontDecoder, wavefrontHandler, preprocessorSupplier, ctx); } }