Program: 90160
Project: 90160
Buggy source:
/** 
 * Controls storing all files involved in a job.  The files are 1) The actual ARC files, 2) The metadata files The crawl.log is parsed and information for each domain is generated and stored in a DomainHarvestReport object which is sent along in the crawlstatusmessage. Additionally, any leftover open ARC files are closed and harvest documentation is extracted before upload starts.
 * @param files The HeritrixFiles object for this crawl.
 * @param errorMessage A place where error messages accumulate.
 * @param failedFiles  List of files that failed to upload.
 * @return An object containing info about the domains harvested.
 */
public DomainHarvestReport storeFiles(HeritrixFiles files,StringBuilder errorMessage,List<File> failedFiles){
  ArgumentNotValid.checkNotNull(files,"String_Node_Str");
  ArgumentNotValid.checkNotNull(errorMessage,"String_Node_Str");
  ArgumentNotValid.checkNotNull(failedFiles,"String_Node_Str");
  long jobID=files.getJobID();
  long harvestID=files.getHarvestID();
  File crawlDir=files.getCrawlDir();
  try {
    IngestableFiles inf=new IngestableFiles(crawlDir,jobID);
    inf.closeOpenFiles(WAIT_FOR_HERITRIX_TIMEOUT_SECS);
    HarvestDocumentation.documentHarvest(crawlDir,jobID,harvestID);
    uploadFiles(inf.getArcFiles(),errorMessage,failedFiles);
    uploadFiles(inf.getMetadataArcFiles(),errorMessage,failedFiles);
    return generateHeritrixDomainHarvestReport(files,errorMessage);
  }
 catch (  IOFailure e) {
    String errMsg="String_Node_Str";
    log.warn(errMsg,e);
    throw new IOFailure(errMsg,e);
  }
}

Fixed version (ground truth):
/** 
 * Controls storing all files involved in a job.  The files are 1) The actual ARC files, 2) The metadata files The crawl.log is parsed and information for each domain is generated and stored in a DomainHarvestReport object which is sent along in the crawlstatusmessage. Additionally, any leftover open ARC files are closed and harvest documentation is extracted before upload starts.
 * @param files The HeritrixFiles object for this crawl.
 * @param errorMessage A place where error messages accumulate.
 * @param failedFiles  List of files that failed to upload.
 * @return An object containing info about the domains harvested.
 */
public DomainHarvestReport storeFiles(HeritrixFiles files,StringBuilder errorMessage,List<File> failedFiles){
  ArgumentNotValid.checkNotNull(files,"String_Node_Str");
  ArgumentNotValid.checkNotNull(errorMessage,"String_Node_Str");
  ArgumentNotValid.checkNotNull(failedFiles,"String_Node_Str");
  long jobID=files.getJobID();
  long harvestID=files.getHarvestID();
  File crawlDir=files.getCrawlDir();
  try {
    IngestableFiles inf=new IngestableFiles(crawlDir,jobID);
    inf.closeOpenFiles(WAIT_FOR_HERITRIX_TIMEOUT_SECS);
    HarvestDocumentation.documentHarvest(crawlDir,jobID,harvestID);
    if (inf.getArcFiles().isEmpty()) {
      String errMsg="String_Node_Str" + "String_Node_Str" + jobID;
      log.warn(errMsg);
      NotificationsFactory.getInstance().errorEvent(errMsg);
    }
 else {
      uploadFiles(inf.getArcFiles(),errorMessage,failedFiles);
    }
    uploadFiles(inf.getMetadataArcFiles(),errorMessage,failedFiles);
    return generateHeritrixDomainHarvestReport(files,errorMessage);
  }
 catch (  IOFailure e) {
    String errMsg="String_Node_Str";
    log.warn(errMsg,e);
    throw new IOFailure(errMsg,e);
  }
}