Program: 89867
Project: 89867
Buggy source:
/** 
 * Run any batch job on a replica, possibly restricted to a certain set of files, and place the output in the given file. The results will also be checked to verify that there for each file processed is a line in the output file.
 * @param job The BatchJob to run upon the archive.
 * @param replica The replica (which has to be a bitarchive) that the job should run on.
 * @param specifiedFiles  The files to run the job on, or null if it shouldrun on all files.
 * @param batchOutputFile Where to put the result of the job.
 * @throws IllegalState If the replica is not of the type 'BITARCHIVE', which is required for a batchjob.
 */
private void runBatchJob(FileBatchJob job,Replica replica,List<String> specifiedFiles,File batchOutputFile){
  if (!replica.getType().equals(ReplicaType.BITARCHIVE)) {
    String msg="String_Node_Str" + replica + "String_Node_Str"+ "String_Node_Str"+ ReplicaType.BITARCHIVE.name();
    log.warn(msg);
    throw new IllegalState(msg);
  }
  job.processOnlyFilesNamed(specifiedFiles);
  BatchStatus status=ArcRepositoryClientFactory.getPreservationInstance().batch(job,replica.getId());
  if (!status.hasResultFile()) {
    String msg="String_Node_Str" + replica + "String_Node_Str";
    log.warn(msg);
    throw new IOFailure(msg);
  }
  if (!status.getFilesFailed().isEmpty()) {
    String msg="String_Node_Str" + status.getFilesFailed().toString();
    log.warn(msg);
    throw new IOFailure(msg);
  }
  status.copyResults(batchOutputFile);
  log.info("String_Node_Str" + status.getNoOfFilesProcessed() + "String_Node_Str"+ replica);
}

Fixed version (ground truth):
/** 
 * Run any batch job on a replica, possibly restricted to a certain set of files, and place the output in the given file. The results will also be checked to verify that there for each file processed is a line in the output file.
 * @param job The BatchJob to run upon the archive.
 * @param replica The replica (which has to be a bitarchive) that the job should run on.
 * @param specifiedFiles  The files to run the job on, or null if it shouldrun on all files.
 * @param batchOutputFile Where to put the result of the job.
 * @throws IllegalState If the replica is not of the type 'BITARCHIVE', which is required for a batchjob.
 * @throws IOFailure If the batchjob status is invalid.
 */
private void runBatchJob(FileBatchJob job,Replica replica,List<String> specifiedFiles,File batchOutputFile) throws IOFailure, IllegalState {
  if (!replica.getType().equals(ReplicaType.BITARCHIVE)) {
    String msg="String_Node_Str" + replica + "String_Node_Str"+ "String_Node_Str"+ ReplicaType.BITARCHIVE.name();
    log.warn(msg);
    throw new IllegalState(msg);
  }
  job.processOnlyFilesNamed(specifiedFiles);
  BatchStatus status=ArcRepositoryClientFactory.getPreservationInstance().batch(job,replica.getId());
  if (!status.hasResultFile()) {
    String msg="String_Node_Str" + replica + "String_Node_Str";
    log.warn(msg);
    throw new IOFailure(msg);
  }
  if (!status.getFilesFailed().isEmpty()) {
    String msg="String_Node_Str" + status.getFilesFailed().toString();
    log.warn(msg);
    throw new IOFailure(msg);
  }
  status.copyResults(batchOutputFile);
  log.info("String_Node_Str" + status.getNoOfFilesProcessed() + "String_Node_Str"+ replica);
}