Program: 20125
Project: 20125
Buggy source:
private void runValidation(){
  timestamp_begin=System.currentTimeMillis();
  gui.clearLog();
  Calendar cal=Calendar.getInstance();
  cal.setTime(new Date());
  DateFormat formater=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
  gui.addLogMessageToTextLog(formater.format(cal.getTime()) + "String_Node_Str");
  gui.addLogMessageToTextLog("String_Node_Str");
  gui.disableButtonsDuringValidation();
  gui.getStatusBar().update(FileManager.iconLoading,__("String_Node_Str"));
  gui.setBorderStateNormal();
  SwingWorker<Void,Void> validationWorker=new SwingWorker<Void,Void>(){
    @Override protected Void doInBackground() throws Exception {
      EpubCheck epubcheck=new EpubCheck(epubFile,report);
      epubcheckResult=epubcheck.validate();
      return null;
    }
    @Override protected void done(){
      if (epubcheckResult == false) {
        gui.setBorderStateError();
        gui.addLogMessageToTextLog("String_Node_Str" + "String_Node_Str");
        if (report.getErrorCount() > 0 && report.getWarningCount() > 0) {
          resultMessage=String.format(__("String_Node_Str"),report.getWarningCount(),report.getErrorCount());
        }
 else         if (report.getErrorCount() > 0) {
          resultMessage=String.format(__("String_Node_Str"),report.getErrorCount());
        }
 else         if (report.getWarningCount() > 0) {
          gui.setBorderStateWarning();
          resultMessage=String.format(__("String_Node_Str"),report.getWarningCount());
        }
 else {
          resultMessage=__("String_Node_Str");
        }
        gui.addLogMessage("String_Node_Str" + resultMessage + "String_Node_Str");
        if (guiManager.getMacApp() != null) {
          if (report.getWarningCount() + report.getErrorCount() > 0) {
            guiManager.getMacApp().setDockIconBadge(new Integer(report.getWarningCount() + report.getErrorCount()).toString());
          }
 else {
            guiManager.getMacApp().setDockIconBadge("String_Node_Str");
          }
        }
        if (guiManager.getExpandedSave() == ExpandedSaveMode.ALWAYS) {
          saveEpubFromExpandedFolder();
        }
 else {
          if (expanded && epubFile.exists()) {
            epubFile.delete();
            gui.addLogMessage(Severity.WARNING,"String_Node_Str" + __("String_Node_Str") + "String_Node_Str");
          }
        }
      }
 else {
        gui.setBorderStateValid();
        resultMessage=__("String_Node_Str");
        gui.addLogMessage("String_Node_Str" + resultMessage + "String_Node_Str");
        if (guiManager.getMacApp() != null) {
          guiManager.getMacApp().setDockIconBadge("String_Node_Str");
        }
        if (guiManager.getExpandedSave() != ExpandedSaveMode.NEVER) {
          saveEpubFromExpandedFolder();
        }
      }
      gui.scrollToBottom();
      timestamp_end=System.currentTimeMillis();
      double timestamp_diff=timestamp_end - timestamp_begin;
      DecimalFormat df=new DecimalFormat("String_Node_Str");
      String timestamp_result=df.format(timestamp_diff / 1000);
      gui.getStatusBar().update(null,__("String_Node_Str") + "String_Node_Str" + String.format(__("String_Node_Str"),timestamp_result)+ "String_Node_Str"+ resultMessage);
      gui.enableButtonsAfterValidation();
      if (guiManager.getMenuOptionAutoSaveLogfile()) {
        if (expanded && expandedBasedir != null && expandedBasedir.exists()) {
          gui.saveLogfile(new File(expandedBasedir,epubFile.getName().replaceAll(epubFileExtRegex,"String_Node_Str")));
        }
 else {
          gui.saveLogfile(new File(epubFile.getAbsolutePath().replaceAll(epubFileExtRegex,"String_Node_Str")));
        }
      }
    }
  }
;
  validationWorker.execute();
}

