Program: 151946
Project: 151946
Buggy source:
private void handleHttpRequest(ChannelHandlerContext ctx,HttpRequest req) throws Exception {
  String reqURI=req.getUri();
  if (reqURI.contains(POLLING_PATH)) {
    String[] parts=reqURI.split("String_Node_Str");
    String ID=parts.length > 3 ? parts[3] : "String_Node_Str";
    PollingIOClient client=(PollingIOClient)this.pollingClients.get(ID);
    if (client == null) {
      client=connectPoller(ctx);
      client.Reconnect(ctx,req);
      return;
    }
    if (req.getMethod() == GET) {
      client.heartbeat();
      client.Reconnect(ctx,req);
    }
 else {
      QueryStringDecoder decoder=new QueryStringDecoder("String_Node_Str" + req.getContent().toString(CharsetUtil.UTF_8));
      String message=decoder.getParameters().get("String_Node_Str").get(0);
      handleMessage(client,message);
      sendHttpResponse(ctx,req,new DefaultHttpResponse(HTTP_1_1,OK));
    }
    return;
  }
  String location="String_Node_Str";
  if (reqURI.equals(WEBSOCKET_PATH)) {
    location=getWebSocketLocation(req);
  }
 else   if (reqURI.equals(FLASHSOCKET_PATH)) {
    location=getFlashSocketLocation(req);
  }
  if (location != "String_Node_Str" && Values.UPGRADE.equalsIgnoreCase(req.getHeader(CONNECTION)) && WEBSOCKET.equalsIgnoreCase(req.getHeader(Names.UPGRADE))) {
    HttpResponse res=new DefaultHttpResponse(HTTP_1_1,new HttpResponseStatus(101,"String_Node_Str"));
    res.addHeader(Names.UPGRADE,WEBSOCKET);
    res.addHeader(CONNECTION,Values.UPGRADE);
    if (req.containsHeader(SEC_WEBSOCKET_KEY1) && req.containsHeader(SEC_WEBSOCKET_KEY2)) {
      res.addHeader(SEC_WEBSOCKET_ORIGIN,req.getHeader(ORIGIN));
      res.addHeader(SEC_WEBSOCKET_LOCATION,getWebSocketLocation(req));
      String protocol=req.getHeader(SEC_WEBSOCKET_PROTOCOL);
      if (protocol != null) {
        res.addHeader(SEC_WEBSOCKET_PROTOCOL,protocol);
      }
      String key1=req.getHeader(SEC_WEBSOCKET_KEY1);
      String key2=req.getHeader(SEC_WEBSOCKET_KEY2);
      int a=(int)(Long.parseLong(key1.replaceAll("String_Node_Str","String_Node_Str")) / key1.replaceAll("String_Node_Str","String_Node_Str").length());
      int b=(int)(Long.parseLong(key2.replaceAll("String_Node_Str","String_Node_Str")) / key2.replaceAll("String_Node_Str","String_Node_Str").length());
      long c=req.getContent().readLong();
      ChannelBuffer input=ChannelBuffers.buffer(16);
      input.writeInt(a);
      input.writeInt(b);
      input.writeLong(c);
      ChannelBuffer output=ChannelBuffers.wrappedBuffer(MessageDigest.getInstance("String_Node_Str").digest(input.array()));
      res.setContent(output);
    }
 else {
      res.addHeader(WEBSOCKET_ORIGIN,req.getHeader(ORIGIN));
      res.addHeader(WEBSOCKET_LOCATION,getWebSocketLocation(req));
      String protocol=req.getHeader(WEBSOCKET_PROTOCOL);
      if (protocol != null) {
        res.addHeader(WEBSOCKET_PROTOCOL,protocol);
      }
    }
    ChannelPipeline p=ctx.getChannel().getPipeline();
    p.remove("String_Node_Str");
    p.replace("String_Node_Str","String_Node_Str",new WebSocketFrameDecoder());
    ctx.getChannel().write(res);
    p.replace("String_Node_Str","String_Node_Str",new WebSocketFrameEncoder());
    connectSocket(ctx);
    return;
  }
  sendHttpResponse(ctx,req,new DefaultHttpResponse(HTTP_1_1,FORBIDDEN));
}

