diff --git a/CHANGELOG.md b/CHANGELOG.md index 182efa731d4..b46c5debb96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the arrow keys in the search bar did not work as expected [#3081](https://github.com/JabRef/jabref/issues/3081) - We fixed wrong hotkey being displayed at "automatically file links" in the entry editor - We fixed an issue where metadata syncing with local and shared database were unstable. It will also fix syncing groups and sub-groups in database. [#2284](https://github.com/JabRef/jabref/issues/2284) +- We fixed an issue where it was possible to leave the entry editor with an imbalance of braces. [#3167](https://github.com/JabRef/jabref/issues/3167) - Renaming files now truncates the filename to not exceed the limit of 255 chars [#2622](https://github.com/JabRef/jabref/issues/2622) ### Removed diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 16300d5199b..b483727e305 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -13,8 +13,10 @@ import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.stream.Collectors; import javax.swing.AbstractAction; import javax.swing.Action; @@ -71,6 +73,7 @@ import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.EntryBasedFetcher; import org.jabref.logic.importer.WebFetchers; +import org.jabref.logic.integrity.BracesCorrector; import org.jabref.logic.l10n.Localization; import org.jabref.logic.search.SearchQueryHighlightListener; import org.jabref.logic.util.OS; @@ -88,6 +91,7 @@ import org.apache.commons.logging.LogFactory; import org.fxmisc.easybind.EasyBind; + /** * GUI component that allows editing of the fields of a BibEntry (i.e. the * one that shows up, when you double click on an entry in the table) @@ -631,7 +635,6 @@ public void actionPerformed(ActionEvent e) { } private class CloseAction extends AbstractAction { - private CloseAction() { super(Localization.lang("Close window"), IconTheme.JabRefIcon.CLOSE.getSmallIcon()); putValue(Action.SHORT_DESCRIPTION, Localization.lang("Close window")); @@ -639,6 +642,15 @@ private CloseAction() { @Override public void actionPerformed(ActionEvent e) { + Map cleanedEntries = entry + .getFieldMap() + .entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, f -> BracesCorrector.apply(f.getValue()))); + if (!cleanedEntries.equals(entry.getFieldMap())) { + frame.output(Localization.lang("Added missing braces.")); + } + entry.setField(cleanedEntries); panel.entryEditorClosing(EntryEditor.this); } } diff --git a/src/main/java/org/jabref/logic/integrity/BracesCorrector.java b/src/main/java/org/jabref/logic/integrity/BracesCorrector.java new file mode 100644 index 00000000000..75d59fb5bee --- /dev/null +++ b/src/main/java/org/jabref/logic/integrity/BracesCorrector.java @@ -0,0 +1,33 @@ +package org.jabref.logic.integrity; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class BracesCorrector { + + private static final Pattern PATTERN_ESCAPED_CURLY_BRACES = Pattern.compile("(\\\\\\{)|(\\\\\\})"); + //private static final Pattern PATTERN_ESCAPED_CLOSING_CURLY_BRACE = Pattern.compile(""); + + public static String apply(String input) { + if (input == null) { + return null; + } else { + Matcher matcher = PATTERN_ESCAPED_CURLY_BRACES.matcher(input); + String addedBraces = input; + String c = matcher.replaceAll(""); + + long diff = c.chars().filter(ch -> ch == '{').count() - c.chars().filter(ch -> ch == '}').count(); + while (diff != 0) { + if (diff < 0) { + addedBraces = "{" + addedBraces; + diff++; + } else { + addedBraces = addedBraces + "}"; + diff--; + } + } + return addedBraces; + } + } + +} diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index 0be1fb87192..26b6a4fc41f 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -69,6 +69,8 @@ Add_to_group=Tilføj_i_gruppe Added_group_"%0".=Tilføjede_gruppe_"%0". +Added_missing_braces.= + Added_new=Tilføjede_ny Added_string=Tilføjede_streng diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index 2e747f6b757..1538baac3ae 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -1,7 +1,7 @@ #! -#!created/edited_by_Popeye_version_0.55_(github.com/JabRef/popeye) -#!encoding:UTF-8 +#! created/edited by Popeye version 0.55 (github.com/JabRef/popeye) +#! encoding:UTF-8 %0_contains_the_regular_expression_%1=%0_den_regulären_Ausdruck_%1_enthält @@ -69,6 +69,8 @@ Add_to_group=Zu_Gruppe_hinzufügen Added_group_"%0".=Gruppe_"%0"_hinzugefügt. +Added_missing_braces.=Fehlende_Klammern_hinzugefügt. + Added_new=Neu_hinzugefügt Added_string=String_hinzugefügt diff --git a/src/main/resources/l10n/JabRef_el.properties b/src/main/resources/l10n/JabRef_el.properties index 691e5fbe8ac..31607a5bf68 100644 --- a/src/main/resources/l10n/JabRef_el.properties +++ b/src/main/resources/l10n/JabRef_el.properties @@ -38,6 +38,7 @@ Abstract=Περίληψη Accept=Αποδοχή Accept_change=Αποδοχή_αλλαγής + Action= What_is_Mr._DLib?= @@ -68,9 +69,12 @@ Add_to_group=Προσθήκη_στην_ομάδα Added_group_"%0".=Προστέθηκε_στην_ομάδα_"%0". +Added_missing_braces.= + Added_new=Προστέθηκε_νέο Added_string=Προστέθηκε_string + Additionally,_entries_whose_%0_field_does_not_contain_%1_can_be_assigned_manually_to_this_group_by_selecting_them_then_using_either_drag_and_drop_or_the_context_menu._This_process_adds_the_term_%1_to_each_entry's_%0_field._Entries_can_be_removed_manually_from_this_group_by_selecting_them_then_using_the_context_menu._This_process_removes_the_term_%1_from_each_entry's_%0_field.= Advanced=Για_προχωρημένους @@ -78,46 +82,76 @@ All_entries=Όλες_entries All_entries_of_this_type_will_be_declared_typeless._Continue?= All_fields=Όλα_τα_πεδία + Always_reformat_BIB_file_on_save_and_export= + A_SAX_exception_occurred_while_parsing_'%0'\:= and=και and_the_class_must_be_available_in_your_classpath_next_time_you_start_JabRef.= + any_field_that_matches_the_regular_expression_%0= Appearance=Εμφάνιση + Append= Append_contents_from_a_BibTeX_library_into_the_currently_viewed_library= Append_library= + Append_the_selected_text_to_BibTeX_field= Application=Εφαρμογή + Apply= + Arguments_passed_on_to_running_JabRef_instance._Shutting_down.= + Assign_new_file= + Assign_the_original_group's_entries_to_this_group?= + Assigned_%0_entries_to_group_"%1".= + Assigned_1_entry_to_group_"%0".= + Attach_URL= + Attempt_to_automatically_set_file_links_for_your_entries._Automatically_setting_works_if_a_file_in_your_file_directory
or_a_subdirectory_is_named_identically_to_an_entry's_BibTeX_key,_plus_extension.= + Autodetect_format= + Autogenerate_BibTeX_keys= + Autolink_files_with_names_starting_with_the_BibTeX_key= + Autolink_only_files_that_match_the_BibTeX_key= + Automatically_create_groups= + Automatically_remove_exact_duplicates= + Allow_overwriting_existing_links.= + Do_not_overwrite_existing_links.= + AUX_file_import= + Available_export_formats= + Available_BibTeX_fields= + Available_import_formats= + Background_color_for_optional_fields= + Background_color_for_required_fields= + Backup_old_file_when_saving= + BibTeX_key_is_unique.= %0_source= + Broken_link= Browse=Περιήγηση @@ -125,29 +159,45 @@ Browse=Περιήγηση by=από Cancel=Ακύρωση + Cannot_add_entries_to_group_without_generating_keys._Generate_keys_now?= + Cannot_merge_this_change= + case_insensitive= + case_sensitive= + Case_sensitive= + change_assignment_of_entries= + Change_case= + Change_entry_type= Change_file_type= + + Change_of_Grouping_Method= + change_preamble= + Change_table_column_and_General_fields_settings_to_use_the_new_feature= Changed_font_settings=Αλλαγμένες_ρυθμίσεις_γραμματοσειράς Changed_language_settings=Αλλαγή_ρυθμίσεων_γλώσσας + Changed_look_and_feel_settings= + Changed_preamble= Check_existing_file_links=Έλεγχος_συνδέσμων_υπάρχοντων_αρχείων Check_links=Έλεγχος_συνδέσμων + Cite_command= + Class_name= Clear=Καθαρισμός @@ -165,7 +215,9 @@ Close_the_current_library= Close_window=Κλείσιμο_παραθύρου Closed_library= + Color_codes_for_required_and_optional_fields= + Color_for_marking_incomplete_entries= Column_width=Μήκος_στήλης @@ -178,38 +230,58 @@ Contained_in=Περιέχεται_σε Content=Περιεχόμενο Copied=Αντιγράφηκε + Copied_cell_contents= Copied_title= + Copied_key= Copied_titles= + Copied_keys= Copy=Αντιγραφή + Copy_BibTeX_key= Copy_file_to_file_directory= + Copy_to_clipboard= + Could_not_call_executable= Could_not_connect_to_Vim_server._Make_sure_that_Vim_is_running
with_correct_server_name.= + Could_not_export_file= + Could_not_export_preferences= + Could_not_find_a_suitable_import_format.= Could_not_import_preferences= + Could_not_instantiate_%0= Could_not_instantiate_%0_%1= Could_not_instantiate_%0._Have_you_chosen_the_correct_package_path?= Could_not_open_link= + Could_not_print_preview= + Could_not_run_the_'vim'_program.= + Could_not_save_file.= Character_encoding_'%0'_is_not_supported.= + crossreferenced_entries_included= + Current_content= + Current_value= + Custom_entry_types= + Custom_entry_types_found_in_file= + Customize_entry_types= + Customize_key_bindings= Cut=Αποκοπή @@ -224,50 +296,76 @@ Library_encoding= Library_properties= Library_type= + Date_format= Default=Προεπιλογή Default_encoding=Προεπιλεγμένη_κωδικοποίηση + Default_grouping_field= + Default_look_and_feel= + Default_pattern= + Default_sort_criteria= Define_'%0'= Delete=Διαγραφή + Delete_custom_format= + delete_entries= + Delete_entry= + delete_entry= + Delete_multiple_entries= Delete_rows=Διαγραφή_γραμμών + Delete_strings= Deleted=Διαγράφηκε Permanently_delete_local_file= + Delimit_fields_with_semicolon,_ex.= + Descending= Description=Περιγραφή + Deselect_all= Deselect_all_duplicates= + Disable_this_confirmation_dialog= + Display_all_entries_belonging_to_one_or_more_of_the_selected_groups.= + Display_all_error_messages= + Display_help_on_command_line_options= + Display_only_entries_belonging_to_all_selected_groups.= Display_version= + Do_not_abbreviate_names= + Do_not_automatically_set= + Do_not_import_entry= + Do_not_open_any_files_at_startup= + Do_not_overwrite_existing_keys= Do_not_show_these_options_in_the_future= + Do_not_wrap_the_following_fields_when_saving= Do_not_write_the_following_fields_to_XMP_Metadata\:= + Do_you_want_JabRef_to_do_the_following_operations?= Donate_to_JabRef=Δωρεά_στο_JabRef @@ -277,28 +375,39 @@ Down=Κάτω Download_file=Κατέβασμα_αρχείου Downloading...=Κατεβαίνει... + Drop_%0= duplicate_removal=διαγραφή_διπλότυπων + Duplicate_string_name= Duplicates_found=Βρέθηκαν_διπλότυπα + Dynamic_groups= + Dynamically_group_entries_by_a_free-form_search_expression= + Dynamically_group_entries_by_searching_a_field_for_a_keyword= + Each_line_must_be_on_the_following_form= Edit=Επεξεργασία + Edit_custom_export= Edit_entry=Επεξεργασία_entry Save_file=Αποθήκευση_αρχείου Edit_file_type= Edit_group=Επεξεργασία_ομάδας + + Edit_preamble= Edit_strings= Editor_options= + Empty_BibTeX_key= + Grouping_may_not_work_for_this_entry.= empty_library= @@ -307,109 +416,184 @@ Enable_word/name_autocompletion= Enter_URL=Εισάγετε_URL Enter_URL_to_download=Εισάγετε_URL_για_κατέβασμα + entries= + Entries_cannot_be_manually_assigned_to_or_removed_from_this_group.= + Entries_exported_to_clipboard= + + entry= + Entry_editor= + Entry_preview= + Entry_table= + Entry_table_columns= + Entry_type= + Entry_type_names_are_not_allowed_to_contain_white_space_or_the_following_characters= + Entry_types= + Error= Error_exporting_to_clipboard= + Error_occurred_when_parsing_entry= + Error_opening_file= + Error_setting_field= + Error_while_writing= Error_writing_to_%0_file(s).= + + + '%0'_exists._Overwrite_file?= Overwrite_file?= Export=Εξαγωγή + Export_name= + Export_preferences= + Export_preferences_to_file= + Export_properties= + Export_to_clipboard= + Exporting= Extension= + External_changes= + External_file_links= + External_programs= + External_viewer_called= + Fetch= + Field= + field= + Field_name= Field_names_are_not_allowed_to_contain_white_space_or_the_following_characters= + Field_to_filter= + Field_to_group_by= + File= + file= File_'%0'_is_already_open.= + File_changed= File_directory_is_'%0'\:= + File_directory_is_not_set_or_does_not_exist\!= + File_exists= + File_has_been_updated_externally._What_do_you_want_to_do?= + File_not_found= File_type= + File_updated_externally= + filename= Filename= + Files_opened= + Filter= Filter_All= Filter_None= + Finished_automatically_setting_external_links.= + Finished_synchronizing_file_links._Entries_changed\:_%0.= Finished_writing_XMP-metadata._Wrote_to_%0_file(s).= Finished_writing_XMP_for_%0_file_(%1_skipped,_%2_errors).= + First_select_the_entries_you_want_keys_to_be_generated_for.= + Fit_table_horizontally_on_screen= + Float= Float_marked_entries= + Font_family= + Font_preview= + Font_size= + Font_style= + Font_selection= + for= + Format_of_author_and_editor_names= Format_string= + Format_used= Formatter_name= + found_in_AUX_file= Full_name=Πλήρες_όνομα General=Γενικά + General_fields= + Generate= + Generate_BibTeX_key= + Generate_keys= + Generate_keys_before_saving_(for_entries_without_a_key)= Generate_keys_for_imported_entries= + Generate_now= + Generated_BibTeX_key_for= + Generating_BibTeX_key_for= Get_fulltext= + Gray_out_non-hits= Groups=Ομάδες + Have_you_chosen_the_correct_package_path?= Help=Βοήθεια + Help_on_key_patterns= Help_on_regular_expression_search= + Hide_non-hits= + Hierarchical_context= + Highlight= Marking= Underline= @@ -417,194 +601,332 @@ Empty_Highlight= Empty_Marking= Empty_Underline= The_marked_area_does_not_contain_any_legible_text!= + Hint\:_To_search_specific_fields_only,_enter_for_example\:

author\=smith_and_title\=electrical= + HTML_table= HTML_table_(with_Abstract_&_BibTeX)= Icon= Ignore=Παράβλεψη + Import= + Import_and_keep_old_entry= + Import_and_remove_old_entry= + Import_entries= + Import_failed= + Import_file= + Import_group_definitions= + Import_name= + Import_preferences= + Import_preferences_from_file= + Import_strings= + Import_to_open_tab= + Import_word_selector_definitions= + Imported_entries= Imported_from_library= Importer_class= + Importing= + Importing_in_unknown_format= + Include_abstracts= Include_entries= + Include_subgroups\:_When_selected,_view_entries_contained_in_this_group_or_its_subgroups= + Independent_group\:_When_selected,_view_only_this_group's_entries= + Work_options= + Insert= + Insert_rows= + Intersection= + Invalid_BibTeX_key= + Invalid_date_format= + Invalid_URL= + Online_help= + JabRef_preferences= Join= Joins_selected_keywords_and_deletes_selected_keywords.= + Journal_abbreviations= + Keep= + Keep_both= + Key_bindings= + Key_bindings_changed= + Key_generator_settings= + Key_pattern= keys_in_library= + Keyword= + Label= + Language= + Last_modified= + LaTeX_AUX_file= Leave_file_in_its_current_directory= + Left= Level= + Limit_to_fields= + Limit_to_selected_entries= + Link= Link_local_file= Link_to_file_%0= + Listen_for_remote_operation_on_port= Load_and_Save_preferences_from/to_jabref.xml_on_start-up_(memory_stick_mode)= + Look_and_feel= Main_file_directory= + Main_layout_file= + Manage_custom_exports= + Manage_custom_imports= Manage_external_file_types= + Mark_entries= + Mark_entry= + Mark_new_entries_with_addition_date= + Mark_new_entries_with_owner_name= + Memory_stick_mode= + Menu_and_label_font_size= + Merged_external_changes= + Messages= + Modification_of_field= + Modified_group_"%0".= + Modified_groups= + Modified_string= + Modify= + modify_group= + Move_down= + Move_external_links_to_'file'_field= + move_group= + Move_up= + Moved_group_"%0".= + Name= Name_formatter= + Natbib_style= + nested_AUX_files= + New= + new= + New_BibTeX_entry= New_BibTeX_sublibrary= + New_content= New_library_created.= New_%0_library= New_field_value= + New_group= + New_string= + Next_entry= + No_actual_changes_found.= + no_base-BibTeX-file_specified= no_library_generated= + No_entries_found._Please_make_sure_you_are_using_the_correct_import_filter.= + + No_entries_found_for_the_search_string_'%0'= + No_entries_imported.= + No_files_found.= + No_GUI._Only_process_command_line_options.= + No_journal_names_could_be_abbreviated.= + No_journal_names_could_be_unabbreviated.= No_PDF_linked= Open_PDF= + No_URL_defined= not= + not_found= + Note_that_you_must_specify_the_fully_qualified_class_name_for_the_look_and_feel,= + Nothing_to_redo= + Nothing_to_undo= + occurrences= + OK= One_or_more_file_links_are_of_the_type_'%0',_which_is_undefined._What_do_you_want_to_do?= + One_or_more_keys_will_be_overwritten._Continue?= + + Open= Open_BibTeX_library= Open_library= + Open_editor_when_a_new_entry_is_created= + Open_file= Open_last_edited_libraries_at_startup= Connect_to_shared_database= + Open_terminal_here= + Open_URL_or_DOI= Opened_library= + Opening= + Opening_preferences...= + Operation_canceled.= Operation_not_supported= + Optional_fields= + Options= + or= + Output_or_export_file= + Override= + Override_default_file_directories= + Override_default_font_settings= + Override_the_BibTeX_field_by_the_selected_text= + + Overwrite= Overwrite_existing_field_values= + Overwrite_keys= + pairs_processed= Password= + Paste= + paste_entries= + paste_entry= Paste_from_clipboard= + Pasted= + Path_to_%0_not_defined= + Path_to_LyX_pipe= + PDF_does_not_exist= File_has_no_attached_annotations= Reload_annotations= + Plain_text_import= + Please_enter_a_name_for_the_group.= + Please_enter_a_search_term._For_example,_to_search_all_fields_for_Smith,_enter\:

smith

To_search_the_field_Author_for_Smith_and_the_field_Title_for_electrical,_enter\:

author\=smith_and_title\=electrical= + Please_enter_the_field_to_search_(e.g._keywords)_and_the_keyword_to_search_it_for_(e.g._electrical).= + Please_enter_the_string's_label= + Please_select_an_importer.= + Possible_duplicate_entries= + Possible_duplicate_of_existing_entry._Click_to_resolve.= + Preamble= + Preferences= + Preferences_recorded.= + Preview= Citation_Style= Current_Preview= @@ -614,232 +936,396 @@ Error_while_generating_citation_style= Preview_style_changed_to\:_%0= Next_preview_layout= Previous_preview_layout= + Previous_entry= + Primary_sort_criterion= Problem_with_parsing_entry= Processing_%0= Pull_changes_from_shared_database= + Pushed_citations_to_%0= + Quit_JabRef= + Quit_synchronization= + Raw_source= + Rearrange_tabs_alphabetically_by_title= + Redo= Reference_library= %0_references_found._Number_of_references_to_fetch?= + Refine_supergroup\:_When_selected,_view_entries_contained_in_both_this_group_and_its_supergroup= + regular_expression= Related_articles= + Remote_operation= + Remote_server_port= + Remove= + Remove_subgroups= + Remove_all_subgroups_of_"%0"?= + Remove_entry_from_import= Remove_selected_entries_from_this_group= + Remove_entry_type= + Remove_from_group= + Remove_group= + Remove_group,_keep_subgroups= + Remove_group_"%0"?= + Remove_group_"%0"_and_its_subgroups?= + remove_group_(keep_subgroups)= + remove_group_and_subgroups= + Remove_group_and_subgroups= + Remove_link= + Remove_old_entry= + Remove_selected_strings= + Removed_group_"%0".= + Removed_group_"%0"_and_its_subgroups.= + Removed_string= + Renamed_string= Replace= + Replace_(regular_expression)= + Replace_string= + Replace_with= + Replaced= + Required_fields= + Reset_all= + Resolve_strings_for_all_fields_except= Resolve_strings_for_standard_BibTeX_fields_only= + resolved= + Revert_to_original_source= + Review= + Review_changes= + Right= + Save= Save_all_finished.= Save_all_open_libraries= + Save_before_closing= Save_library= Save_library_as...= + Save_entries_in_their_original_order= + Save_failed= + Save_failed_during_backup_creation= + Save_selected_as...= Saved_library= + Saved_selected_to_'%0'.= + Saving= Saving_all_libraries...= Saving_library= + Search= + Search_expression= + Search_for= + Searching_for_duplicates...= + Searching_for_files= + Secondary_sort_criterion= + Select_all= + Select_encoding= + Select_entry_type= Select_external_application= + Select_file_from_ZIP-archive= + Select_the_tree_nodes_to_view_and_accept_or_reject_changes= Selected_entries= Set_field= Set_fields= + Set_general_fields= Set_main_external_file_directory= + Set_table_font= + Settings= + Shortcut= Show/edit_%0_source= + Show_'Firstname_Lastname'= + Show_'Lastname,_Firstname'= + Show_BibTeX_source_by_default= + Show_confirmation_dialog_when_deleting_entries= + Show_description= + Show_file_column= + Show_last_names_only= + Show_names_unchanged= + Show_optional_fields= + Show_required_fields= + Show_URL/DOI_column= + Simple_HTML= + Size= + Skipped_-_No_PDF_linked= Skipped_-_PDF_does_not_exist= + Skipped_entry.= + source_edit= Special_name_formatters= + Special_table_columns= + Starting_import= + Statically_group_entries_by_manual_assignment= + Status= + Stop= + Strings= Strings_for_library= Sublibrary_from_AUX= + Switches_between_full_and_abbreviated_journal_name_if_the_journal_name_is_known.= + Synchronize_file_links= + Synchronizing_file_links...= + Table_appearance= + Table_background_color= + Table_grid_color= + Table_text_color= + Tabname= Target_file_cannot_be_a_directory.= + Tertiary_sort_criterion= + Test= + paste_text_here= + The_chosen_date_format_for_new_entries_is_not_valid= + The_chosen_encoding_'%0'_could_not_encode_the_following_characters\:= + + the_field_%0= + The_file
'%0'
has_been_modified
externally\!= + The_group_"%0"_already_contains_the_selection.= + The_label_of_the_string_cannot_be_a_number.= + The_label_of_the_string_cannot_contain_spaces.= + The_label_of_the_string_cannot_contain_the_'\#'_character.= + The_output_option_depends_on_a_valid_import_option.= The_PDF_contains_one_or_several_BibTeX-records.= Do_you_want_to_import_these_as_new_entries_into_the_current_library?= + The_regular_expression_%0_is_invalid\:= + The_search_is_case_insensitive.= + The_search_is_case_sensitive.= + The_string_has_been_removed_locally= + There_are_possible_duplicates_(marked_with_an_icon)_that_haven't_been_resolved._Continue?= + This_entry_has_no_BibTeX_key._Generate_key_now?= + This_entry_is_incomplete= + This_entry_type_cannot_be_removed.= + This_external_link_is_of_the_type_'%0',_which_is_undefined._What_do_you_want_to_do?= + This_group_contains_entries_based_on_manual_assignment._Entries_can_be_assigned_to_this_group_by_selecting_them_then_using_either_drag_and_drop_or_the_context_menu._Entries_can_be_removed_from_this_group_by_selecting_them_then_using_the_context_menu.= + This_group_contains_entries_whose_%0_field_contains_the_keyword_%1= + This_group_contains_entries_whose_%0_field_contains_the_regular_expression_%1= This_makes_JabRef_look_up_each_file_link_and_check_if_the_file_exists._If_not,_you_will_be_given_options
to_resolve_the_problem.= + This_operation_requires_all_selected_entries_to_have_BibTeX_keys_defined.= + This_operation_requires_one_or_more_entries_to_be_selected.= + Toggle_entry_preview= Toggle_groups_interface= Try_different_encoding= + Unabbreviate_journal_names_of_the_selected_entries= Unabbreviated_%0_journal_names.= + Unable_to_open_file.= Unable_to_open_link._The_application_'%0'_associated_with_the_file_type_'%1'_could_not_be_called.= unable_to_write_to= Undefined_file_type= + Undo= + Union= + Unknown_BibTeX_entries= + unknown_edit= + Unknown_export_format= + Unmark_all= + Unmark_entries= + Unmark_entry= + untitled= + Up= + Update_to_current_column_widths= + Updated_group_selection= Upgrade_external_PDF/PS_links_to_use_the_'%0'_field.= Upgrade_file= Upgrade_old_external_file_links_to_use_the_new_feature= + usage= Use_autocompletion_for_the_following_fields= + Use_other_look_and_feel= Use_regular_expression_search= + Username= + Value_cleared_externally= + Value_set_externally= + verify_that_LyX_is_running_and_that_the_lyxpipe_is_valid= + View= Vim_server_name= + Waiting_for_ArXiv...= + Warn_about_unresolved_duplicates_when_closing_inspection_window= + Warn_before_overwriting_existing_keys= + Warning= + Warnings= + web_link= + What_do_you_want_to_do?= + When_adding/removing_keywords,_separate_them_by= Will_write_XMP-metadata_to_the_PDFs_linked_from_selected_entries.= + with= + Write_BibTeXEntry_as_XMP-metadata_to_PDF.= + Write_XMP= Write_XMP-metadata= Write_XMP-metadata_for_all_PDFs_in_current_library?= Writing_XMP-metadata...= Writing_XMP-metadata_for_selected_entries...= + Wrote_XMP-metadata= + XMP-annotated_PDF= XMP_export_privacy_settings= XMP-metadata= XMP-metadata_found_in_PDF\:_%0= You_must_restart_JabRef_for_this_to_come_into_effect.= You_have_changed_the_language_setting.= + You_have_changed_the_look_and_feel_setting.= + You_have_entered_an_invalid_search_'%0'.= + You_must_restart_JabRef_for_the_new_key_bindings_to_work_properly.= + Your_new_key_bindings_have_been_stored.= + The_following_fetchers_are_available\:= Could_not_find_fetcher_'%0'= Running_query_'%0'_with_fetcher_'%1'.= @@ -847,6 +1333,7 @@ Query_'%0'_with_fetcher_'%1'_did_not_return_any_results.= Move_file= Rename_file= + Move_file_failed= Could_not_move_file_'%0'.= Could_not_find_file_'%0'.= @@ -854,6 +1341,7 @@ Number_of_entries_successfully_imported= Import_canceled_by_user= Progress\:_%0_of_%1= Error_while_fetching_from_%0= + Please_enter_a_valid_number= Show_search_results_in_a_window= Show_global_search_results_in_a_window= @@ -866,20 +1354,26 @@ Protected_library= Refuse_to_save_the_library_before_external_changes_have_been_reviewed.= Library_protection= Unable_to_save_library= + BibTeX_key_generator= Unable_to_open_link.= Move_the_keyboard_focus_to_the_entry_table= MIME_type= + This_feature_lets_new_files_be_opened_or_imported_into_an_already_running_instance_of_JabRef
instead_of_opening_a_new_instance._For_instance,_this_is_useful_when_you_open_a_file_in_JabRef
from_your_web_browser.
Note_that_this_will_prevent_you_from_running_more_than_one_instance_of_JabRef_at_a_time.= -Run_fetcher,_e.g._"--fetch\=Medline\:cancer" +Run_fetcher,_e.g._"--fetch\=Medline\:cancer"= + The_ACM_Digital_Library= Reset= + Use_IEEE_LaTeX_abbreviations= The_Guide_to_Computing_Literature= + When_opening_file_link,_search_for_matching_file_if_no_link_is_defined= Settings_for_%0= Mark_entries_imported_into_an_existing_library= Unmark_all_entries_before_importing_new_entries_into_an_existing_library= + Forward= Back= Sort_the_following_fields_as_numeric_fields= @@ -894,19 +1388,26 @@ Set/clear/rename_fields= Rename_field_to= Move_contents_of_a_field_into_a_field_with_a_different_name= You_can_only_rename_one_field_at_a_time= + Remove_all_broken_links= + Cannot_use_port_%0_for_remote_operation;_another_application_may_be_using_it._Try_specifying_another_port.= + Looking_for_full_text_document...= Autosave= A_local_copy_will_be_opened.= Autosave_local_libraries= Automatically_save_the_library_to= Please_enter_a_valid_file_path.= + + Export_in_current_table_sort_order= Export_entries_in_their_original_order= Error_opening_file_'%0'.= + Formatter_not_found\:_%0= Clear_inputarea= + Automatically_set_file_links_for_this_entry= Could_not_save,_file_locked_by_another_JabRef_instance.= File_is_locked_by_another_JabRef_instance.= @@ -915,9 +1416,11 @@ File_locked= Current_tmp_value= Metadata_change= Changes_have_been_made_to_the_following_metadata_elements= + Generate_groups_for_author_last_names= Generate_groups_from_keywords_in_a_BibTeX_field= Enforce_legal_characters_in_BibTeX_keys= + Save_without_backup?= Unable_to_create_backup= Move_file_to_file_directory= @@ -929,28 +1432,34 @@ refines_supergroup= includes_subgroups= contains= search_expression= + Optional_fields_2= Waiting_for_save_operation_to_finish= Resolving_duplicate_BibTeX_keys...= Finished_resolving_duplicate_BibTeX_keys._%0_entries_modified.= This_library_contains_one_or_more_duplicated_BibTeX_keys.= Do_you_want_to_resolve_duplicate_keys_now?= + Find_and_remove_duplicate_BibTeX_keys= Expected_syntax_for_--fetch\='\:'= Duplicate_BibTeX_key= Import_marking_color= Always_add_letter_(a,_b,_...)_to_generated_keys= + Ensure_unique_keys_using_letters_(a,_b,_...)= Ensure_unique_keys_using_letters_(b,_c,_...)= Entry_editor_active_background_color= Entry_editor_background_color= Entry_editor_font_color= Entry_editor_invalid_field_color= + Table_and_entry_editor_colors= + General_file_directory= User-specific_file_directory= Search_failed\:_illegal_search_expression= Show_ArXiv_column= + You_must_enter_an_integer_value_in_the_interval_1025-65535_in_the_text_field_for= Automatically_open_browse_dialog_when_creating_new_file_link= Import_metadata_from\:= @@ -1042,13 +1551,16 @@ Use_the_BIB_file_location_as_primary_file_directory= Could_not_run_the_gnuclient/emacsclient_program._Make_sure_you_have_the_emacsclient/gnuclient_program_installed_and_available_in_the_PATH.= OpenOffice/LibreOffice_connection= You_must_select_either_a_valid_style_file,_or_use_one_of_the_default_styles.= + This_is_a_simple_copy_and_paste_dialog._First_load_or_paste_some_text_into_the_text_input_area.
After_that,_you_can_mark_text_and_assign_it_to_a_BibTeX_field.= This_feature_generates_a_new_library_based_on_which_entries_are_needed_in_an_existing_LaTeX_document.= You_need_to_select_one_of_your_open_libraries_from_which_to_choose_entries,_as_well_as_the_AUX_file_produced_by_LaTeX_when_compiling_your_document.= + First_select_entries_to_clean_up.= Cleanup_entry= Autogenerate_PDF_Names= Auto-generating_PDF-Names_does_not_support_undo._Continue?= + Use_full_firstname_whenever_possible= Use_abbreviated_firstname_whenever_possible= Use_abbreviated_and_full_firstname= @@ -1067,6 +1579,7 @@ Doing_a_cleanup_for_%0_entries...= No_entry_needed_a_clean_up= One_entry_needed_a_clean_up= %0_entries_needed_a_clean_up= + Remove_selected= Group_tree_could_not_be_parsed._If_you_save_the_BibTeX_library,_all_groups_will_be_lost.= @@ -1075,6 +1588,7 @@ Setting_all_preferences_to_default_values.= Resetting_preference_key_'%0'= Unknown_preference_key_'%0'= Unable_to_clear_preferences.= + Reset_preferences_(key1,key2,..._or_'all')= Find_unlinked_files= Unselect_all= @@ -1161,6 +1675,7 @@ Use_the_following_delimiter_character(s)\:= When_downloading_files,_or_moving_linked_files_to_the_file_directory,_prefer_the_BIB_file_location_rather_than_the_file_directory_set_above= Your_style_file_specifies_the_character_format_'%0',_which_is_undefined_in_your_current_OpenOffice/LibreOffice_document.= Your_style_file_specifies_the_paragraph_format_'%0',_which_is_undefined_in_your_current_OpenOffice/LibreOffice_document.= + Searching...= You_have_selected_more_than_%0_entries_for_download._Some_web_sites_might_block_you_if_you_make_too_many_rapid_downloads._Do_you_want_to_continue?= Confirm_selection= @@ -1168,7 +1683,9 @@ Add_{}_to_specified_title_words_on_search_to_keep_the_correct_case= Import_conversions= Please_enter_a_search_string= Please_open_or_start_a_new_library_before_searching= + Canceled_merging_entries= + Format_units_by_adding_non-breaking_separators_and_keeping_the_correct_case_on_search= Merge_entries= Merged_entries= @@ -1180,8 +1697,10 @@ Show_DOI_first= Show_URL_first= Use_Emacs_key_bindings= You_have_to_choose_exactly_two_entries_to_merge.= + Update_timestamp_on_modification= All_key_bindings_will_be_reset_to_their_defaults.= + Automatically_set_file_links= Resetting_all_key_bindings= Hostname= @@ -1189,25 +1708,31 @@ Invalid_setting= Network= Please_specify_both_hostname_and_port= Please_specify_both_username_and_password= + Use_custom_proxy_configuration= Proxy_requires_authentication= Attention\:_Password_is_stored_in_plain_text\!= Clear_connection_settings= Cleared_connection_settings.= + Rebind_C-a,_too= Rebind_C-f,_too= + Open_folder= Searches_for_unlinked_PDF_files_on_the_file_system= Export_entries_ordered_as_specified= Export_sort_order= Export_sorting= Newline_separator= + Save_entries_ordered_as_specified= Save_sort_order= Show_extra_columns= Parsing_error= illegal_backslash_expression= + Move_to_group= + Clear_read_status= Convert_to_biblatex_format_(for_example,_move_the_value_of_the_'journal'_field_to_'journaltitle')= Could_not_apply_changes.= @@ -1222,21 +1747,29 @@ Save_selected_as_plain_BibTeX...= Set_read_status_to_read= Set_read_status_to_skimmed= Show_deprecated_BibTeX_fields= + Show_gridlines= Show_printed_status= Show_read_status= Table_row_height_padding= + Marked_selected_entry= Marked_all_%0_selected_entries= Unmarked_selected_entry= Unmarked_all_%0_selected_entries= + + Unmarked_all_entries= + Unable_to_find_the_requested_look_and_feel_and_thus_the_default_one_is_used.= + Opens_JabRef's_GitHub_page= Could_not_open_browser.= Please_open_%0_manually.= The_link_has_been_copied_to_the_clipboard.= + Open_%0_file= + Cannot_delete_file= File_permission_error= Push_to_%0= @@ -1244,7 +1777,9 @@ Path_to_%0= Convert= Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= + Add_new_file_type= + Left_entry= Right_entry= Use= @@ -1311,9 +1846,11 @@ plain_text= This_search_contains_entries_in_which_any_field_contains_the_regular_expression_%0= This_search_contains_entries_in_which_any_field_contains_the_term_%0= This_search_contains_entries_in_which= + Unable_to_autodetect_OpenOffice/LibreOffice_installation._Please_choose_the_installation_directory_manually.= JabRef_no_longer_supports_'ps'_or_'pdf'_fields.
File_links_are_now_stored_in_the_'file'_field_and_files_are_stored_in_an_external_file_directory.
To_make_use_of_this_feature,_JabRef_needs_to_upgrade_file_links.

= This_library_uses_outdated_file_links.= + Clear_search= Close_library= Close_entry_editor= @@ -1367,8 +1904,10 @@ value= Show_preferences= Save_actions= Enable_save_actions= + Other_fields= Show_remaining_fields= + link_should_refer_to_a_correct_file_path= abbreviation_detected= wrong_entry_type_as_proceedings_has_page_numbers= @@ -1381,6 +1920,7 @@ Duplicated_Journal_File= Error_Occurred= Journal_file_%s_already_added= Name_cannot_be_empty= + Adding_fetched_entries= Display_keywords_appearing_in_ALL_entries= Display_keywords_appearing_in_ANY_entry= @@ -1390,11 +1930,15 @@ None_of_the_selected_entries_have_BibTeX_keys.= Unabbreviate_journal_names= Unabbreviating...= Usage= + + Adds_{}_brackets_around_acronyms,_month_names_and_countries_to_preserve_their_case.= Are_you_sure_you_want_to_reset_all_settings_to_default_values?= Reset_preferences= Ill-formed_entrytype_comment_in_BIB_file= + Move_linked_files_to_default_file_directory_%0= + Clipboard= Could_not_paste_entry_as_text\:= Do_you_still_want_to_continue?= @@ -1411,6 +1955,7 @@ Remove_style= Select_one_of_the_available_styles_or_add_a_style_file_from_disk.= You_must_select_a_valid_style_file.= Reload= + Capitalize= Capitalize_all_words,_but_converts_articles,_prepositions,_and_conjunctions_to_lower_case.= Capitalize_the_first_word,_changes_other_words_to_lower_case.= @@ -1465,6 +2010,7 @@ Neuter_names= Determined_%0_for_%1_entries= Look_up_%0= Looking_up_%0..._-_entry_%1_out_of_%2_-_found_%3= + Audio_CD= British_patent= British_patent_request= @@ -1498,8 +2044,10 @@ Technical_report= U.S._patent= U.S._patent_request= Verse= + change_entries_of_group= odd_number_of_unescaped_'\#'= + Plain_text= Show_diff= character= @@ -1509,23 +2057,31 @@ Copy_Version= Developers= Authors= License= + HTML_encoded_character_found= booktitle_ends_with_'conference_on'= + All_external_files= + OpenOffice/LibreOffice_integration= + incorrect_control_digit= incorrect_format= Copied_version_to_clipboard= + BibTeX_key= Message= MathSciNet_Review= Reset_Bindings= + Decryption_not_supported.= + Cleared_'%0'_for_%1_entries= Set_'%0'_to_'%1'_for_%2_entries= Toggled_'%0'_for_%1_entries= + Check_for_updates= Download_update= New_version_available= @@ -1540,8 +2096,10 @@ JabRef_is_up-to-date.= Latest_version= Online_help_forum= Custom= + Export_cited= Unable_to_generate_new_library= + Open_console= Use_default_terminal_emulator= Execute_command= diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 3efe128e969..a0705ebcac1 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -69,6 +69,8 @@ Add_to_group=Add_to_group Added_group_"%0".=Added_group_"%0". +Added_missing_braces.=Added_missing_braces. + Added_new=Added_new Added_string=Added_string diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index b1dc4265382..37c0358d294 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -69,6 +69,8 @@ Add_to_group=Añadir_a_grupo Added_group_"%0".=Grupo_"%0"_añadido +Added_missing_braces.= + Added_new=Nuevo_añadido Added_string=Cadena_añadida diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index bb8a3f753e9..0e402168342 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -69,6 +69,8 @@ Add_to_group= Added_group_"%0".= +Added_missing_braces.= + Added_new= Added_string= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 1f30fa16622..fa1068ba8bb 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -69,6 +69,8 @@ Add_to_group=Ajouter_au_groupe Added_group_"%0".=Groupe_"%0"_ajouté. +Added_missing_braces.= + Added_new=Nouvel_ajout Added_string=Chaîne_ajoutée diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index acba06ed6b7..6dfba6d2e5d 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -69,6 +69,8 @@ Add_to_group=Tambah_ke_grup Added_group_"%0".=Grup_ditambahkan_"%0". +Added_missing_braces.= + Added_new=Ditambahkan_baru Added_string=Ditambahkan_string diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 99c324e552d..b5fd2040a1c 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -69,6 +69,8 @@ Add_to_group=Aggiungi_al_gruppo Added_group_"%0".=Aggiunto_gruppo_"%0". +Added_missing_braces.= + Added_new=Aggiunto_nuovo Added_string=Aggiunta_stringa diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index 49db46de3fd..a9d1cb18702 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -69,6 +69,8 @@ Add_to_group=グループに追加 Added_group_"%0".=グループ「%0」を追加しました. +Added_missing_braces.= + Added_new=新規に追加しました Added_string=文字列を追加しました diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 09bd0c3eaad..91c74f1183f 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -69,6 +69,8 @@ Add_to_group=Voeg_toe_aan_groep Added_group_"%0".=Toegevoegde_groep_"%0". +Added_missing_braces.= + Added_new=Nieuwe_toegevoegd Added_string=Toegevoegde_constante diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index 59378dcb189..cab1e8a439a 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -69,6 +69,8 @@ Add_to_group=Legg_til_i_gruppe Added_group_"%0".=La_til_gruppe_"%0". +Added_missing_braces.= + Added_new=La_til_ny Added_string=La_til_streng diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index b7a00bb8729..9c7f25dffa1 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -69,6 +69,8 @@ Add_to_group=Adicionar_ao_grupo Added_group_"%0".=O_grupo_"%0"_foi_adicionado. +Added_missing_braces.= + Added_new=Adicionado_novo Added_string=Adicionada_string diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index 366b5eca559..b1a6b9c3a5d 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -69,6 +69,8 @@ Add_to_group=Добавить_в_группу Added_group_"%0".=Группа_"%0"_добавлена. +Added_missing_braces.= + Added_new=Добавлена_новая Added_string=Строка_добавлена diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 50e7ff7e622..b0512900e31 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -69,6 +69,8 @@ Add_to_group=Lägg_till_i_grupp Added_group_"%0".=Lade_till_gruppen_"%0". +Added_missing_braces.= + Added_new=Lade_till_ny Added_string=Lade_till_sträng diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index ba2ab69b201..4da9e9ddd94 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -69,6 +69,8 @@ Add_to_group=Gruba_ekle Added_group_"%0".="%0"_grubu_eklendi. +Added_missing_braces.= + Added_new=Yeni_eklendi Added_string=Dizgi_eklendi diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index 4de2f65b8ec..14d86a699f7 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -69,6 +69,8 @@ Add_to_group=Thêm_vào_nhóm Added_group_"%0".=Nhóm_được_thêm_"%0". +Added_missing_braces.= + Added_new=Mới_được_thêm Added_string=Chuỗi_được_thêm diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index 237ada9a5eb..fcdae0cf5b0 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -69,6 +69,8 @@ Add_to_group=添加到分组 Added_group_"%0".=已添加分组_"%0"。 +Added_missing_braces.= + Added_new=已添加 Added_string=已添加简写字串 diff --git a/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java b/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java new file mode 100644 index 00000000000..1535ece93b9 --- /dev/null +++ b/src/test/java/org/jabref/logic/integrity/BracesCorrectorTest.java @@ -0,0 +1,43 @@ +package org.jabref.logic.integrity; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class BracesCorrectorTest { + + @Test + public void inputIsNull() { + assertNull(BracesCorrector.apply(null)); + } + + @Test + public void inputIsEmpty() { + assertEquals("", BracesCorrector.apply("")); + } + + @Test + public void inputWithoutBraces() { + assertEquals("banana", BracesCorrector.apply("banana")); + } + + @Test + public void inputMissingClosing() { + assertEquals("{banana}", BracesCorrector.apply("{banana")); + } + + @Test + public void inputMissingOpening() { + assertEquals("{banana}", BracesCorrector.apply("banana}")); + } + + @Test + public void inputWithMaskedBraces() { + assertEquals("\\\\\\{banana", BracesCorrector.apply("\\\\\\{banana")); + } + + @Test + public void inputWithMixedBraces() { + assertEquals("{b{anana\\\\\\}}}", BracesCorrector.apply("{b{anana\\\\\\}")); + } +}