Program: 1758
Project: 1758
Buggy source:
public void incoming(StrestRequest request){
  boolean isStrest=StrestUtil.isStrest(request);
  try {
    StrestUtil.validateRequest(request);
  }
 catch (  StrestException x) {
    log.error("String_Node_Str",x);
    if (request.getConnectionChannel() != null) {
      request.getConnectionChannel().cleanup();
    }
    return;
  }
  ResponseBuilder response=new ResponseBuilder(request);
  String txnId=request.getTxnId();
  request.getConnectionChannel().incoming(request);
  log.info("String_Node_Str" + request);
  StrestController controller=null;
  try {
    try {
      controller=this.getRouteLookup().find(request.getUri());
      if (controller == null) {
        throw StrestHttpException.NOT_FOUND();
      }
      controller.setRouter(this);
      controller.setStrest(isStrest);
      if (isStrest) {
        controller.setStrestTxnId(txnId);
      }
      controller.setParamsGET(DynMapFactory.instanceFromURL(request.getUri()));
      controller.getParams().putAll(request.getParams());
      String contentType=request.getHeader(CONTENT_TYPE);
      if (contentType != null) {
        String pms=request.getContent().toString();
        if (pms != null) {
          if (contentType.contains("String_Node_Str")) {
            controller.setParamsPOST(DynMapFactory.instanceFromURLEncoded(pms));
          }
 else           if (contentType.contains("String_Node_Str")) {
            controller.setParamsPOST(DynMapFactory.instanceFromJSON(pms));
          }
        }
      }
      controller.getParams().putAll(controller.getParamsGET());
      controller.getParams().putAll(controller.getParamsPOST());
      controller.setRequest(request);
      controller.setResponse(response.getResponse());
      for (      StrestControllerFilter f : this.getFilters(controller)) {
        f.before(controller);
      }
      if (!controller.isSkipExecution()) {
        if (request.getMethod() == StrestHeader.Method.GET) {
          controller.handleGET(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.POST) {
          controller.handlePOST(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.PUT) {
          controller.handlePUT(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.DELETE) {
          controller.handleDELETE(controller.getParams());
        }
 else {
          throw StrestHttpException.METHOD_NOT_ALLOWED();
        }
        if (this.isAsync(controller,request.getMethod())) {
        }
      }
    }
 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(TxnStatus.COMPLETED);
    if (controller != null) {
      for (      StrestControllerFilter f : this.getFilters(controller)) {
        f.error(controller,response.getResponse(),e);
      }
    }
    try {
      this.sendResponse(request,response);
    }
 catch (    Exception e1) {
      log.error("String_Node_Str",e);
    }
    return;
  }
  this.finishResponse(controller,response);
}

Fixed version (ground truth):
public void incoming(StrestRequest request){
  boolean isStrest=StrestUtil.isStrest(request);
  try {
    StrestUtil.validateRequest(request);
  }
 catch (  StrestException x) {
    log.error("String_Node_Str",x);
    if (request.getConnectionChannel() != null) {
      request.getConnectionChannel().cleanup();
    }
    return;
  }
  ResponseBuilder response=new ResponseBuilder(request);
  String txnId=request.getTxnId();
  request.getConnectionChannel().incoming(request);
  StrestController controller=null;
  try {
    try {
      controller=this.getRouteLookup().find(request.getUri());
      if (controller == null) {
        throw StrestHttpException.NOT_FOUND();
      }
      controller.setRouter(this);
      controller.setStrest(isStrest);
      if (isStrest) {
        controller.setStrestTxnId(txnId);
      }
      controller.setParamsGET(DynMapFactory.instanceFromURL(request.getUri()));
      controller.getParams().putAll(request.getParams());
      String contentType=request.getHeader(CONTENT_TYPE);
      if (contentType != null) {
        String pms=request.getContent().toString();
        if (pms != null) {
          if (contentType.contains("String_Node_Str")) {
            controller.setParamsPOST(DynMapFactory.instanceFromURLEncoded(pms));
          }
 else           if (contentType.contains("String_Node_Str")) {
            controller.setParamsPOST(DynMapFactory.instanceFromJSON(pms));
          }
        }
      }
      controller.getParams().putAll(controller.getParamsGET());
      controller.getParams().putAll(controller.getParamsPOST());
      controller.setRequest(request);
      controller.setResponse(response.getResponse());
      for (      StrestControllerFilter f : this.getFilters(controller)) {
        f.before(controller);
      }
      if (!controller.isSkipExecution()) {
        if (request.getMethod() == StrestHeader.Method.GET) {
          controller.handleGET(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.POST) {
          controller.handlePOST(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.PUT) {
          controller.handlePUT(controller.getParams());
        }
 else         if (request.getMethod() == StrestHeader.Method.DELETE) {
          controller.handleDELETE(controller.getParams());
        }
 else {
          throw StrestHttpException.METHOD_NOT_ALLOWED();
        }
        if (this.isAsync(controller,request.getMethod())) {
        }
      }
    }
 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(TxnStatus.COMPLETED);
    if (controller != null) {
      for (      StrestControllerFilter f : this.getFilters(controller)) {
        f.error(controller,response.getResponse(),e);
      }
    }
    try {
      this.sendResponse(request,response);
    }
 catch (    Exception e1) {
      log.error("String_Node_Str",e);
    }
    return;
  }
  this.finishResponse(controller,response);
}