Program: 89778
Project: 89778
Buggy source:
/** 
 * Retrieves all the checksum from the replica through a GetAllChecksumMessage. This is the checksum archive alternative to running a ChecksumBatchJob.
 * @param replicaId The id of the replica from which the checksums should beretrieved.
 * @return A file containing filename and checksum of all the files in an archive in the same format as a ChecksumJob. 
 * @throws IOFailure If the reply is not of type GetAllChecksumsMessageor if the file could not properly be retrieved from the reply message or if the message timed out.
 * @throws ArgumentNotValid If the replicaId is null or empty. 
 * @see dk.netarkivet.archive.checksum.distribute.GetAllChecksumsMessage
 */
public File getAllChecksums(String replicaId) throws IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(replicaId,"String_Node_Str");
  log.debug("String_Node_Str" + replicaId + "String_Node_Str");
  long start=System.currentTimeMillis();
  GetAllChecksumsMessage gacMsg=new GetAllChecksumsMessage(Channels.getTheRepos(),replyQ,replicaId);
  NetarkivetMessage replyNetMsg=sendAndWaitForOneReply(gacMsg,getTimeout);
  long timePassed=System.currentTimeMillis() - start;
  log.debug("String_Node_Str" + (timePassed / MILLISECONDS_PER_SECOND) + "String_Node_Str");
  if (replyNetMsg == null) {
    throw new IOFailure("String_Node_Str" + (getTimeout / MILLISECONDS_PER_SECOND) + "String_Node_Str");
  }
  GetAllChecksumsMessage replyCSMsg;
  try {
    replyCSMsg=(GetAllChecksumsMessage)replyNetMsg;
  }
 catch (  ClassCastException e) {
    throw new IOFailure("String_Node_Str" + replyNetMsg,e);
  }
  try {
    File result=File.createTempFile("String_Node_Str","String_Node_Str",FileUtils.getTempDir());
    replyCSMsg.getData(result);
    return result;
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + replyCSMsg,e);
  }
}

Fixed version (ground truth):
/** 
 * Retrieves all the checksum from the replica through a GetAllChecksumMessage. This is the checksum archive alternative to running a ChecksumBatchJob.
 * @param replicaId The id of the replica from which the checksums should beretrieved.
 * @return A file containing filename and checksum of all the files in an archive in the same format as a ChecksumJob. 
 * @throws IOFailure If the reply is not of type GetAllChecksumsMessageor if the file could not properly be retrieved from the reply message or if the message timed out.
 * @throws ArgumentNotValid If the replicaId is null or empty. 
 * @see dk.netarkivet.archive.checksum.distribute.GetAllChecksumsMessage
 */
public File getAllChecksums(String replicaId) throws IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(replicaId,"String_Node_Str");
  log.debug("String_Node_Str" + replicaId + "String_Node_Str");
  long start=System.currentTimeMillis();
  GetAllChecksumsMessage gacMsg=new GetAllChecksumsMessage(Channels.getTheRepos(),replyQ,replicaId);
  NetarkivetMessage replyNetMsg=sendAndWaitForOneReply(gacMsg,0);
  long timePassed=System.currentTimeMillis() - start;
  log.debug("String_Node_Str" + (timePassed / MILLISECONDS_PER_SECOND) + "String_Node_Str");
  if (replyNetMsg == null) {
    throw new IOFailure("String_Node_Str" + (getTimeout / MILLISECONDS_PER_SECOND) + "String_Node_Str");
  }
  GetAllChecksumsMessage replyCSMsg;
  try {
    replyCSMsg=(GetAllChecksumsMessage)replyNetMsg;
  }
 catch (  ClassCastException e) {
    throw new IOFailure("String_Node_Str" + replyNetMsg,e);
  }
  try {
    File result=File.createTempFile("String_Node_Str","String_Node_Str",FileUtils.getTempDir());
    replyCSMsg.getData(result);
    return result;
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + replyCSMsg,e);
  }
}