Program: 89892
Project: 89892
Buggy source:
/** 
 * Removes a file from the bitarchives, if given credentials and checksum are correct.
 * @param fileName The name of the file to delete
 * @param bitarchiveId The id of the bitarchive to delete the file in
 * @param checksum The checksum of the deleted file
 * @param credentials The credentials used to delete the file
 * @throws ArgumentNotValid if arguments are null orequal to the empty string
 * @throws IOFailure if we could not delete the remote file, orsthere was no response to our RemoveAndGetFileMessage within the allotted time defined by the setting  {@link JMSArcRepositoryClient#ARCREPOSITORY_STORE_TIMEOUT}.
 * @return The file that was removed
 */
public File removeAndGetFile(String fileName,String bitarchiveId,String checksum,String credentials){
  ArgumentNotValid.checkNotNullOrEmpty(fileName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(bitarchiveId,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(checksum,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(credentials,"String_Node_Str");
  String msg="String_Node_Str" + fileName + "String_Node_Str"+ checksum+ "String_Node_Str"+ bitarchiveId+ "String_Node_Str";
  log.warn(msg);
  NotificationsFactory.getInstance().errorEvent(msg);
  RemoveAndGetFileMessage aMsg=new RemoveAndGetFileMessage(fileName,bitarchiveId,checksum,credentials);
  RemoveAndGetFileMessage replyMsg=(RemoveAndGetFileMessage)sendAndWaitForOneReply(aMsg,storeTimeout);
  if (replyMsg != null) {
    if (replyMsg.isOk()) {
      File removedFile=replyMsg.getData();
      log.debug("String_Node_Str" + fileName + "String_Node_Str"+ removedFile.getAbsolutePath());
      return removedFile;
    }
 else {
      String message="String_Node_Str" + replyMsg.getErrMsg();
      log.warn(message);
      throw new IOFailure(message);
    }
  }
 else {
    String message="String_Node_Str" + "String_Node_Str" + fileName + "String_Node_Str"+ bitarchiveId+ "String_Node_Str";
    log.warn(message);
    throw new IOFailure(message);
  }
}

Fixed version (ground truth):
/** 
 * Removes a file from the bitarchives, if given credentials and checksum are correct.
 * @param fileName     The name of the file to delete
 * @param bitarchiveId The id of the bitarchive to delete the file in
 * @param checksum     The checksum of the deleted file
 * @param credentials  The credentials used to delete the file
 * @return The file that was removed
 * @throws ArgumentNotValid if arguments are null or equal to the emptystring
 * @throws IOFailure        if we could not delete the remote file, orsthere was no response to our RemoveAndGetFileMessage within the allotted time defined by the setting {@link JMSArcRepositoryClient#ARCREPOSITORY_STORE_TIMEOUT}.
 */
public File removeAndGetFile(String fileName,String bitarchiveId,String checksum,String credentials){
  ArgumentNotValid.checkNotNullOrEmpty(fileName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(bitarchiveId,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(checksum,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(credentials,"String_Node_Str");
  String msg="String_Node_Str" + fileName + "String_Node_Str"+ checksum+ "String_Node_Str"+ bitarchiveId+ "String_Node_Str";
  log.warn(msg);
  NotificationsFactory.getInstance().errorEvent(msg);
  RemoveAndGetFileMessage aMsg=new RemoveAndGetFileMessage(fileName,bitarchiveId,checksum,credentials);
  RemoveAndGetFileMessage replyMsg=(RemoveAndGetFileMessage)sendAndWaitForOneReply(aMsg,storeTimeout);
  if (replyMsg != null) {
    if (replyMsg.isOk()) {
      File removedFile=replyMsg.getData();
      log.debug("String_Node_Str" + fileName + "String_Node_Str"+ removedFile.getAbsolutePath());
      return removedFile;
    }
 else {
      String message="String_Node_Str" + replyMsg.getErrMsg();
      log.warn(message);
      throw new IOFailure(message);
    }
  }
 else {
    String message="String_Node_Str" + "String_Node_Str" + fileName + "String_Node_Str"+ bitarchiveId+ "String_Node_Str";
    log.warn(message);
    throw new IOFailure(message);
  }
}