Program: 89505
Project: 89505
Buggy source:
public void crawllog_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();
  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 additionalParams;
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0 && !tmpStr.equalsIgnoreCase("String_Node_Str")) {
    q=tmpStr;
    additionalParams="String_Node_Str" + URLEncoder.encode(q,"String_Node_Str");
  }
 else {
    additionalParams="String_Node_Str";
  }
  StringBuilder sb=new StringBuilder();
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  Pageable pageable=h3Job;
  if (h3Job != null && h3Job.isReady()) {
    String actionStr=req.getParameter("String_Node_Str");
    if ("String_Node_Str".equalsIgnoreCase(actionStr)) {
      byte[] tmpBuf=new byte[1024 * 1024];
      h3Job.updateCrawlLog(tmpBuf);
    }
    long totalCachedLines=h3Job.getTotalCachedLines();
    long totalCachedSize=h3Job.getLastIndexed();
    SearchResult searchResult=null;
    if (q != null) {
      searchResult=h3Job.getSearchResult(q);
      searchResult.update();
      pageable=searchResult;
    }
 else {
      q="String_Node_Str";
    }
    lines=pageable.getIndexSize();
    if (lines > 0) {
      lines=(lines / 8) - 1;
      pages=Pagination.getPages(lines,linesPerPage);
    }
 else {
      lines=0;
    }
    if (page > pages) {
      page=pages;
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(totalCachedLines);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(totalCachedSize);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    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");
    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 (lines > 0) {
      byte[] pageBytes=pageable.readPage(page,linesPerPage,true);
      sb.append(new String(pageBytes,"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");
    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 crawllog_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();
  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 additionalParams;
  tmpStr=req.getParameter("String_Node_Str");
  if (tmpStr != null && tmpStr.length() > 0 && !tmpStr.equalsIgnoreCase("String_Node_Str")) {
    q=tmpStr;
    additionalParams="String_Node_Str" + URLEncoder.encode(q,"String_Node_Str");
  }
 else {
    additionalParams="String_Node_Str";
  }
  StringBuilder sb=new StringBuilder();
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  Pageable pageable=h3Job;
  if (h3Job != null && h3Job.isReady()) {
    String actionStr=req.getParameter("String_Node_Str");
    if ("String_Node_Str".equalsIgnoreCase(actionStr)) {
      byte[] tmpBuf=new byte[1024 * 1024];
      h3Job.updateCrawlLog(tmpBuf);
    }
    long totalCachedLines=h3Job.getTotalCachedLines();
    long totalCachedSize=h3Job.getLastIndexed();
    SearchResult searchResult=null;
    if (q != null) {
      searchResult=h3Job.getSearchResult(q);
      searchResult.update();
      pageable=searchResult;
    }
 else {
      q="String_Node_Str";
    }
    lines=pageable.getIndexSize();
    if (lines > 0) {
      lines=(lines / 8) - 1;
      pages=Pagination.getPages(lines,linesPerPage);
    }
 else {
      lines=0;
    }
    if (page > pages) {
      page=pages;
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(totalCachedLines);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append(totalCachedSize);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    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");
    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 (lines > 0) {
      byte[] pageBytes=pageable.readPage(page,linesPerPage,true);
      sb.append(new String(pageBytes,"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");
    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();
}