From de0da299668d28752d8446c740871a48e81470ed Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Thu, 26 Jan 2017 13:53:29 -0500 Subject: [PATCH] fix typo in bundle and suggest adding a test #2290 #1612 --- src/main/java/Bundle.properties | 2 +- .../datasetutility/AddReplaceFileHelper.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/Bundle.properties b/src/main/java/Bundle.properties index 17ae058581d..395811e84f2 100755 --- a/src/main/java/Bundle.properties +++ b/src/main/java/Bundle.properties @@ -1539,7 +1539,7 @@ file.addreplace.error.initial_file_list_more_than_one=You cannot replace a singl file.addreplace.error.final_file_list_empty=There are no files to add. (This error should not happen if steps called in sequence.) file.addreplace.error.only_replace_operation=This should only be called for file replace operations! file.addreplace.error.failed_to_remove_old_file_from_dataset=Unable to remove old file from new DatasetVersion. -file.addreplace.error.add.add_file_error=Failed to add file the dataset. +file.addreplace.error.add.add_file_error=Failed to add file to dataset. file.addreplace.error.phase2_called_early_no_new_files=There was an error saving the dataset - no new files found. file.addreplace.success.add=File successfully added! file.addreplace.success.replace=File successfully replaced! 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 6fde6c6f685..c960345c08c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java +++ b/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java @@ -814,7 +814,12 @@ public Response.Status getHttpErrorCode(){ * * @param msgName * @return + * @deprecated This method is deprecated because you have to know to search + * only part of a bundle key ("add_file_error") rather than the full bundle + * key ("file.addreplace.error.add.add_file_error") leading you to believe + * that the bundle key is not used. */ + @Deprecated private String getBundleMsg(String msgName, boolean isErr){ if (msgName == null){ throw new NullPointerException("msgName cannot be null"); @@ -1421,10 +1426,16 @@ private boolean step_070_run_update_dataset_command(){ // dataset = commandEngine.submit(update_cmd); } catch (CommandException ex) { + /** + * @todo Add a test to exercise this error. + */ this.addErrorSevere(getBundleErr("add.add_file_error")); logger.severe(ex.getMessage()); return false; }catch (EJBException ex) { + /** + * @todo Add a test to exercise this error. + */ this.addErrorSevere("add.add_file_error (see logs)"); logger.severe(ex.getMessage()); return false;