Program: 84499
Project: 84499
Buggy source:
/** 
 * Convenience method for pulling the correct page to redirect to out of the request
 * @param request the current request
 * @return the page to redirect to as determined by parameters in the request
 */
private String determineRedirect(HttpServletRequest request){
  String redirect=request.getParameter("String_Node_Str");
  if (redirect == null || redirect.equals("String_Node_Str")) {
    redirect=request.getParameter("String_Node_Str");
    if (redirect != null && !redirect.startsWith("String_Node_Str")) {
      Integer requestURLLength=request.getRequestURL().length();
      StringBuffer domainAndPort=request.getRequestURL();
      domainAndPort.delete(requestURLLength - request.getRequestURI().length(),requestURLLength);
      if (!redirect.startsWith(domainAndPort.toString()))       redirect=null;
      redirect=redirect.substring(redirect.indexOf("String_Node_Str",9));
    }
  }
  if (redirect == null || redirect.equals("String_Node_Str")) {
    redirect=request.getContextPath();
  }
 else   if (redirect.contains("String_Node_Str")) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (!redirect.startsWith(request.getContextPath())) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (redirect.endsWith(WebConstants.SETUP_PAGE_URL)) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (redirect.contains("String_Node_Str") || redirect.contains("String_Node_Str") || redirect.contains("String_Node_Str")) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
  log.debug("String_Node_Str" + redirect + "String_Node_Str");
  return redirect;
}

Fixed version (ground truth):
/** 
 * Convenience method for pulling the correct page to redirect to out of the request
 * @param request the current request
 * @return the page to redirect to as determined by parameters in the request
 */
private String determineRedirect(HttpServletRequest request){
  String redirect=request.getParameter("String_Node_Str");
  if (redirect == null || redirect.equals("String_Node_Str")) {
    redirect=request.getParameter("String_Node_Str");
    if (redirect != null && !redirect.startsWith("String_Node_Str")) {
      Integer requestURLLength=request.getRequestURL().length();
      StringBuffer domainAndPort=request.getRequestURL();
      domainAndPort.delete(requestURLLength - request.getRequestURI().length(),requestURLLength);
      if (!redirect.startsWith(domainAndPort.toString()))       redirect=null;
 else {
        redirect=redirect.substring(redirect.indexOf("String_Node_Str",9));
      }
    }
  }
  if (redirect == null || redirect.equals("String_Node_Str")) {
    redirect=request.getContextPath();
  }
 else   if (redirect.contains("String_Node_Str")) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (!redirect.startsWith(request.getContextPath())) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (redirect.endsWith(WebConstants.SETUP_PAGE_URL)) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
 else   if (redirect.contains("String_Node_Str") || redirect.contains("String_Node_Str") || redirect.contains("String_Node_Str")) {
    log.debug("String_Node_Str");
    redirect=request.getContextPath();
  }
  log.debug("String_Node_Str" + redirect + "String_Node_Str");
  return redirect;
}