Program: 89504
Project: 89504
Buggy source:
public void budget_change(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> tplBuilder=TemplateBuilderFactory.getInstance(environment.templateMaster,"String_Node_Str","String_Node_Str",MasterTemplateBuilder.class);
  MasterTemplateBuilder masterTplBuilder=tplBuilder.getTemplateBuilder();
  StringBuilder sb=new StringBuilder();
  String budget=req.getParameter("String_Node_Str");
  if (budget == null) {
    budget="String_Node_Str";
  }
  String key=req.getParameter("String_Node_Str");
  if (key == null) {
    key="String_Node_Str";
  }
  String submit1=req.getParameter("String_Node_Str");
  String submit2=req.getParameter("String_Node_Str");
  String initials="String_Node_Str";
  if (submit1 != null) {
    initials=req.getParameter("String_Node_Str");
  }
 else   if (submit2 != null) {
    initials=req.getParameter("String_Node_Str");
  }
  if (initials == null) {
    initials="String_Node_Str";
  }
  if (submit1 == null) {
    submit1="String_Node_Str";
  }
  if (submit2 == null) {
    submit2="String_Node_Str";
  }
  boolean isNumber=true;
  String script=environment.NAS_GROOVY_SCRIPT;
  String originalScript=script;
  script+="String_Node_Str";
  if ((!submit1.isEmpty() || !submit2.isEmpty()) && !initials.isEmpty()) {
    if (!submit1.isEmpty() && !budget.trim().isEmpty() && !key.trim().isEmpty()) {
      script+="String_Node_Str" + initials + "String_Node_Str";
      script+="String_Node_Str" + key + "String_Node_Str"+ budget+ "String_Node_Str";
    }
 else {
      if (!submit2.isEmpty()) {
        String[] queues=req.getParameterValues("String_Node_Str");
        if (queues != null && queues.length > 0) {
          script+="String_Node_Str" + initials + "String_Node_Str";
          for (int i=0; i < queues.length; i++) {
            budget=req.getParameter(queues[i] + "String_Node_Str");
            if (budget != null && !budget.isEmpty()) {
              try {
                Integer.parseInt(budget);
                script+="String_Node_Str" + queues[i] + "String_Node_Str"+ budget+ "String_Node_Str";
              }
 catch (              NumberFormatException e) {
                isNumber=false;
              }
            }
          }
        }
      }
    }
  }
  script+="String_Node_Str";
  script+="String_Node_Str";
  originalScript+="String_Node_Str";
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  if (h3Job != null && h3Job.isReady()) {
    boolean submitWithInitials=true;
    if ((!submit1.isEmpty() || !submit2.isEmpty()) && initials.isEmpty()) {
      sb.append("String_Node_Str");
    }
    if (!submit1.isEmpty() && initials.isEmpty()) {
      submitWithInitials=false;
    }
    try {
      if (budget != null && budget.length() > 0) {
        Integer.parseInt(budget);
      }
    }
 catch (    NumberFormatException e) {
      sb.append("String_Node_Str");
    }
    if (isNumber == false) {
      sb.append("String_Node_Str");
    }
    ScriptResult scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",originalScript);
    if (scriptResult != null && scriptResult.script != null && scriptResult.script.htmlOutput != null) {
      sb.append("String_Node_Str");
      sb.append(scriptResult.script.htmlOutput);
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str");
    scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",script);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (!submitWithInitials) {
      sb.append(key);
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (!submitWithInitials) {
      sb.append(budget);
    }
    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");
    if (scriptResult != null && scriptResult.script != null && scriptResult.script.htmlOutput != null) {
      sb.append("String_Node_Str");
      sb.append(scriptResult.script.htmlOutput);
      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");
  }
 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 budget_change(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> tplBuilder=TemplateBuilderFactory.getInstance(environment.templateMaster,"String_Node_Str","String_Node_Str",MasterTemplateBuilder.class);
  MasterTemplateBuilder masterTplBuilder=tplBuilder.getTemplateBuilder();
  StringBuilder sb=new StringBuilder();
  String budget=req.getParameter("String_Node_Str");
  if (budget == null) {
    budget="String_Node_Str";
  }
  String key=req.getParameter("String_Node_Str");
  if (key == null) {
    key="String_Node_Str";
  }
  String submit1=req.getParameter("String_Node_Str");
  String submit2=req.getParameter("String_Node_Str");
  String initials="String_Node_Str";
  if (submit1 != null) {
    initials=req.getParameter("String_Node_Str");
  }
 else   if (submit2 != null) {
    initials=req.getParameter("String_Node_Str");
  }
  if (initials == null) {
    initials="String_Node_Str";
  }
  if (submit1 == null) {
    submit1="String_Node_Str";
  }
  if (submit2 == null) {
    submit2="String_Node_Str";
  }
  boolean isNumber=true;
  String script=environment.NAS_GROOVY_SCRIPT;
  String originalScript=script;
  script+="String_Node_Str";
  if ((!submit1.isEmpty() || !submit2.isEmpty()) && !initials.isEmpty()) {
    if (!submit1.isEmpty() && !budget.trim().isEmpty() && !key.trim().isEmpty()) {
      script+="String_Node_Str" + initials + "String_Node_Str";
      script+="String_Node_Str" + key + "String_Node_Str"+ budget+ "String_Node_Str";
    }
 else {
      if (!submit2.isEmpty()) {
        String[] queues=req.getParameterValues("String_Node_Str");
        if (queues != null && queues.length > 0) {
          script+="String_Node_Str" + initials + "String_Node_Str";
          for (int i=0; i < queues.length; i++) {
            budget=req.getParameter(queues[i] + "String_Node_Str");
            if (budget != null && !budget.isEmpty()) {
              try {
                Integer.parseInt(budget);
                script+="String_Node_Str" + queues[i] + "String_Node_Str"+ budget+ "String_Node_Str";
              }
 catch (              NumberFormatException e) {
                isNumber=false;
              }
            }
          }
        }
      }
    }
  }
  script+="String_Node_Str";
  script+="String_Node_Str";
  originalScript+="String_Node_Str";
  long jobId=numerics.get(0);
  Heritrix3JobMonitor h3Job=environment.h3JobMonitorThread.getRunningH3Job(jobId);
  if (h3Job != null && h3Job.isReady()) {
    boolean submitWithInitials=true;
    if ((!submit1.isEmpty() || !submit2.isEmpty()) && initials.isEmpty()) {
      sb.append("String_Node_Str");
    }
    if (!submit1.isEmpty() && initials.isEmpty()) {
      submitWithInitials=false;
    }
    try {
      if (budget != null && budget.length() > 0) {
        Integer.parseInt(budget);
      }
    }
 catch (    NumberFormatException e) {
      sb.append("String_Node_Str");
    }
    if (isNumber == false) {
      sb.append("String_Node_Str");
    }
    ScriptResult scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",originalScript);
    if (scriptResult != null && scriptResult.script != null && scriptResult.script.htmlOutput != null) {
      sb.append("String_Node_Str");
      sb.append(scriptResult.script.htmlOutput);
      sb.append("String_Node_Str");
    }
    sb.append("String_Node_Str");
    scriptResult=h3Job.h3wrapper.ExecuteShellScriptInJob(h3Job.jobResult.job.shortName,"String_Node_Str",script);
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (!submitWithInitials) {
      sb.append(key);
    }
    sb.append("String_Node_Str");
    sb.append("String_Node_Str");
    if (!submitWithInitials) {
      sb.append(budget);
    }
    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");
    if (scriptResult != null && scriptResult.script != null && scriptResult.script.htmlOutput != null) {
      sb.append("String_Node_Str");
      sb.append(scriptResult.script.htmlOutput);
      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");
  }
 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();
}