Program: 89579
Project: 89579
Buggy source:
/** 
 * Iterates over the (W)ARC files in the given dir and moves away files that do not belong to the given job into a "lost-files" directory under oldjobs  named with a timestamp.
 * @param archiveProfile archive profile including filters, patterns, etc.
 * @param dir A directory containing one or more (W)ARC files.
 * @param files Information about the files produced by heritrix (jobId and harvestnamePrefix)
 */
private static void moveAwayForeignFiles(ArchiveProfile archiveProfile,File dir,IngestableFiles files){
  File[] archiveFiles=dir.listFiles(archiveProfile.filename_filter);
  File oldJobsDir=new File(Settings.get(HarvesterSettings.HARVEST_CONTROLLER_OLDJOBSDIR));
  File lostfilesDir=new File(oldJobsDir,"String_Node_Str" + new Date().getTime());
  List<File> movedFiles=new ArrayList<File>();
  log.info("String_Node_Str" + files.getHarvestnamePrefix() + "String_Node_Str");
  for (  File archiveFile : archiveFiles) {
    if (!(archiveFile.getName().startsWith(files.getHarvestnamePrefix()))) {
      System.out.println("String_Node_Str" + archiveFile.getAbsolutePath());
      try {
        if (!lostfilesDir.exists()) {
          FileUtils.createDir(lostfilesDir);
          File moveTo=new File(lostfilesDir,archiveFile.getName());
          archiveFile.renameTo(moveTo);
          movedFiles.add(moveTo);
        }
      }
 catch (      PermissionDenied e) {
        log.warn("String_Node_Str" + lostfilesDir.getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
  if (!movedFiles.isEmpty()) {
    log.warn("String_Node_Str" + files.getJobId() + "String_Node_Str"+ movedFiles);
  }
}

Fixed version (ground truth):
/** 
 * Iterates over the (W)ARC files in the given dir and moves away files that do not belong to the given job into a "lost-files" directory under oldjobs  named with a timestamp.
 * @param archiveProfile archive profile including filters, patterns, etc.
 * @param dir A directory containing one or more (W)ARC files.
 * @param files Information about the files produced by heritrix (jobId and harvestnamePrefix)
 */
private static void moveAwayForeignFiles(ArchiveProfile archiveProfile,File dir,IngestableFiles files){
  File[] archiveFiles=dir.listFiles(archiveProfile.filename_filter);
  File oldJobsDir=new File(Settings.get(HarvesterSettings.HARVEST_CONTROLLER_OLDJOBSDIR));
  File lostfilesDir=new File(oldJobsDir,"String_Node_Str" + new Date().getTime());
  List<File> movedFiles=new ArrayList<File>();
  log.info("String_Node_Str" + files.getHarvestnamePrefix() + "String_Node_Str");
  for (  File archiveFile : archiveFiles) {
    if (!(archiveFile.getName().startsWith(files.getHarvestnamePrefix()))) {
      log.info("String_Node_Str" + archiveFile.getAbsolutePath());
      try {
        if (!lostfilesDir.exists()) {
          FileUtils.createDir(lostfilesDir);
        }
        File moveTo=new File(lostfilesDir,archiveFile.getName());
        archiveFile.renameTo(moveTo);
        movedFiles.add(moveTo);
      }
 catch (      PermissionDenied e) {
        log.warn("String_Node_Str" + lostfilesDir.getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
  if (!movedFiles.isEmpty()) {
    log.warn("String_Node_Str" + files.getJobId() + "String_Node_Str"+ movedFiles);
  }
}