From 64af6f4450980999b8cd6c4eeba7d3dca0176b8d Mon Sep 17 00:00:00 2001 From: qqmyers Date: Tue, 10 Jan 2023 14:57:02 -0500 Subject: [PATCH] use equals! --- .../dataverse/datasetutility/AddReplaceFileHelper.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java b/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java index c4c4fe552be..ad03bcd550a 100644 --- a/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java +++ b/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java @@ -420,9 +420,7 @@ private boolean runForceReplaceFile(Long oldFileId, if (!this.step_005_loadFileToReplaceById(oldFileId)){ return false; } - logger.info("DS id: " + ds.getId()); - logger.info("Owner id: " + fileToReplace.getOwner().getId()); - if(ds.getId()!=fileToReplace.getOwner().getId()) { + if(!ds.getId().equals(fileToReplace.getOwner().getId())) { this.addErrorSevere(getBundleErr("existing_file_to_replace_not_in_dataset")); return false; } @@ -464,9 +462,8 @@ private boolean runReplaceFile(Long oldFileId, if (!this.step_005_loadFileToReplaceById(oldFileId)){ return false; } - logger.info("DS id: " + ds.getId()); - logger.info("Owner id: " + fileToReplace.getOwner().getId()); - if(ds.getId()!=fileToReplace.getOwner().getId()) { + + if(!ds.getId().equals(fileToReplace.getOwner().getId())) { this.addErrorSevere(getBundleErr("existing_file_to_replace_not_in_dataset")); return false; }