Program: 89510
Project: 89510
Buggy source:
@Override public void run(){
  Map<Long,Heritrix3JobMonitor> tmpJobMonitorMap;
  Iterator<Heritrix3JobMonitor> jobmonitorIter;
  byte[] tmpBuf=new byte[1024 * 1024];
  try {
    LOG.info("String_Node_Str");
    File tmpFolder=environment.tempPath;
    ;
    File[] oldFiles=tmpFolder.listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        if (name.startsWith("String_Node_Str")) {
          if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
            return true;
          }
        }
        return false;
      }
    }
);
    Map<String,File> oldFilesMap=new HashMap<String,File>();
    File tmpFile;
    for (int i=0; i < oldFiles.length; ++i) {
      tmpFile=oldFiles[i];
      oldFilesMap.put(tmpFile.getName(),tmpFile);
    }
    ;
    List<File> oldFilesList=new ArrayList<File>();
    while (!bExit) {
      Set<Long> runningJobs=getRunningJobs();
      if (runningJobs != null) {
        Iterator<Long> jobidIter=runningJobs.iterator();
        Heritrix3JobMonitor jobmonitor;
synchronized (runningJobMonitorMap) {
          filterJobMonitorMap.clear();
          while (jobidIter.hasNext()) {
            Long jobId=jobidIter.next();
            if (jobId != null) {
              jobmonitor=runningJobMonitorMap.remove(jobId);
              if (jobmonitor == null) {
                try {
                  jobmonitor=Heritrix3WrapperManager.getJobMonitor(jobId,environment);
                }
 catch (                IOException e) {
                }
              }
              filterJobMonitorMap.put(jobId,jobmonitor);
            }
          }
          tmpJobMonitorMap=filterJobMonitorMap;
          filterJobMonitorMap=runningJobMonitorMap;
          runningJobMonitorMap=tmpJobMonitorMap;
          LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode());
        }
        jobmonitorIter=filterJobMonitorMap.values().iterator();
        while (jobmonitorIter.hasNext()) {
          jobmonitor=jobmonitorIter.next();
          jobmonitor.cleanup(oldFilesList);
        }
        jobmonitorIter=runningJobMonitorMap.values().iterator();
        while (jobmonitorIter.hasNext()) {
          jobmonitor=jobmonitorIter.next();
          if (oldFilesMap != null) {
            oldFilesMap.remove(jobmonitor.logFile.getName());
            oldFilesMap.remove(jobmonitor.idxFile.getName());
          }
          if (!jobmonitor.bInitialized) {
            jobmonitor.init();
          }
          checkH3HostnamePort(jobmonitor);
          isH3HostnamePortEnabled(jobmonitor);
          if (jobmonitor.bPull) {
            jobmonitor.updateCrawlLog(tmpBuf);
          }
        }
        if (oldFilesMap != null) {
          oldFilesList.addAll(oldFilesMap.values());
          oldFilesMap=null;
        }
        int idx=0;
        while (idx < oldFilesList.size()) {
          if (oldFilesList.get(idx).delete()) {
            idx++;
          }
 else {
            oldFilesList.remove(idx);
          }
        }
      }
      try {
        Thread.sleep(60 * 1000);
      }
 catch (      InterruptedException e) {
      }
    }
    LOG.info("String_Node_Str");
  }
 catch (  Throwable t) {
    throwable=t;
    LOG.error("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  Map<Long,Heritrix3JobMonitor> tmpJobMonitorMap;
  Iterator<Heritrix3JobMonitor> jobmonitorIter;
  byte[] tmpBuf=new byte[1024 * 1024];
  try {
    LOG.info("String_Node_Str");
    File tmpFolder=environment.tempPath;
    ;
    File[] oldFiles=tmpFolder.listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        if (name.startsWith("String_Node_Str")) {
          if (name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str")) {
            return true;
          }
        }
        return false;
      }
    }
);
    Map<String,File> oldFilesMap=new HashMap<String,File>();
    File tmpFile;
    for (int i=0; i < oldFiles.length; ++i) {
      tmpFile=oldFiles[i];
      oldFilesMap.put(tmpFile.getName(),tmpFile);
    }
    ;
    List<File> oldFilesList=new ArrayList<File>();
    while (!bExit) {
      Set<Long> runningJobs=getRunningJobs();
      if (runningJobs != null) {
        Iterator<Long> jobidIter=runningJobs.iterator();
        Heritrix3JobMonitor jobmonitor;
synchronized (runningJobMonitorMap) {
          filterJobMonitorMap.clear();
          while (jobidIter.hasNext()) {
            Long jobId=jobidIter.next();
            if (jobId != null) {
              jobmonitor=runningJobMonitorMap.remove(jobId);
              if (jobmonitor == null) {
                try {
                  jobmonitor=Heritrix3WrapperManager.getJobMonitor(jobId,environment);
                }
 catch (                IOException e) {
                }
              }
              filterJobMonitorMap.put(jobId,jobmonitor);
            }
          }
          tmpJobMonitorMap=filterJobMonitorMap;
          filterJobMonitorMap=runningJobMonitorMap;
          runningJobMonitorMap=tmpJobMonitorMap;
          LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode(),runningJobMonitorMap.hashCode());
        }
        jobmonitorIter=filterJobMonitorMap.values().iterator();
        while (jobmonitorIter.hasNext()) {
          jobmonitor=jobmonitorIter.next();
          jobmonitor.cleanup(oldFilesList);
        }
        jobmonitorIter=runningJobMonitorMap.values().iterator();
        while (jobmonitorIter.hasNext()) {
          jobmonitor=jobmonitorIter.next();
          if (oldFilesMap != null) {
            oldFilesMap.remove(jobmonitor.logFile.getName());
            oldFilesMap.remove(jobmonitor.idxFile.getName());
          }
          if (!jobmonitor.bInitialized) {
            jobmonitor.init();
          }
          checkH3HostnamePort(jobmonitor);
          isH3HostnamePortEnabled(jobmonitor);
          if (jobmonitor.bPull) {
            jobmonitor.updateCrawlLog(tmpBuf);
          }
        }
        if (oldFilesMap != null) {
          oldFilesList.addAll(oldFilesMap.values());
          oldFilesMap=null;
        }
        int idx=0;
        while (idx < oldFilesList.size()) {
          if (oldFilesList.get(idx).delete()) {
            idx++;
          }
 else {
            oldFilesList.remove(idx);
          }
        }
      }
      try {
        Thread.sleep(60 * 1000);
      }
 catch (      InterruptedException e) {
      }
    }
    LOG.info("String_Node_Str");
  }
 catch (  Throwable t) {
    throwable=t;
    LOG.error("String_Node_Str",t);
  }
}