Program: 83965
Project: 83965
Buggy source:
/** 
 * Get the piece of the string that is ahead of this URI.  Remove parameters if symlink is to local resource,  leave the params if this symlink points to another is4 server (url_link is not null).
 */
private String getTailResourceUri(HttpExchange exchange,boolean removeParams){
  String requestUri=null;
  if (exchangeJSON.containsKey("String_Node_Str")) {
    requestUri=exchangeJSON.getString("String_Node_Str");
    logger.info("String_Node_Str" + requestUri);
    exchangeJSON.discard("String_Node_Str");
  }
 else {
    requestUri=exchange.getRequestURI().toString();
  }
  String myUri=URI;
  if (requestUri.contains("String_Node_Str") && requestUri.contains("String_Node_Str")) {
    String transReqUri=requestUri.substring(0,requestUri.indexOf("String_Node_Str"));
    if (transReqUri.endsWith("String_Node_Str")) {
      requestUri=requestUri.replace(transReqUri,URI + "String_Node_Str");
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && !transReqUri.endsWith("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && transReqUri.endsWith("String_Node_Str") && transReqUri.indexOf("String_Node_Str") < transReqUri.lastIndexOf("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else {
      requestUri=requestUri.replace(transReqUri,URI);
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
  }
 else   if (requestUri.contains("String_Node_Str") && !requestUri.contains("String_Node_Str")) {
    String transReqUri=requestUri;
    if (transReqUri.endsWith("String_Node_Str")) {
      requestUri=requestUri.replace(transReqUri,URI + "String_Node_Str");
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && !transReqUri.endsWith("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && transReqUri.endsWith("String_Node_Str") && transReqUri.indexOf("String_Node_Str") < transReqUri.lastIndexOf("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else {
      requestUri=requestUri.replace(transReqUri,URI);
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
  }
  String paramsStr=null;
  if (requestUri.contains("String_Node_Str")) {
    paramsStr=requestUri.substring(requestUri.indexOf("String_Node_Str"),requestUri.length());
    requestUri=requestUri.replace(paramsStr,"String_Node_Str");
  }
  if (requestUri.endsWith("String_Node_Str"))   requestUri=requestUri.substring(0,requestUri.length() - 1);
  if (myUri.endsWith("String_Node_Str"))   myUri=myUri.substring(0,myUri.length() - 1);
  String tailResources=requestUri.replace(myUri,"String_Node_Str");
  logger.info("String_Node_Str" + myUri + "String_Node_Str"+ requestUri+ "String_Node_Str"+ tailResources);
  if (tailResources.startsWith("String_Node_Str"))   tailResources=tailResources.substring(1,tailResources.length());
  if (!removeParams && paramsStr != null)   tailResources=tailResources.concat(paramsStr);
  return tailResources;
}

Fixed version (ground truth):
/** 
 * Get the piece of the string that is ahead of this URI.  Remove parameters if symlink is to local resource,  leave the params if this symlink points to another is4 server (url_link is not null).
 */
private String getTailResourceUri(HttpExchange exchange,boolean removeParams){
  String requestUri=null;
  if (exchangeJSON.containsKey("String_Node_Str")) {
    requestUri=exchangeJSON.getString("String_Node_Str");
    logger.info("String_Node_Str" + requestUri);
    exchangeJSON.discard("String_Node_Str");
  }
 else {
    requestUri=exchangeJSON.getString("String_Node_Str");
  }
  String myUri=URI;
  if (requestUri.contains("String_Node_Str") && requestUri.contains("String_Node_Str")) {
    String transReqUri=requestUri.substring(0,requestUri.indexOf("String_Node_Str"));
    if (transReqUri.endsWith("String_Node_Str")) {
      requestUri=requestUri.replace(transReqUri,URI + "String_Node_Str");
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && !transReqUri.endsWith("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && transReqUri.endsWith("String_Node_Str") && transReqUri.indexOf("String_Node_Str") < transReqUri.lastIndexOf("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else {
      requestUri=requestUri.replace(transReqUri,URI);
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
  }
 else   if (requestUri.contains("String_Node_Str") && !requestUri.contains("String_Node_Str")) {
    String transReqUri=requestUri;
    if (transReqUri.endsWith("String_Node_Str")) {
      requestUri=requestUri.replace(transReqUri,URI + "String_Node_Str");
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && !transReqUri.endsWith("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else     if (transReqUri.contains("String_Node_Str") && transReqUri.endsWith("String_Node_Str") && transReqUri.indexOf("String_Node_Str") < transReqUri.lastIndexOf("String_Node_Str")) {
      String res=processMidStarReq(transReqUri);
      if (res != null)       requestUri=res;
      logger.fine("String_Node_Str" + requestUri);
    }
 else {
      requestUri=requestUri.replace(transReqUri,URI);
      logger.info("String_Node_Str" + transReqUri + "String_Node_Str"+ URI+ "String_Node_Str"+ requestUri);
    }
  }
  String paramsStr=null;
  if (requestUri.contains("String_Node_Str")) {
    paramsStr=requestUri.substring(requestUri.indexOf("String_Node_Str"),requestUri.length());
    requestUri=requestUri.replace(paramsStr,"String_Node_Str");
  }
  if (requestUri.endsWith("String_Node_Str"))   requestUri=requestUri.substring(0,requestUri.length() - 1);
  if (myUri.endsWith("String_Node_Str"))   myUri=myUri.substring(0,myUri.length() - 1);
  String tailResources=requestUri.replace(myUri,"String_Node_Str");
  logger.info("String_Node_Str" + myUri + "String_Node_Str"+ requestUri+ "String_Node_Str"+ tailResources);
  if (tailResources.startsWith("String_Node_Str"))   tailResources=tailResources.substring(1,tailResources.length());
  if (!removeParams && paramsStr != null)   tailResources=tailResources.concat(paramsStr);
  return tailResources;
}