Program: 90146
Project: 90146
Buggy source:
/** 
 * Get the checksum of a list of files in a bitarchive. Note that this method runs a batch job on the bitarchives, and therefore may take a long time, depending on network delays.
 * @param ba       The bitarchive to ask for checksum
 * @param filenames The names of the files to ask for checksums for
 * @return The MD5 checksums of the files, or the empty string if the filewas not in the bitarchive.
 * @see ChecksumJob#parseLine(String)
 */
private Map<String,List<String>> getChecksums(Location ba,Set<String> filenames){
  ChecksumJob checksumJob=new ChecksumJob();
  checksumJob.processOnlyFilesNamed(new ArrayList<String>(filenames));
  String batchResult;
  try {
    PreservationArcRepositoryClient arcrep=ArcRepositoryClientFactory.getPreservationInstance();
    BatchStatus batchStatus=arcrep.batch(checksumJob,ba.getName());
    if (batchStatus.hasResultFile()) {
      ByteArrayOutputStream buf=new ByteArrayOutputStream();
      batchStatus.appendResults(buf);
      try {
        batchResult=buf.toString("String_Node_Str");
      }
 catch (      UnsupportedEncodingException e) {
        throw new IOFailure("String_Node_Str",e);
      }
    }
 else {
      batchResult="String_Node_Str";
    }
  }
 catch (  NetarkivetException e) {
    log.warn("String_Node_Str" + ba + "String_Node_Str",e);
    return Collections.emptyMap();
  }
  Map<String,List<String>> filesAndChecksums=new HashMap<String,List<String>>();
  if (batchResult.length() > 0) {
    String[] lines=batchResult.split("String_Node_Str");
    List<String> checksums=new ArrayList<String>();
    for (    String s : lines) {
      try {
        KeyValuePair<String,String> fileChecksum=ChecksumJob.parseLine(s);
        if (!filenames.contains(fileChecksum.getKey())) {
          log.debug("String_Node_Str" + fileChecksum.getKey() + "String_Node_Str"+ "String_Node_Str"+ ba+ "String_Node_Str"+ filenames+ "String_Node_Str");
        }
 else {
          checksums.add(fileChecksum.getValue());
        }
      }
 catch (      ArgumentNotValid e) {
        log.warn("String_Node_Str" + s + "String_Node_Str"+ ba+ "String_Node_Str"+ filenames+ "String_Node_Str");
      }
    }
  }
 else {
    log.debug("String_Node_Str" + checksumJob);
  }
  return filesAndChecksums;
}

Fixed version (ground truth):
/** 
 * Get the checksum of a list of files in a bitarchive. Note that this method runs a batch job on the bitarchives, and therefore may take a long time, depending on network delays.
 * @param ba       The bitarchive to ask for checksum
 * @param filenames The names of the files to ask for checksums for
 * @return The MD5 checksums of the files, or the empty string if the filewas not in the bitarchive.
 * @see ChecksumJob#parseLine(String)
 */
private Map<String,List<String>> getChecksums(Location ba,Set<String> filenames){
  ChecksumJob checksumJob=new ChecksumJob();
  checksumJob.processOnlyFilesNamed(new ArrayList<String>(filenames));
  String batchResult;
  try {
    PreservationArcRepositoryClient arcrep=ArcRepositoryClientFactory.getPreservationInstance();
    BatchStatus batchStatus=arcrep.batch(checksumJob,ba.getName());
    if (batchStatus.hasResultFile()) {
      ByteArrayOutputStream buf=new ByteArrayOutputStream();
      batchStatus.appendResults(buf);
      try {
        batchResult=buf.toString("String_Node_Str");
      }
 catch (      UnsupportedEncodingException e) {
        throw new IOFailure("String_Node_Str",e);
      }
    }
 else {
      batchResult="String_Node_Str";
    }
  }
 catch (  NetarkivetException e) {
    log.warn("String_Node_Str" + ba + "String_Node_Str",e);
    return Collections.emptyMap();
  }
  Map<String,List<String>> filesAndChecksums=new HashMap<String,List<String>>();
  if (batchResult.length() > 0) {
    String[] lines=batchResult.split("String_Node_Str");
    for (    String s : lines) {
      try {
        KeyValuePair<String,String> fileChecksum=ChecksumJob.parseLine(s);
        final String filename=fileChecksum.getKey();
        final String checksum=fileChecksum.getValue();
        if (!filenames.contains(filename)) {
          log.debug("String_Node_Str" + filename + "String_Node_Str"+ "String_Node_Str"+ ba+ "String_Node_Str"+ filenames+ "String_Node_Str");
        }
 else {
          List<String> checksums;
          if (filesAndChecksums.containsKey(filename)) {
            checksums=filesAndChecksums.get(filename);
          }
 else {
            checksums=new ArrayList<String>();
            filesAndChecksums.put(filename,checksums);
          }
          checksums.add(checksum);
        }
      }
 catch (      ArgumentNotValid e) {
        log.warn("String_Node_Str" + s + "String_Node_Str"+ ba+ "String_Node_Str"+ filenames+ "String_Node_Str");
      }
    }
  }
 else {
    log.debug("String_Node_Str" + checksumJob);
  }
  return filesAndChecksums;
}