Buggy code:
public class PlayHandler extends SimpleChannelUpstreamHandler { private static final String signature = ( ( "Play!<seq2seq4repair_space>Framework;" + ( Play . version ) ) + ";" ) + ( mode . name ( ) . toLowerCase ( ) ) ; private static final boolean exposePlayServer ; private static final String ACCEPT_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" ; private static final Charset ASCII = Charset . forName ( "ASCII" ) ; private static final MessageDigest SHA_1 ; private WebSocketServerHandshaker handshaker ; @ Override public void messageReceived ( final ChannelHandlerContext ctx , final MessageEvent messageEvent ) throws Exception { } private static final Map < String , RenderStatic > staticPathsCache = new HashMap < String , RenderStatic > ( ) ; public class NettyInvocation extends Invoker . Invocation { private final ChannelHandlerContext ctx ; private final Request request ; private final Response response ; private final HttpRequest nettyRequest ; private final MessageEvent event ; public NettyInvocation ( Request request , Response response , ChannelHandlerContext ctx , HttpRequest nettyRequest , MessageEvent e ) { } @ Override public boolean init ( ) { } @ Override public InvocationContext getInvocationContext ( ) { } @ Override public void run ( ) { } @ Override public void execute ( ) throws Exception { } @ Override public void onSuccess ( ) throws Exception { } } void saveExceededSizeError ( HttpRequest nettyRequest , Request request , Response response ) { } protected static void addToResponse ( Response response , HttpResponse nettyResponse ) { } protected static void writeResponse ( ChannelHandlerContext ctx , Response response , HttpResponse nettyResponse , HttpRequest nettyRequest ) { } public void copyResponse ( ChannelHandlerContext ctx , Request request , Response response , HttpRequest nettyRequest ) throws Exception { } static String getRemoteIPAddress ( MessageEvent e ) { } public Request parseRequest ( ChannelHandlerContext ctx , HttpRequest nettyRequest , MessageEvent messageEvent ) throws Exception { } protected static Map < String , Http . Header > getHeaders ( HttpRequest nettyRequest ) { } protected static Map < String , Http . Cookie > getCookies ( HttpRequest nettyRequest ) { } @ Override public void exceptionCaught ( ChannelHandlerContext ctx , ExceptionEvent e ) throws Exception { } public static void serve404 ( NotFound e , ChannelHandlerContext ctx , Request request , HttpRequest nettyRequest ) { } protected static Map < String , Object > getBindingForErrors ( Exception e , boolean isError ) { } public static void serve500 ( Exception e , ChannelHandlerContext ctx , HttpRequest nettyRequest ) { } public void serveStatic ( RenderStatic renderStatic , ChannelHandlerContext ctx , Request request , Response response , HttpRequest nettyRequest , MessageEvent e ) { } public static boolean isModified ( String etag , long last , HttpRequest nettyRequest ) { } private static HttpResponse addEtag ( HttpRequest nettyRequest , HttpResponse httpResponse , File file ) { } public static boolean isKeepAlive ( HttpMessage message ) { } public static void setContentLength ( HttpMessage message , long contentLength ) { } final ChunkedWriteHandler chunkedWriteHandler = new ChunkedWriteHandler ( ) ; static class LazyChunkedInput implements ChunkedInput { private boolean closed = false ; private ConcurrentLinkedQueue < byte [ ] > nextChunks = new ConcurrentLinkedQueue < byte [ ] > ( ) ; public boolean hasNextChunk ( ) throws Exception { } public Object nextChunk ( ) throws Exception { } public boolean isEndOfInput ( ) throws Exception { } public void close ( ) throws Exception { } public void writeChunk ( Object chunk ) throws Exception { } } public void writeChunk ( Request playRequest , Response playResponse , ChannelHandlerContext ctx , HttpRequest nettyRequest , Object chunk ) { } public void closeChunked ( Request playRequest , Response playResponse , ChannelHandlerContext ctx , HttpRequest nettyRequest ) { } static final Map < ChannelHandlerContext , Http . Inbound > channels = new ConcurrentHashMap < ChannelHandlerContext , Http . Inbound > ( ) ; private void websocketFrameReceived ( final ChannelHandlerContext ctx , WebSocketFrame webSocketFrame ) { } private String getWebSocketLocation ( HttpRequest req ) { } private void websocketHandshake ( final ChannelHandlerContext ctx , HttpRequest req , MessageEvent messageEvent ) throws Exception { Integer max = Integer . valueOf ( configuration . getProperty ( "play.netty.maxContentLength" , "65345" ) ) ; ctx . getPipeline ( ) . addLast ( "fake-aggregator" , new HttpChunkAggregator ( max ) ) ; try { WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory ( this . getWebSocketLocation ( req ) , null , false ) ; this . handshaker = wsFactory . newHandshaker ( req ) ; if ( ( this . handshaker ) == null ) { wsFactory . sendUnsupportedWebSocketVersionResponse ( ctx . getChannel ( ) ) ; } else { try { this . handshaker . handshake ( ctx . getChannel ( ) , req ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } finally { try { ctx . getPipeline ( ) . remove ( "fake-aggregator" ) ; } catch ( Exception e ) { } } Http . Request request = parseRequest ( ctx , req , messageEvent ) ; request . method = "WS" ; Map < String , String > route = Router . route ( request . method , request . path ) ; if ( ! ( route . containsKey ( "action" ) ) ) { ctx . getChannel ( ) . write ( new DefaultHttpResponse ( HttpVersion . HTTP_1_1 , HttpResponseStatus . NOT_FOUND ) ) ; return ; } <START_BUG> Http . Inbound inbound = new Http . Inbound ( ) { <END_BUG> @ Override public boolean isOpen ( ) { return ctx . getChannel ( ) . isOpen ( ) ; } } ; PlayHandler . channels . put ( ctx , inbound ) ; Http . Outbound outbound = new Http . Outbound ( ) { final List < ChannelFuture > writeFutures = Collections . synchronizedList ( new ArrayList < ChannelFuture > ( ) ) ; Promise < Void > closeTask ; synchronized void writeAndClose ( ChannelFuture writeFuture ) { if ( ! ( writeFuture . isDone ( ) ) ) { writeFutures . add ( writeFuture ) ; writeFuture . addListener ( new ChannelFutureListener ( ) { public void operationComplete ( ChannelFuture cf ) throws Exception { writeFutures . remove ( cf ) ; futureClose ( ) ; } }

Fix:
Http . Inbound inbound = new Http . Inbound ( ctx ) {