Program: 1764
Project: 1764
Buggy source:
public void incoming(Channel channel,HttpRequest request){
  boolean isStrest=StrestUtil.isStrest(request);
  ResponseBuilder response=new ResponseBuilder(request);
  this.connections.putIfAbsent(channel,new StrestConnectionChannel(channel));
  StrestConnectionChannel con=this.connections.get(channel);
  String txnId=request.getHeader(StrestUtil.HEADERS.TXN_ID);
  con.incoming(request);
  StrestController controller=null;
  try {
    try {
      controller=this.getRouteLookup().find(request.getUri());
      if (controller == null) {
        throw StrestHttpException.NOT_FOUND();
      }
      controller.setStrest(isStrest);
      if (isStrest) {
        controller.setStrestTxnId(txnId);
      }
      controller.setParamsGET(DynMapFactory.instanceFromURL(request.getUri()));
      String contentType=request.getHeader(CONTENT_TYPE);
      if (contentType != null && contentType.contains("String_Node_Str")) {
        String pms=request.getContent().toString(Charset.forName("String_Node_Str"));
        if (pms != null) {
          controller.setParamsPOST(DynMapFactory.instanceFromURL(pms));
        }
      }
      controller.getParams().putAll(controller.getParamsGET());
      controller.getParams().putAll(controller.getParamsPOST());
      controller.setRequest(request);
      controller.setResponse(response.getResponse());
      controller.setChannelConnection(con);
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.before(controller);
      }
      for (      StrestControllerFilter f : this.defaultFilters) {
        f.before(controller);
      }
      if (request.getMethod() == HttpMethod.GET) {
        controller.handleGET(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.POST) {
        controller.handlePOST(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.PUT) {
        controller.handlePUT(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        controller.handleDELETE(controller.getParams());
      }
 else {
        throw StrestHttpException.METHOD_NOT_ALLOWED();
      }
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.after(controller);
      }
      for (      StrestControllerFilter f : this.defaultFilters) {
        f.after(controller);
      }
      response.setResponse(controller.getResponse());
      if (!controller.isSendResponse()) {
        log.info("String_Node_Str");
        return;
      }
    }
 catch (    StrestHttpException e) {
      throw e;
    }
catch (    Exception x) {
      StrestHttpException e=StrestHttpException.INTERNAL_SERVER_ERROR();
      e.setCause(x);
      log.error("String_Node_Str",x);
      throw e;
    }
  }
 catch (  StrestHttpException e) {
    response.status(e.getCode(),e.getMessage());
    response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE);
    if (controller != null) {
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.error(controller,response.getResponse(),e);
      }
    }
    for (    StrestControllerFilter f : this.defaultFilters) {
      f.error(controller,response.getResponse(),e);
    }
  }
  String txnStatus=response.getTxnStatus();
  if (txnStatus == null) {
    txnStatus=StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE;
  }
  if (StrestUtil.HEADERS.TXN_ACCEPT_VALUES.SINGLE.equalsIgnoreCase(request.getHeader(StrestUtil.HEADERS.TXN_ACCEPT))) {
    txnStatus=StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE;
  }
  response.txnStatus(txnStatus);
  ChannelFuture future=con.sendMessage(response);
  if (!isStrest) {
    future.addListener(ChannelFutureListener.CLOSE);
    this.removeChannel(channel);
  }
}

Fixed version (ground truth):
public void incoming(Channel channel,HttpRequest request){
  boolean isStrest=StrestUtil.isStrest(request);
  ResponseBuilder response=new ResponseBuilder(request);
  this.connections.putIfAbsent(channel,new StrestConnectionChannel(channel));
  StrestConnectionChannel con=this.connections.get(channel);
  String txnId=request.getHeader(StrestUtil.HEADERS.TXN_ID);
  con.incoming(request);
  StrestController controller=null;
  try {
    try {
      controller=this.getRouteLookup().find(request.getUri());
      if (controller == null) {
        throw StrestHttpException.NOT_FOUND();
      }
      controller.setStrest(isStrest);
      if (isStrest) {
        controller.setStrestTxnId(txnId);
      }
      controller.setParamsGET(DynMapFactory.instanceFromURL(request.getUri()));
      String contentType=request.getHeader(CONTENT_TYPE);
      if (contentType != null && contentType.contains("String_Node_Str")) {
        String pms=request.getContent().toString(Charset.forName("String_Node_Str"));
        if (pms != null) {
          controller.setParamsPOST(DynMapFactory.instanceFromURLEncoded(pms));
        }
      }
      controller.getParams().putAll(controller.getParamsGET());
      controller.getParams().putAll(controller.getParamsPOST());
      controller.setRequest(request);
      controller.setResponse(response.getResponse());
      controller.setChannelConnection(con);
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.before(controller);
      }
      for (      StrestControllerFilter f : this.defaultFilters) {
        f.before(controller);
      }
      if (request.getMethod() == HttpMethod.GET) {
        controller.handleGET(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.POST) {
        controller.handlePOST(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.PUT) {
        controller.handlePUT(controller.getParams());
      }
 else       if (request.getMethod() == HttpMethod.DELETE) {
        controller.handleDELETE(controller.getParams());
      }
 else {
        throw StrestHttpException.METHOD_NOT_ALLOWED();
      }
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.after(controller);
      }
      for (      StrestControllerFilter f : this.defaultFilters) {
        f.after(controller);
      }
      response.setResponse(controller.getResponse());
      if (!controller.isSendResponse()) {
        log.info("String_Node_Str");
        return;
      }
    }
 catch (    StrestHttpException e) {
      throw e;
    }
catch (    Exception x) {
      StrestHttpException e=StrestHttpException.INTERNAL_SERVER_ERROR();
      e.setCause(x);
      log.error("String_Node_Str",x);
      throw e;
    }
  }
 catch (  StrestHttpException e) {
    response.status(e.getCode(),e.getMessage());
    response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE);
    if (controller != null) {
      for (      StrestControllerFilter f : controller.getFilters()) {
        f.error(controller,response.getResponse(),e);
      }
    }
    for (    StrestControllerFilter f : this.defaultFilters) {
      f.error(controller,response.getResponse(),e);
    }
  }
  String txnStatus=response.getTxnStatus();
  if (txnStatus == null) {
    txnStatus=StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE;
  }
  if (StrestUtil.HEADERS.TXN_ACCEPT_VALUES.SINGLE.equalsIgnoreCase(request.getHeader(StrestUtil.HEADERS.TXN_ACCEPT))) {
    txnStatus=StrestUtil.HEADERS.TXN_STATUS_VALUES.COMPLETE;
  }
  response.txnStatus(txnStatus);
  ChannelFuture future=con.sendMessage(response);
  if (!isStrest) {
    future.addListener(ChannelFutureListener.CLOSE);
    this.removeChannel(channel);
  }
}