Program: 89775
Project: 89775
Buggy source:
/** 
 * Retrieves the names of all the files in the replica through a GetAllFilenamesMessage. This is the checksum archive alternative to running a FilelistBatchJob.
 * @param replicaId The id of the replica from which the list of filenamesshould be retrieved.
 * @return A file with all the filenames within the archive of the givenreplica. A null is returned if the message timeout.
 * @throws IOFailure If the reply is not of type GetAllFilenamesMessageor if the file could not properly be retrieved from the reply message
 * @throws ArgumentNotValid If the replicaId is null or empty. 
 * @see dk.netarkivet.archive.checksum.distribute.GetAllFilenamesMessage
 */
public File getAllFilenames(String replicaId) throws ArgumentNotValid, IOFailure {
  ArgumentNotValid.checkNotNullOrEmpty(replicaId,"String_Node_Str");
  log.debug("String_Node_Str" + replicaId + "String_Node_Str");
  long start=System.currentTimeMillis();
  GetAllFilenamesMessage gafMsg=new GetAllFilenamesMessage(Channels.getTheRepos(),replyQ,replicaId);
  NetarkivetMessage replyNetMsg=sendAndWaitForOneReply(gafMsg,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");
  }
  GetAllFilenamesMessage replyCSMsg;
  try {
    replyCSMsg=(GetAllFilenamesMessage)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 the names of all the files in the replica through a GetAllFilenamesMessage. This is the checksum archive alternative to running a FilelistBatchJob.
 * @param replicaId The id of the replica from which the list of filenamesshould be retrieved.
 * @return A file with all the filenames within the archive of the givenreplica. A null is returned if the message timeout.
 * @throws IOFailure If the reply is not of type GetAllFilenamesMessageor if the file could not properly be retrieved from the reply message
 * @throws ArgumentNotValid If the replicaId is null or empty. 
 * @see dk.netarkivet.archive.checksum.distribute.GetAllFilenamesMessage
 */
public File getAllFilenames(String replicaId) throws ArgumentNotValid, IOFailure {
  ArgumentNotValid.checkNotNullOrEmpty(replicaId,"String_Node_Str");
  log.debug("String_Node_Str" + replicaId + "String_Node_Str");
  long start=System.currentTimeMillis();
  GetAllFilenamesMessage gafMsg=new GetAllFilenamesMessage(Channels.getTheRepos(),replyQ,replicaId);
  NetarkivetMessage replyNetMsg=sendAndWaitForOneReply(gafMsg,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");
  }
  GetAllFilenamesMessage replyCSMsg;
  try {
    replyCSMsg=(GetAllFilenamesMessage)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);
  }
}