Program: 22967
Project: 22967
Buggy source:
private void generate() throws Exception {
  forceDir(tempDir);
  forceDir(Utilities.path(tempDir,"String_Node_Str"));
  forceDir(Utilities.path(tempDir,"String_Node_Str"));
  otherFilesRun.clear();
  otherFilesRun.add(Utilities.path(outputDir,"String_Node_Str"));
  for (  String rg : regenList)   regenerate(rg);
  updateImplementationGuide();
  for (  FetchedFile f : changeList)   generateNativeOutputs(f,false);
  templateBeforeGenerate();
  for (  FetchedFile f : changeList)   generateHtmlOutputs(f,false);
  ValidationPresenter.filterMessages(errors,suppressedMessages,false);
  if (!changeList.isEmpty())   generateSummaryOutputs();
  cleanOutput(tempDir);
  templateAfterGenerate();
  if (runTool()) {
    if (!changeList.isEmpty()) {
      File df=makeSpecFile();
      npm.addFile(Category.OTHER,"String_Node_Str",TextFile.fileToBytes(df.getAbsolutePath()));
      npm.finish();
      if (mode == null || mode == IGBuildMode.MANUAL) {
        if (cacheVersion)         pcm.addPackageToCache(publishedIg.getPackageId(),publishedIg.getVersion(),new FileInputStream(npm.filename()));
 else         pcm.addPackageToCache(publishedIg.getPackageId(),"String_Node_Str",new FileInputStream(npm.filename()));
      }
      generateZips(df);
    }
  }
  log("String_Node_Str");
  List<ValidationMessage> linkmsgs=inspector.check();
  ValidationPresenter.filterMessages(linkmsgs,suppressedMessages,true);
  int bl=0;
  int lf=0;
  for (  ValidationMessage m : linkmsgs) {
    if (m.getLevel() == IssueSeverity.ERROR) {
      if (m.getType() == IssueType.NOTFOUND)       bl++;
 else       lf++;
    }
 else     if (m.getLevel() == IssueSeverity.FATAL) {
      throw new Exception(m.getMessage());
    }
  }
  log("String_Node_Str" + Integer.toString(inspector.total()) + "String_Node_Str"+ checkPlural("String_Node_Str",inspector.total())+ "String_Node_Str"+ Integer.toString(lf)+ "String_Node_Str"+ checkPlural("String_Node_Str",lf)+ "String_Node_Str"+ Integer.toString((lf * 100) / (inspector.total() == 0 ? 1 : inspector.total()))+ "String_Node_Str");
  log("String_Node_Str" + Integer.toString(inspector.links()) + "String_Node_Str"+ checkPlural("String_Node_Str",inspector.links())+ "String_Node_Str"+ Integer.toString(bl)+ "String_Node_Str"+ checkPlural("String_Node_Str",lf)+ "String_Node_Str"+ Integer.toString((bl * 100) / (inspector.links() == 0 ? 1 : inspector.links()))+ "String_Node_Str");
  errors.addAll(linkmsgs);
  for (  FetchedFile f : fileList)   ValidationPresenter.filterMessages(f.getErrors(),suppressedMessages,false);
  log("String_Node_Str");
  if ("String_Node_Str".equals(ostr(configuration,"String_Node_Str")) && linkmsgs.size() > 0)   throw new Error("String_Node_Str");
  ZipGenerator zip=new ZipGenerator(Utilities.path(tempDir,"String_Node_Str"));
  zip.addFolder(outputDir,"String_Node_Str",false);
  zip.addFileSource("String_Node_Str",REDIRECT_SOURCE,false);
  zip.close();
  Utilities.copyFile(Utilities.path(tempDir,"String_Node_Str"),Utilities.path(outputDir,"String_Node_Str"));
  log("String_Node_Str");
}

Fixed version (ground truth):
private void generate() throws Exception {
  forceDir(tempDir);
  forceDir(Utilities.path(tempDir,"String_Node_Str"));
  forceDir(Utilities.path(tempDir,"String_Node_Str"));
  otherFilesRun.clear();
  otherFilesRun.add(Utilities.path(outputDir,"String_Node_Str"));
  for (  String rg : regenList)   regenerate(rg);
  updateImplementationGuide();
  for (  FetchedFile f : changeList)   generateNativeOutputs(f,false);
  templateBeforeGenerate();
  for (  FetchedFile f : changeList)   generateHtmlOutputs(f,false);
  ValidationPresenter.filterMessages(errors,suppressedMessages,false);
  if (!changeList.isEmpty())   generateSummaryOutputs();
  cleanOutput(tempDir);
  templateAfterGenerate();
  if (runTool()) {
    if (!changeList.isEmpty()) {
      File df=makeSpecFile();
      npm.addFile(Category.OTHER,"String_Node_Str",TextFile.fileToBytes(df.getAbsolutePath()));
      npm.finish();
      File src=new File(npm.filename());
      File tgt=new File(Utilities.path(outputDir,"String_Node_Str"));
      tgt.delete();
      FileUtils.copyFile(src,tgt);
      if (mode == null || mode == IGBuildMode.MANUAL) {
        if (cacheVersion)         pcm.addPackageToCache(publishedIg.getPackageId(),publishedIg.getVersion(),new FileInputStream(npm.filename()));
 else         pcm.addPackageToCache(publishedIg.getPackageId(),"String_Node_Str",new FileInputStream(npm.filename()));
      }
      generateZips(df);
    }
  }
  log("String_Node_Str");
  List<ValidationMessage> linkmsgs=inspector.check();
  ValidationPresenter.filterMessages(linkmsgs,suppressedMessages,true);
  int bl=0;
  int lf=0;
  for (  ValidationMessage m : linkmsgs) {
    if (m.getLevel() == IssueSeverity.ERROR) {
      if (m.getType() == IssueType.NOTFOUND)       bl++;
 else       lf++;
    }
 else     if (m.getLevel() == IssueSeverity.FATAL) {
      throw new Exception(m.getMessage());
    }
  }
  log("String_Node_Str" + Integer.toString(inspector.total()) + "String_Node_Str"+ checkPlural("String_Node_Str",inspector.total())+ "String_Node_Str"+ Integer.toString(lf)+ "String_Node_Str"+ checkPlural("String_Node_Str",lf)+ "String_Node_Str"+ Integer.toString((lf * 100) / (inspector.total() == 0 ? 1 : inspector.total()))+ "String_Node_Str");
  log("String_Node_Str" + Integer.toString(inspector.links()) + "String_Node_Str"+ checkPlural("String_Node_Str",inspector.links())+ "String_Node_Str"+ Integer.toString(bl)+ "String_Node_Str"+ checkPlural("String_Node_Str",lf)+ "String_Node_Str"+ Integer.toString((bl * 100) / (inspector.links() == 0 ? 1 : inspector.links()))+ "String_Node_Str");
  errors.addAll(linkmsgs);
  for (  FetchedFile f : fileList)   ValidationPresenter.filterMessages(f.getErrors(),suppressedMessages,false);
  log("String_Node_Str");
  if ("String_Node_Str".equals(ostr(configuration,"String_Node_Str")) && linkmsgs.size() > 0)   throw new Error("String_Node_Str");
  ZipGenerator zip=new ZipGenerator(Utilities.path(tempDir,"String_Node_Str"));
  zip.addFolder(outputDir,"String_Node_Str",false);
  zip.addFileSource("String_Node_Str",REDIRECT_SOURCE,false);
  zip.close();
  Utilities.copyFile(Utilities.path(tempDir,"String_Node_Str"),Utilities.path(outputDir,"String_Node_Str"));
  log("String_Node_Str");
}