Fixed version (ground truth):
private void handleHttpRequest(ChannelHandlerContext ctx,HttpRequest req) throws Exception {
  String reqURI=req.getUri();
  if (reqURI.contains(POLLING_PATH)) {
    String[] parts=reqURI.split("String_Node_Str");
    String ID=parts.length > 3 ? parts[3] : "String_Node_Str";
    PollingIOClient client=(PollingIOClient)this.pollingClients.get(ID);
    if (client == null) {
      client=connectPoller(ctx);
      client.Reconnect(ctx,req);
      return;
    }
    if (req.getMethod() == GET) {
      client.heartbeat();
      client.Reconnect(ctx,req);
    }
 else {
      QueryStringDecoder decoder=new QueryStringDecoder("String_Node_Str" + req.getContent().toString(CharsetUtil.UTF_8));
      String message=decoder.getParameters().get("String_Node_Str").get(0);
      handleMessage(client,message);
      setKeepAlive(req,false);
      HttpResponse resp=new DefaultHttpResponse(HTTP_1_1,OK);
      resp.addHeader("String_Node_Str","String_Node_Str");
      sendHttpResponse(ctx,req,resp);
    }
    return;
  }
  String location="String_Node_Str";
  if (reqURI.equals(WEBSOCKET_PATH)) {
    location=getWebSocketLocation(req);
  }
 else   if (reqURI.equals(FLASHSOCKET_PATH)) {
    location=getFlashSocketLocation(req);
  }
  if (location != "String_Node_Str" && Values.UPGRADE.equalsIgnoreCase(req.getHeader(CONNECTION)) && WEBSOCKET.equalsIgnoreCase(req.getHeader(Names.UPGRADE))) {
    HttpResponse res=new DefaultHttpResponse(HTTP_1_1,new HttpResponseStatus(101,"String_Node_Str"));
    res.addHeader(Names.UPGRADE,WEBSOCKET);
    res.addHeader(CONNECTION,Values.UPGRADE);
    if (req.containsHeader(SEC_WEBSOCKET_KEY1) && req.containsHeader(SEC_WEBSOCKET_KEY2)) {
      res.addHeader(SEC_WEBSOCKET_ORIGIN,req.getHeader(ORIGIN));
      res.addHeader(SEC_WEBSOCKET_LOCATION,getWebSocketLocation(req));
      String protocol=req.getHeader(SEC_WEBSOCKET_PROTOCOL);
      if (protocol != null) {
        res.addHeader(SEC_WEBSOCKET_PROTOCOL,protocol);
      }
      String key1=req.getHeader(SEC_WEBSOCKET_KEY1);
      String key2=req.getHeader(SEC_WEBSOCKET_KEY2);
      int a=(int)(Long.parseLong(key1.replaceAll("String_Node_Str","String_Node_Str")) / key1.replaceAll("String_Node_Str","String_Node_Str").length());
      int b=(int)(Long.parseLong(key2.replaceAll("String_Node_Str","String_Node_Str")) / key2.replaceAll("String_Node_Str","String_Node_Str").length());
      long c=req.getContent().readLong();
      ChannelBuffer input=ChannelBuffers.buffer(16);
      input.writeInt(a);
      input.writeInt(b);
      input.writeLong(c);
      ChannelBuffer output=ChannelBuffers.wrappedBuffer(MessageDigest.getInstance("String_Node_Str").digest(input.array()));
      res.setContent(output);
    }
 else {
      res.addHeader(WEBSOCKET_ORIGIN,req.getHeader(ORIGIN));
      res.addHeader(WEBSOCKET_LOCATION,getWebSocketLocation(req));
      String protocol=req.getHeader(WEBSOCKET_PROTOCOL);
      if (protocol != null) {
        res.addHeader(WEBSOCKET_PROTOCOL,protocol);
      }
    }
    ChannelPipeline p=ctx.getChannel().getPipeline();
    p.remove("String_Node_Str");
    p.replace("String_Node_Str","String_Node_Str",new WebSocketFrameDecoder());
    ctx.getChannel().write(res);
    p.replace("String_Node_Str","String_Node_Str",new WebSocketFrameEncoder());
    connectSocket(ctx);
    return;
  }
  sendHttpResponse(ctx,req,new DefaultHttpResponse(HTTP_1_1,FORBIDDEN));
}