Fixed version (ground truth):
private void runValidation(){
  timestamp_begin=System.currentTimeMillis();
  gui.clearLog();
  Calendar cal=Calendar.getInstance();
  cal.setTime(new Date());
  DateFormat formater=DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
  gui.addLogMessageToTextLog(formater.format(cal.getTime()) + "String_Node_Str");
  gui.addLogMessageToTextLog("String_Node_Str");
  gui.disableButtonsDuringValidation();
  gui.getStatusBar().update(FileManager.iconLoading,__("String_Node_Str"));
  gui.setBorderStateNormal();
  SwingWorker<Void,Void> validationWorker=new SwingWorker<Void,Void>(){
    @Override protected Void doInBackground() throws Exception {
      EpubCheck epubcheck=new EpubCheck(epubFile,report);
      epubcheckResult=epubcheck.validate();
      return null;
    }
    @Override protected void done(){
      if (epubcheckResult == false) {
        gui.setBorderStateError();
        gui.addLogMessageToTextLog("String_Node_Str" + "String_Node_Str");
        if (report.getErrorCount() > 0 && report.getWarningCount() > 0) {
          resultMessage=String.format(__("String_Node_Str"),report.getWarningCount(),report.getErrorCount());
        }
 else         if (report.getErrorCount() > 0) {
          resultMessage=String.format(__("String_Node_Str"),report.getErrorCount());
        }
 else         if (report.getWarningCount() > 0) {
          gui.setBorderStateWarning();
          resultMessage=String.format(__("String_Node_Str"),report.getWarningCount());
        }
 else {
          resultMessage=__("String_Node_Str");
        }
        gui.addLogMessage("String_Node_Str" + resultMessage + "String_Node_Str");
        if (guiManager.getMacApp() != null) {
          if (report.getWarningCount() + report.getErrorCount() > 0) {
            guiManager.getMacApp().setDockIconBadge(new Integer(report.getWarningCount() + report.getErrorCount()).toString());
          }
 else {
            guiManager.getMacApp().setDockIconBadge("String_Node_Str");
          }
        }
        if (expanded) {
          if (guiManager.getExpandedSave() == ExpandedSaveMode.ALWAYS) {
            saveEpubFromExpandedFolder();
          }
 else           if (epubFile.exists()) {
            epubFile.delete();
            gui.addLogMessage(Severity.WARNING,"String_Node_Str" + __("String_Node_Str") + "String_Node_Str");
          }
        }
      }
 else {
        gui.setBorderStateValid();
        resultMessage=__("String_Node_Str");
        gui.addLogMessage("String_Node_Str" + resultMessage + "String_Node_Str");
        if (guiManager.getMacApp() != null) {
          guiManager.getMacApp().setDockIconBadge("String_Node_Str");
        }
        if (expanded && guiManager.getExpandedSave() != ExpandedSaveMode.NEVER) {
          saveEpubFromExpandedFolder();
        }
      }
      gui.scrollToBottom();
      timestamp_end=System.currentTimeMillis();
      double timestamp_diff=timestamp_end - timestamp_begin;
      DecimalFormat df=new DecimalFormat("String_Node_Str");
      String timestamp_result=df.format(timestamp_diff / 1000);
      gui.getStatusBar().update(null,__("String_Node_Str") + "String_Node_Str" + String.format(__("String_Node_Str"),timestamp_result)+ "String_Node_Str"+ resultMessage);
      gui.enableButtonsAfterValidation();
      if (guiManager.getMenuOptionAutoSaveLogfile()) {
        if (expanded && expandedBasedir != null && expandedBasedir.exists()) {
          gui.saveLogfile(new File(expandedBasedir,epubFile.getName().replaceAll(epubFileExtRegex,"String_Node_Str")));
        }
 else {
          gui.saveLogfile(new File(epubFile.getAbsolutePath().replaceAll(epubFileExtRegex,"String_Node_Str")));
        }
      }
      gui.scrollToBottom();
    }
  }
;
  validationWorker.execute();
}