Program: 90161
Project: 90161
Buggy source:
/** 
 * Iterates over the ARC files in the given dir and moves away files that do not belong to the given job.  Files whose jobid we can parse will be moved to a directory under oldjobs named with that jobid, otherwise they will go into a directory under oldjobs named with a timestamp.
 * @param dir A directory containing one or more ARC files.
 * @param jobID ID of the job whose directory we're in.
 * @throws UnknownID If ?????????????????????????????????????
 */
private static void moveAwayForeignFiles(File dir,long jobID) throws UnknownID {
  File[] arcFiles=dir.listFiles(FileUtils.ARCS_FILTER);
  File oldJobsDir=new File(Settings.get(Settings.HARVEST_CONTROLLER_OLDJOBSDIR));
  File unknownJobDir=new File(oldJobsDir,"String_Node_Str" + new Date().getTime());
  List<File> movedFiles=new ArrayList<File>();
  for (  File arcFile : arcFiles) {
    long foundJobID=-1;
    try {
      FileUtils.FilenameParser parser=new FilenameParser(arcFile);
      foundJobID=Long.parseLong(parser.getJobID());
    }
 catch (    UnknownID e) {
      Matcher matcher=metadataFilenamePattern.matcher(arcFile.getName());
      if (matcher.matches()) {
        foundJobID=Long.parseLong(matcher.group(1));
      }
    }
    if (foundJobID != jobID) {
      File arcsDir;
      if (foundJobID == -1) {
        arcsDir=new File(unknownJobDir,"String_Node_Str");
      }
 else {
        arcsDir=new File(oldJobsDir,foundJobID + "String_Node_Str");
      }
      try {
        FileUtils.createDir(arcsDir);
        File moveTo=new File(arcsDir,arcFile.getName());
        arcFile.renameTo(moveTo);
        movedFiles.add(moveTo);
      }
 catch (      PermissionDenied e) {
        log.warn("String_Node_Str" + arcsDir.getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
  if (!movedFiles.isEmpty()) {
    log.warn("String_Node_Str" + jobID + "String_Node_Str"+ movedFiles);
  }
}

Fixed version (ground truth):
/** 
 * Iterates over the ARC files in the given dir and moves away files that do not belong to the given job.  Files whose jobid we can parse will be moved to a directory under oldjobs named with that jobid, otherwise they will go into a directory under oldjobs named with a timestamp.
 * @param dir A directory containing one or more ARC files.
 * @param jobID ID of the job whose directory we're in.
 * @throws UnknownID If ?????????????????????????????????????
 */
private static void moveAwayForeignFiles(File dir,long jobID) throws UnknownID {
  File[] arcFiles=dir.listFiles(FileUtils.ARCS_FILTER);
  File oldJobsDir=new File(Settings.get(Settings.HARVEST_CONTROLLER_OLDJOBSDIR));
  File unknownJobDir=new File(oldJobsDir,"String_Node_Str" + new Date().getTime());
  List<File> movedFiles=new ArrayList<File>();
  for (  File arcFile : arcFiles) {
    long foundJobID=-1;
    try {
      FileUtils.FilenameParser parser=new FilenameParser(arcFile);
      foundJobID=Long.parseLong(parser.getJobID());
    }
 catch (    UnknownID e) {
      Matcher matcher=metadataFilenamePattern.matcher(arcFile.getName());
      if (matcher.matches()) {
        foundJobID=Long.parseLong(matcher.group(1));
      }
    }
    if (foundJobID != jobID) {
      File arcsDir;
      if (foundJobID == -1) {
        arcsDir=new File(unknownJobDir,Constants.ARCDIRECTORY_NAME);
      }
 else {
        arcsDir=new File(oldJobsDir,foundJobID + "String_Node_Str" + Constants.ARCDIRECTORY_NAME);
      }
      try {
        FileUtils.createDir(arcsDir);
        File moveTo=new File(arcsDir,arcFile.getName());
        arcFile.renameTo(moveTo);
        movedFiles.add(moveTo);
      }
 catch (      PermissionDenied e) {
        log.warn("String_Node_Str" + arcsDir.getAbsolutePath() + "String_Node_Str",e);
      }
    }
  }
  if (!movedFiles.isEmpty()) {
    log.warn("String_Node_Str" + jobID + "String_Node_Str"+ movedFiles);
  }
}