Program: 89507
Project: 89507
Buggy source:
public void frontier_list(HttpServletRequest req,HttpServletResponse resp,List<Integer> numerics) throws IOException {
  Locale locale=resp.getLocale();
  resp.setContentType("String_Node_Str");
  ServletOutputStream out=resp.getOutputStream();
  Caching.caching_disable_headers(resp);
  TemplateBuilderFactory<MasterTemplateBuilder> masterTplBuilderFactory=TemplateBuilderFactory.getInstance(environment.templateMaster,"String_Node_Str","String_Node_Str",MasterTemplateBuilder.class);
  MasterTemplateBuilder masterTplBuilder=masterTplBuilderFactory.getTemplateBuilder();
  StringBuilder sb=new StringBuilder();
  long lines;
  long linesPerPage=100;
  long page=1;
  long pages=0;
  String q=null;
  String tmpStr;
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0) {
    try {
      page=Long.parseLong(tmpStr);
    }
 catch (    NumberFormatException e) {
    }
  }
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0) {
    try {
      linesPerPage=Long.parseLong(tmpStr);
    }
 catch (    NumberFormatException e) {
    }
  }
  if (linesPerPage < 25) {
    linesPerPage=25;
  }
  if (linesPerPage > 1000) {
    linesPerPage=1000;
  }
  String initials=req.getParameter("String_Node_Str");
  if (initials == null) {
    initials="String_Node_Str";
  }
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0 && !tmpStr.equalsIgnoreCase("String_Node_Str")) {
    q=tmpStr;
  }
 else {
    q="String_Node_Str";
  }
  String additionalParams="String_Node_Str";
  if (q.length() > 0) {
    additionalParams+="String_Node_Str" + URLEncoder.encode(q,"String_Node_Str");
  }
  if (initials.length() > 0) {
    additionalParams+="String_Node_Str" + URLEncoder.encode(initials,"String_Node_Str");
  }
  String script=environment.NAS_GROOVY_SCRIPT;
  String deleteStr=req.getParameter("String_Node_Str");
  if (deleteStr != null && "String_Node_Str".equals(deleteStr) && initials != null && initials.length() > 0) {
    script+="String_Node_Str";
    script+="String_Node_Str" + initials + "String_Node_Str";
    script+="String_Node_Str" + q + "String_Node_Str";
  }
 else {
    script+="String_Node_Str";
    script+="String_Node_Str" + q + "String_Node_Str"+ linesPerPage+ "String_Node_Str"+ (page - 1)+ "String_Node_Str";
  }
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  if (h3Job != null && h3Job.isReady()) {
    if (deleteStr != null && "String_Node_Str".equals(deleteStr) && (initials == null || initials.length() == 0)) {
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + linesPerPage + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + q + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + initials + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    ScriptResult scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",script);
    lines=extractLinesAmount(scriptResult);
    if (lines > 0) {
      pages=(lines + linesPerPage - 1) / linesPerPage;
      if (pages == 0) {
        pages=1;
      }
    }
    if (page > pages) {
      page=pages;
    }
    if (scriptResult != null && scriptResult.script != null) {
      if (scriptResult.script.failure) {
        if (scriptResult.script.stackTrace != null) {
          sb.append("String_Node_Str");
          sb.append("String_Node_Str");
          sb.append(StringEscapeUtils.escapeHtml(scriptResult.script.stackTrace));
          sb.append("String_Node_Str");
        }
 else         if (scriptResult.script.exception != null) {
          sb.append("String_Node_Str");
          sb.append("String_Node_Str");
          sb.append(StringEscapeUtils.escapeHtml(scriptResult.script.exception));
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(StringEscapeUtils.escapeHtml(new String(scriptResult.response,"String_Node_Str")));
        sb.append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(lines);
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(Pagination.getPagination(page,linesPerPage,pages,false,additionalParams));
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        if (scriptResult != null && scriptResult.script != null) {
          if (scriptResult.script.htmlOutput != null) {
            sb.append("String_Node_Str");
            sb.append(scriptResult.script.htmlOutput);
            sb.append("String_Node_Str");
          }
          if (scriptResult.script.rawOutput != null) {
            sb.append("String_Node_Str");
            sb.append("String_Node_Str");
            sb.append(scriptResult.script.rawOutput);
            sb.append("String_Node_Str");
            sb.append("String_Node_Str");
          }
        }
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(Pagination.getPagination(page,linesPerPage,pages,false,additionalParams));
        sb.append("String_Node_Str");
      }
    }
 else {
      sb.append("String_Node_Str");
    }
  }
 else {
    sb.append("String_Node_Str");
    sb.append(jobId);
    sb.append("String_Node_Str");
  }
  StringBuilder menuSb=masterTplBuilder.buildMenu(new StringBuilder(),h3Job);
  masterTplBuilder.insertContent("String_Node_Str" + jobId + "String_Node_Str",menuSb.toString(),environment.generateLanguageLinks(locale),"String_Node_Str" + jobId + "String_Node_Str",sb.toString(),"String_Node_Str" + Settings.get(HarvesterSettings.HARVEST_MONITOR_REFRESH_INTERVAL) + "String_Node_Str").write(out);
  out.flush();
  out.close();
}

Fixed version (ground truth):
public void frontier_list(HttpServletRequest req,HttpServletResponse resp,List<Integer> numerics) throws IOException {
  Locale locale=resp.getLocale();
  resp.setContentType("String_Node_Str");
  ServletOutputStream out=resp.getOutputStream();
  Caching.caching_disable_headers(resp);
  TemplateBuilderFactory<MasterTemplateBuilder> masterTplBuilderFactory=TemplateBuilderFactory.getInstance(environment.templateMaster,"String_Node_Str","String_Node_Str",MasterTemplateBuilder.class);
  MasterTemplateBuilder masterTplBuilder=masterTplBuilderFactory.getTemplateBuilder();
  StringBuilder sb=new StringBuilder();
  long lines;
  long linesPerPage=100;
  long page=1;
  long pages=0;
  String q=null;
  String tmpStr;
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0) {
    try {
      page=Long.parseLong(tmpStr);
    }
 catch (    NumberFormatException e) {
    }
  }
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0) {
    try {
      linesPerPage=Long.parseLong(tmpStr);
    }
 catch (    NumberFormatException e) {
    }
  }
  if (linesPerPage < 25) {
    linesPerPage=25;
  }
  if (linesPerPage > 1000) {
    linesPerPage=1000;
  }
  String initials=req.getParameter("String_Node_Str");
  if (initials == null) {
    initials="String_Node_Str";
  }
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0 && !tmpStr.equalsIgnoreCase("String_Node_Str")) {
    q=tmpStr;
  }
 else {
    q="String_Node_Str";
  }
  String additionalParams="String_Node_Str";
  if (q.length() > 0) {
    additionalParams+="String_Node_Str" + URLEncoder.encode(q,"String_Node_Str");
  }
  if (initials.length() > 0) {
    additionalParams+="String_Node_Str" + URLEncoder.encode(initials,"String_Node_Str");
  }
  String script=environment.NAS_GROOVY_SCRIPT;
  String deleteStr=req.getParameter("String_Node_Str");
  if (deleteStr != null && "String_Node_Str".equals(deleteStr) && initials != null && initials.length() > 0) {
    script+="String_Node_Str";
    script+="String_Node_Str" + initials + "String_Node_Str";
    script+="String_Node_Str" + q + "String_Node_Str";
  }
 else {
    script+="String_Node_Str";
    script+="String_Node_Str" + q + "String_Node_Str"+ linesPerPage+ "String_Node_Str"+ (page - 1)+ "String_Node_Str";
  }
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  if (h3Job != null && h3Job.isReady()) {
    if (deleteStr != null && "String_Node_Str".equals(deleteStr) && (initials == null || initials.length() == 0)) {
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + linesPerPage + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + q + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + initials + "String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    ScriptResult scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",script);
    lines=extractLinesAmount(scriptResult);
    if (lines > 0) {
      pages=(lines + linesPerPage - 1) / linesPerPage;
      if (pages == 0) {
        pages=1;
      }
    }
    if (page > pages) {
      page=pages;
    }
    if (scriptResult != null && scriptResult.script != null) {
      if (scriptResult.script.failure) {
        if (scriptResult.script.stackTrace != null) {
          sb.append("String_Node_Str");
          sb.append("String_Node_Str");
          sb.append(StringEscapeUtils.escapeHtml(scriptResult.script.stackTrace));
          sb.append("String_Node_Str");
        }
 else         if (scriptResult.script.exception != null) {
          sb.append("String_Node_Str");
          sb.append("String_Node_Str");
          sb.append(StringEscapeUtils.escapeHtml(scriptResult.script.exception));
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(StringEscapeUtils.escapeHtml(new String(scriptResult.response,"String_Node_Str")));
        sb.append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(lines);
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(Pagination.getPagination(page,linesPerPage,pages,false,additionalParams));
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        if (scriptResult != null && scriptResult.script != null) {
          if (scriptResult.script.htmlOutput != null) {
            sb.append("String_Node_Str");
            sb.append(scriptResult.script.htmlOutput);
            sb.append("String_Node_Str");
          }
          if (scriptResult.script.rawOutput != null) {
            sb.append("String_Node_Str");
            sb.append("String_Node_Str");
            sb.append(scriptResult.script.rawOutput);
            sb.append("String_Node_Str");
            sb.append("String_Node_Str");
          }
        }
        sb.append("String_Node_Str");
        sb.append("String_Node_Str");
        sb.append(Pagination.getPagination(page,linesPerPage,pages,false,additionalParams));
        sb.append("String_Node_Str");
      }
    }
 else {
      sb.append("String_Node_Str");
    }
  }
 else {
    sb.append("String_Node_Str");
    sb.append(jobId);
    sb.append("String_Node_Str");
  }
  StringBuilder menuSb=masterTplBuilder.buildMenu(new StringBuilder(),h3Job);
  masterTplBuilder.insertContent("String_Node_Str" + jobId + "String_Node_Str",menuSb.toString(),environment.generateLanguageLinks(locale),"String_Node_Str" + jobId + "String_Node_Str",sb.toString(),"String_Node_Str").write(out);
  out.flush();
  out.close();
}