diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 6905dd174a1..d57f19c6853 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -4,6 +4,8 @@ "http://www.checkstyle.org/dtds/configuration_1_3.dtd"> + + @@ -21,6 +23,9 @@ + + + @@ -42,16 +47,27 @@ - - - + + + + value="IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/jabref/JabRefExecutorService.java b/src/main/java/org/jabref/JabRefExecutorService.java index 10fd1ee19cc..762d0dd66d2 100644 --- a/src/main/java/org/jabref/JabRefExecutorService.java +++ b/src/main/java/org/jabref/JabRefExecutorService.java @@ -136,7 +136,7 @@ public void submit(TimerTask timerTask, long millisecondsDelay) { public void shutdownEverything() { // those threads will be allowed to finish this.executorService.shutdown(); - //those threads will be interrupted in their current task + // those threads will be interrupted in their current task this.lowPriorityExecutorService.shutdownNow(); // kill the remote thread stopRemoteThread(); diff --git a/src/main/java/org/jabref/JabRefGUI.java b/src/main/java/org/jabref/JabRefGUI.java index 19be513cf87..cef5e7d6656 100644 --- a/src/main/java/org/jabref/JabRefGUI.java +++ b/src/main/java/org/jabref/JabRefGUI.java @@ -65,7 +65,7 @@ private void openWindow(Stage mainStage) { if (Globals.prefs.getBoolean(JabRefPreferences.WINDOW_MAXIMISED)) { mainStage.setMaximized(true); } else if (Screen.getScreens().size() == 1 && isWindowPositionOutOfBounds()) { - //corrects the Window, if its outside of the mainscreen + // corrects the Window, if its outside of the mainscreen LOGGER.debug("The Jabref Window is outside the Main Monitor\n"); mainStage.setX(0); mainStage.setY(0); @@ -94,8 +94,8 @@ private void openWindow(Stage mainStage) { mainStage.setOnCloseRequest(event -> { if (!correctedWindowPos) { - //saves the window position only if its not corrected -> the window will rest at the old Position, - //if the external Screen is connected again. + // saves the window position only if its not corrected -> the window will rest at the old Position, + // if the external Screen is connected again. saveWindowState(mainStage); } boolean reallyQuit = mainFrame.quit(); diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index 16f0ede5aea..fda5b35c0af 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -241,8 +241,8 @@ private List processArguments() { private boolean exportMatches(List loaded) { String[] data = cli.getExportMatches().split(","); - String searchTerm = data[0].replace("\\$", " "); //enables blanks within the search term: - //$ stands for a blank + String searchTerm = data[0].replace("\\$", " "); // enables blanks within the search term: + // $ stands for a blank ParserResult pr = loaded.get(loaded.size() - 1); BibDatabaseContext databaseContext = pr.getDatabaseContext(); BibDatabase dataBase = pr.getDatabase(); @@ -252,17 +252,17 @@ private boolean exportMatches(List loaded) { searchPreferences.isRegularExpression()); List matches = new DatabaseSearcher(query, dataBase).getMatches(); - //export matches + // export matches if (!matches.isEmpty()) { String formatName; - //read in the export format, take default format if no format entered + // read in the export format, take default format if no format entered switch (data.length) { case 3: formatName = data[2]; break; case 2: - //default exporter: HTML table (with Abstract & BibTeX) + // default exporter: HTML table (with Abstract & BibTeX) formatName = "tablerefsabsbib"; break; default: @@ -272,7 +272,7 @@ private boolean exportMatches(List loaded) { return false; } - //export new database + // export new database Optional exporter = Globals.exportFactory.getExporterByName(formatName); if (!exporter.isPresent()) { System.err.println(Localization.lang("Unknown export format") + ": " + formatName); diff --git a/src/main/java/org/jabref/gui/AbstractViewModel.java b/src/main/java/org/jabref/gui/AbstractViewModel.java index ff9f1fca633..d294a280d44 100644 --- a/src/main/java/org/jabref/gui/AbstractViewModel.java +++ b/src/main/java/org/jabref/gui/AbstractViewModel.java @@ -1,5 +1,5 @@ package org.jabref.gui; public class AbstractViewModel { - //empty + // empty } diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index d7d45501a8e..e7ffea9fe14 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -69,7 +69,7 @@ public EntryTypeView(BasePanel basePanel, DialogService dialogService, JabRefPre ControlHelper.setAction(generateButton, this.getDialogPane(), event -> viewModel.runFetcherWorker()); setResultConverter(button -> { - //The buttonType will always be cancel, even if we pressed one of the entry type buttons + // The buttonType will always be cancel, even if we pressed one of the entry type buttons return type; }); @@ -112,8 +112,8 @@ public void initialize() { new ViewModelListCellFactory().withText(item -> item.getName()).install(idBasedFetchers); - //we set the managed property so that they will only be rendered when they are visble so that the Nodes only take the space when visible - //avoids removing and adding from the scence graph + // we set the managed property so that they will only be rendered when they are visble so that the Nodes only take the space when visible + // avoids removing and adding from the scence graph bibTexTitlePane.managedProperty().bind(bibTexTitlePane.visibleProperty()); ieeeTranTitlePane.managedProperty().bind(ieeeTranTitlePane.visibleProperty()); biblatexTitlePane.managedProperty().bind(biblatexTitlePane.visibleProperty()); diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index ed9431c3121..077e8388d95 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -293,7 +293,7 @@ public void setWindowTitle() { // no database open if (panel == null) { - //setTitle(FRAME_TITLE); + // setTitle(FRAME_TITLE); return; } @@ -307,9 +307,9 @@ public void setWindowTitle() { .getDatabasePath() .map(Path::toString) .orElse(Localization.lang("untitled")); - //setTitle(FRAME_TITLE + " - " + databaseFile + changeFlag + modeInfo); + // setTitle(FRAME_TITLE + " - " + databaseFile + changeFlag + modeInfo); } else if (panel.getBibDatabaseContext().getLocation() == DatabaseLocation.SHARED) { - //setTitle(FRAME_TITLE + " - " + panel.getBibDatabaseContext().getDBMSSynchronizer().getDBName() + " [" + // setTitle(FRAME_TITLE + " - " + panel.getBibDatabaseContext().getDBMSSynchronizer().getDBName() + " [" // + Localization.lang("shared") + "]" + modeInfo); } } @@ -343,7 +343,7 @@ public JabRefPreferences prefs() { * set to true */ private void tearDownJabRef(List filenames) { - //prefs.putBoolean(JabRefPreferences.WINDOW_MAXIMISED, getExtendedState() == Frame.MAXIMIZED_BOTH); + // prefs.putBoolean(JabRefPreferences.WINDOW_MAXIMISED, getExtendedState() == Frame.MAXIMIZED_BOTH); if (prefs.getBoolean(JabRefPreferences.OPEN_LAST_EDITED)) { // Here we store the names of all current files. If @@ -554,10 +554,10 @@ public void init() { initDragAndDrop(); - //setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()); - //WindowLocation pw = new WindowLocation(this, JabRefPreferences.POS_X, JabRefPreferences.POS_Y, JabRefPreferences.SIZE_X, + // setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()); + // WindowLocation pw = new WindowLocation(this, JabRefPreferences.POS_X, JabRefPreferences.POS_Y, JabRefPreferences.SIZE_X, // JabRefPreferences.SIZE_Y); - //pw.displayWindowAtStoredLocation(); + // pw.displayWindowAtStoredLocation(); // Bind global state stateManager.activeDatabaseProperty().bind( @@ -595,9 +595,9 @@ public void init() { stateManager.activeSearchQueryProperty().set(newBasePanel.getCurrentSearchQuery()); // groupSidePane.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(GroupSidePane.class)); - //previewToggle.setSelected(Globals.prefs.getPreviewPreferences().isPreviewPanelEnabled()); - //generalFetcher.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(WebSearchPane.class)); - //openOfficePanel.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(OpenOfficeSidePanel.class)); + // previewToggle.setSelected(Globals.prefs.getPreviewPreferences().isPreviewPanelEnabled()); + // generalFetcher.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(WebSearchPane.class)); + // openOfficePanel.getToggleCommand().setSelected(sidePaneManager.isComponentVisible(OpenOfficeSidePanel.class)); setWindowTitle(); // Update search autocompleter with information for the correct database: @@ -743,7 +743,7 @@ private MenuBar createMenu() { ); } - //@formatter:off + // @formatter:off library.getItems().addAll( factory.createMenuItem(StandardActions.NEW_ENTRY, new NewEntryAction(this, dialogService, Globals.prefs, stateManager)), factory.createMenuItem(StandardActions.NEW_ENTRY_FROM_PLAIN_TEXT, new ExtractBibtexAction(stateManager)), @@ -883,7 +883,7 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.ABOUT, new AboutAction()) ); - //@formatter:on + // @formatter:on MenuBar menu = new MenuBar(); menu.getStyleClass().add("mainMenu"); menu.getMenus().addAll( diff --git a/src/main/java/org/jabref/gui/actions/JabRefAction.java b/src/main/java/org/jabref/gui/actions/JabRefAction.java index aba36dfe2e9..4a7aefcd4aa 100644 --- a/src/main/java/org/jabref/gui/actions/JabRefAction.java +++ b/src/main/java/org/jabref/gui/actions/JabRefAction.java @@ -58,7 +58,7 @@ private String getActionName(Action action, Command command) { return action.getText(); } else { String commandName = command.getClass().getSimpleName(); - if ( commandName.contains("EditAction") + if (commandName.contains("EditAction") || commandName.contains("CopyMoreAction") || commandName.contains("CopyCitationAction") || commandName.contains("PreviewSwitchAction") diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java index c8d781260af..ee18b7d7b26 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java @@ -149,9 +149,7 @@ public SuggestionProviderString(Callback stringConverter) { // In case no stringConverter was provided, use the default strategy if (this.stringConverter == null) { - this.stringConverter = obj -> { - return obj != null ? obj.toString() : ""; //$NON-NLS-1$ - }; + this.stringConverter = obj -> obj != null ? obj.toString() : ""; } } diff --git a/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java b/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java index 2354ef88cc5..86f22264ee9 100644 --- a/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java +++ b/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java @@ -52,7 +52,7 @@ public ExtractBibtexDialog() { @FXML private void initialize() { BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); - this.viewModel = new BibtexExtractorViewModel(database, dialogService, JabRefPreferences.getInstance(), fileUpdateMonitor, taskExecutor,undoManager,stateManager); + this.viewModel = new BibtexExtractorViewModel(database, dialogService, JabRefPreferences.getInstance(), fileUpdateMonitor, taskExecutor, undoManager, stateManager); input.textProperty().bindBidirectional(viewModel.inputTextProperty()); } } diff --git a/src/main/java/org/jabref/gui/bibtexkeypattern/BibtexKeyPatternPanel.java b/src/main/java/org/jabref/gui/bibtexkeypattern/BibtexKeyPatternPanel.java index 7a5123476bb..6637e5327f2 100644 --- a/src/main/java/org/jabref/gui/bibtexkeypattern/BibtexKeyPatternPanel.java +++ b/src/main/java/org/jabref/gui/bibtexkeypattern/BibtexKeyPatternPanel.java @@ -68,7 +68,7 @@ private void buildGUI() { Label keyPattern = new Label(Localization.lang("Key pattern")); gridPane.add(label, ++columnIndex, rowIndex); gridPane.add(keyPattern, ++columnIndex, rowIndex); - ++columnIndex; //3 + columnIndex++; } rowIndex++; diff --git a/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java b/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java index 47d2de3d873..1eba9b1c247 100644 --- a/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java +++ b/src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java @@ -79,19 +79,19 @@ public ChangeDisplayDialog(BibDatabaseContext database, List { if (button == dismissChanges) { return false; - } else { // Perform all accepted changes NamedCompound ce = new NamedCompound(Localization.lang("Merged external changes")); for (DatabaseChangeViewModel change : changes) { if (change instanceof EntryChangeViewModel) { - change.makeChange(database, ce); //We don't have a checkbox for accept and always get the correct merged entry, the accept property in this special case only controls the radio buttons selection + // We don't have a checkbox for accept and always get the correct merged entry, the accept property in this special case only controls the radio buttons selection + change.makeChange(database, ce); } else if (change.isAccepted()) { change.makeChange(database, ce); } } ce.end(); - //TODO: panel.getUndoManager().addEdit(ce); + // TODO: panel.getUndoManager().addEdit(ce); return true; } diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanel.java b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanel.java index a6f96bb25b5..b4c8db1605c 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanel.java @@ -80,13 +80,21 @@ private void initialize() { this.itemsProperty().bindBidirectional(viewModel.patternListProperty()); } - public void setValues() { viewModel.setValues(); } + public void setValues() { + viewModel.setValues(); + } - public void resetAll() { viewModel.resetAll(); } + public void resetAll() { + viewModel.resetAll(); + } - public ListProperty patternListProperty() { return viewModel.patternListProperty(); } + public ListProperty patternListProperty() { + return viewModel.patternListProperty(); + } - public ObjectProperty defaultKeyPatternProperty() { return viewModel.defaultKeyPatternProperty(); } + public ObjectProperty defaultKeyPatternProperty() { + return viewModel.defaultKeyPatternProperty(); + } private void jumpToSearchKey(KeyEvent keypressed) { if (keypressed.getCharacter() == null) { diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelItemModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelItemModel.java index f65180bd6a1..5e6777ef62f 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelItemModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelItemModel.java @@ -20,9 +20,13 @@ public BibtexKeyPatternPanelItemModel(EntryType entryType, String pattern) { this.pattern.setValue(pattern); } - public EntryType getEntryType() { return entryType.getValue(); } + public EntryType getEntryType() { + return entryType.getValue(); + } - public ObjectProperty entryType() { return entryType; } + public ObjectProperty entryType() { + return entryType; + } public void setPattern(String pattern) { this.pattern.setValue(pattern); @@ -32,8 +36,12 @@ public String getPattern() { return pattern.getValue(); } - public StringProperty pattern() { return pattern; } + public StringProperty pattern() { + return pattern; + } @Override - public String toString() { return "[" + entryType.getValue().getName() + "," + pattern.getValue() + "]"; } + public String toString() { + return "[" + entryType.getValue().getName() + "," + pattern.getValue() + "]"; + } } diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelViewModel.java index ccd765635bf..6e271e18f90 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/BibtexKeyPatternPanelViewModel.java @@ -25,7 +25,7 @@ public class BibtexKeyPatternPanelViewModel { if (itemOneName.equals(itemTwoName)) { return 0; - } else if (itemOneName.equals(ENTRY_TYPE_DEFAULT_NAME)) { + } else if (itemOneName.equals(ENTRY_TYPE_DEFAULT_NAME)) { return -1; } else if (itemTwoName.equals(ENTRY_TYPE_DEFAULT_NAME)) { return 1; @@ -80,15 +80,23 @@ public void resetAll() { defaultItemProperty.getValue().setPattern((String) preferences.defaults.get(JabRefPreferences.DEFAULT_BIBTEX_KEY_PATTERN)); } - public ListProperty patternListProperty() { return patternListProperty; } + public ListProperty patternListProperty() { + return patternListProperty; + } - public ObjectProperty defaultKeyPatternProperty() { return defaultItemProperty; } + public ObjectProperty defaultKeyPatternProperty() { + return defaultItemProperty; + } public static class DefaultEntryType implements EntryType { @Override - public String getName() { return ENTRY_TYPE_DEFAULT_NAME; } + public String getName() { + return ENTRY_TYPE_DEFAULT_NAME; + } @Override - public String getDisplayName() { return Localization.lang("Default pattern"); } + public String getDisplayName() { + return Localization.lang("Default pattern"); + } } } diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultListDependency.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultListDependency.java index 10f09fb27f1..5a1f1487afc 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultListDependency.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultListDependency.java @@ -12,7 +12,7 @@ public class CopyFilesResultListDependency { private List results = new ArrayList<>(); public CopyFilesResultListDependency() { - //empty, workaround for injection into FXML controller + // empty, workaround for injection into FXML controller } public CopyFilesResultListDependency(List results) { diff --git a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java index aa00a394524..60671662148 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java @@ -48,12 +48,10 @@ private void copyFileToDestination(Path exportPath) { boolean success = FileUtil.copyFile(fileToExport.get(), newFile, false); if (success) { dialogService.showInformationDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Sucessfully copied file to %0", newPath.map(Path::getParent).map(Path::toString).orElse(""))); - } - else { + } else { dialogService.showErrorDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Could not copy file to %0, maybe the file is already existing?", newPath.map(Path::getParent).map(Path::toString).orElse(""))); } - } - else { + } else { dialogService.showErrorDialogAndWait(Localization.lang("Could not resolve the file %0", fileToExport.map(Path::getParent).map(Path::toString).orElse(""))); } diff --git a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java index fbe2a206c91..ccb53b5b13c 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java +++ b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java @@ -208,7 +208,7 @@ public void apply() { entryTypesManager.removeCustomOrModifiedEntryType(type, mode); } preferencesService.saveCustomEntryTypes(); - //Reload types from preferences to make sure any modifications are present when reopening the dialog + // Reload types from preferences to make sure any modifications are present when reopening the dialog entryTypesManager.addCustomOrModifiedTypes(preferencesService.loadBibEntryTypes(BibDatabaseMode.BIBTEX), preferencesService.loadBibEntryTypes(BibDatabaseMode.BIBLATEX)); } diff --git a/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java b/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java index f978102f4b1..8c63148b849 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java +++ b/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java @@ -86,7 +86,8 @@ private void initialize() { private void setupTable() { - fields.setEditable(true); //Table View must be editable, otherwise the change of the Radiobuttons does not propagate the commit event + // Table View must be editable, otherwise the change of the Radiobuttons does not propagate the commit event + fields.setEditable(true); entryTypColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getType().getDisplayName())); entryTypes.itemsProperty().bind(viewModel.entryTypes()); entryTypes.getSelectionModel().selectFirst(); diff --git a/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java b/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java index 47229fa6248..521b9ac1d76 100644 --- a/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java +++ b/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialogViewModel.java @@ -77,8 +77,8 @@ public void saveFields() { public void resetFields() { StringBuilder sb = new StringBuilder(); - Map customTabNamesFields = preferences.getCustomTabsNamesAndFields(); - for (Map.Entryentry : customTabNamesFields.entrySet()) { + Map customTabNamesFields = preferences.getCustomTabsNamesAndFields(); + for (Map.Entry entry : customTabNamesFields.entrySet()) { sb.append(entry.getKey()); sb.append(':'); sb.append(entry.getValue()); diff --git a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java index 78a679cc39e..59c0dc0611d 100644 --- a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java @@ -154,8 +154,8 @@ private static void openExternalFilePlatformIndependent(Optional generateImage = BackgroundTask .wrap(() -> renderPage(initialPage)) .onSuccess(image -> { diff --git a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java index 61ac47eb2ef..fb5299a3859 100644 --- a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java +++ b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java @@ -38,7 +38,6 @@ public class DocumentViewerViewModel extends AbstractViewModel { private final ObjectProperty currentPage = new SimpleObjectProperty<>(); private final IntegerProperty maxPages = new SimpleIntegerProperty(); - public DocumentViewerViewModel(StateManager stateManager) { this.stateManager = Objects.requireNonNull(stateManager); diff --git a/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java b/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java index c071e652033..2c4e3e01e6a 100644 --- a/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java +++ b/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java @@ -110,7 +110,7 @@ public void saveChanges() { } NamedCompound ce = updateKeywords(entries, keywordsToAdd, keywordsToRemove); - //TODO: bp.getUndoManager().addEdit(ce); + // TODO: bp.getUndoManager().addEdit(ce); } private NamedCompound updateKeywords(List entries, KeywordList keywordsToAdd, diff --git a/src/main/java/org/jabref/gui/edit/ReplaceStringView.java b/src/main/java/org/jabref/gui/edit/ReplaceStringView.java index e03b70b0167..f5fdbe64d41 100644 --- a/src/main/java/org/jabref/gui/edit/ReplaceStringView.java +++ b/src/main/java/org/jabref/gui/edit/ReplaceStringView.java @@ -29,7 +29,7 @@ public class ReplaceStringView extends BaseDialog private final ControlsFxVisualizer visualizer = new ControlsFxVisualizer(); - public ReplaceStringView(BasePanel basePanel) { + public ReplaceStringView(BasePanel basePanel) { this.setTitle(Localization.lang("Replace String")); viewModel = new ReplaceStringViewModel(basePanel); diff --git a/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java b/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java index eb32948f8bd..a7a534c9603 100644 --- a/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java +++ b/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java @@ -30,7 +30,6 @@ public class ReplaceStringViewModel extends AbstractViewModel { private BooleanProperty allFieldReplaceProperty = new SimpleBooleanProperty(); private BooleanProperty selectOnlyProperty = new SimpleBooleanProperty(); - public ReplaceStringViewModel(BasePanel basePanel) { Objects.requireNonNull(basePanel); this.panel = basePanel; diff --git a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java index 1e20b41c7b1..fca612d3f4a 100644 --- a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java @@ -170,7 +170,7 @@ private ScrollPane getPrivacyDialog(BibEntry entry) { Button button = new Button(Localization.lang("I Agree")); button.setDefaultButton(true); - DoubleBinding rootWidth = Bindings.subtract(root.widthProperty(),88d); + DoubleBinding rootWidth = Bindings.subtract(root.widthProperty(), 88d); Text line1 = new Text(Localization.lang("JabRef requests recommendations from Mr. DLib, which is an external service. To enable Mr. DLib to calculate recommendations, some of your data must be shared with Mr. DLib. Generally, the more data is shared the better recommendations can be calculated. However, we understand that some of your data in JabRef is sensitive, and you may not want to share it. Therefore, Mr. DLib offers a choice of which data you would like to share.")); line1.wrappingWidthProperty().bind(rootWidth); diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java index 4fd067f02ae..df1ab4ffbb8 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java @@ -46,7 +46,7 @@ public CreateModifyExporterDialogViewModel(ExporterViewModel exporter, DialogSer this.preferences = preferences; this.loader = loader; - //Set text of each of the boxes + // Set text of each of the boxes if (exporter != null) { name.setValue(exporter.name().get()); layoutFile.setValue(exporter.layoutFileName().get()); diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index 77b3a8430de..fd355b5a6b1 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -56,7 +56,7 @@ public void execute() { SavePreferences savePreferences = preferences.loadForExportFromPreferences(); XmpPreferences xmpPreferences = preferences.getXMPPreferences(); - //Get list of exporters and sort before adding to file dialog + // Get list of exporters and sort before adding to file dialog List exporters = Globals.exportFactory.getExporters().stream() .sorted(Comparator.comparing(Exporter::getName)) .collect(Collectors.toList()); diff --git a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java index 606706a89da..3505738d7d6 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java +++ b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java @@ -67,7 +67,7 @@ public void execute() { .filter(exporter -> SUPPORTED_FILETYPES.containsAll(exporter.getFileType().getExtensions())) .collect(Collectors.toList()); - //Find default choice, if any + // Find default choice, if any Exporter defaultChoice = exporters.stream() .filter(exporter -> exporter.getName().equals(Globals.prefs.get(JabRefPreferences.LAST_USED_EXPORT))) .findAny() @@ -88,7 +88,7 @@ private ExportResult exportToClipboard(Exporter exporter) throws Exception { // (This is an ugly hack!) Globals.prefs.fileDirForDatabase = panel.getBibDatabaseContext().getFileDirectoriesAsPaths(Globals.prefs.getFilePreferences()).stream().map(Path::toString).collect(Collectors.toList()); - //Add chosen export type to last used pref, to become default + // Add chosen export type to last used pref, to become default Globals.prefs.put(JabRefPreferences.LAST_USED_EXPORT, exporter.getName()); Path tmp = null; diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java index 2739d923945..8400239f2da 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java @@ -72,7 +72,7 @@ public void importAsNewEntries(List files) { // First try xmp import, if empty try pdf import, otherwise create empty entry if (!xmpEntriesInFile.isEmpty()) { if (!pdfResult.isEmpty()) { - //FIXME: Show merge dialog? + // FIXME: Show merge dialog? entriesToAdd = xmpEntriesInFile; } else { entriesToAdd = xmpEntriesInFile; @@ -105,8 +105,8 @@ private BibEntry createEmptyEntryWithLink(Path file) { } public void importEntries(List entries) { - //TODO: Add undo/redo - //undoManager.addEdit(new UndoableInsertEntries(panel.getDatabase(), entries)); + // TODO: Add undo/redo + // undoManager.addEdit(new UndoableInsertEntries(panel.getDatabase(), entries)); database.getDatabase().insertEntries(entries); @@ -128,10 +128,10 @@ private void addToGroups(List entries, Collection group GroupEntryChanger entryChanger = (GroupEntryChanger) node.getGroup(); List undo = entryChanger.add(entries); // TODO: Add undo - //if (!undo.isEmpty()) { + // if (!undo.isEmpty()) { // ce.addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(new GroupTreeNodeViewModel(node), // undo)); - //} + // } } } } diff --git a/src/main/java/org/jabref/gui/externalfiletype/EditExternalFileTypeViewModel.java b/src/main/java/org/jabref/gui/externalfiletype/EditExternalFileTypeViewModel.java index dc573aa2c36..220032732c4 100644 --- a/src/main/java/org/jabref/gui/externalfiletype/EditExternalFileTypeViewModel.java +++ b/src/main/java/org/jabref/gui/externalfiletype/EditExternalFileTypeViewModel.java @@ -27,8 +27,7 @@ public EditExternalFileTypeViewModel(CustomExternalFileType fileType) { if (fileType.getOpenWithApplication().isEmpty()) { defaultApplicationSelectedProperty.setValue(true); - } - else { + } else { customApplicationSelectedProperty.setValue(true); } diff --git a/src/main/java/org/jabref/gui/externalfiletype/ExternalFileMenuItem.java b/src/main/java/org/jabref/gui/externalfiletype/ExternalFileMenuItem.java deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java b/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java index 7e7d2836f1b..1c24f739ffd 100644 --- a/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java +++ b/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java @@ -17,7 +17,7 @@ import org.jabref.model.util.FileHelper; import org.jabref.preferences.JabRefPreferences; -//Do not make this class final, as it otherwise can't be mocked for tests +// Do not make this class final, as it otherwise can't be mocked for tests public class ExternalFileTypes { // This String is used in the encoded list in prefs of external file type diff --git a/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java index af942d99c5e..4f3f20e94f6 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java @@ -28,7 +28,7 @@ public void toggleAbbreviation() { if (nextAbbreviation.isPresent()) { text.set(nextAbbreviation.get()); // TODO: Add undo - //panel.getUndoManager().addEdit(new UndoableFieldChange(entry, editor.getName(), text, nextAbbreviation)); + // panel.getUndoManager().addEdit(new UndoableFieldChange(entry, editor.getName(), text, nextAbbreviation)); } } } diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditorViewModel.java index 81453aa5ff0..19af58758fe 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditorViewModel.java @@ -39,7 +39,7 @@ public LinkedEntriesEditorViewModel(Field field, AutoCompleteSuggestionProvider< @Override @SuppressWarnings("unchecked") public Collection complete(AutoCompletionBinding.ISuggestionRequest request) { - //We have to cast the BibEntries from the BibEntrySuggestionProvider to ParsedEntryLink + // We have to cast the BibEntries from the BibEntrySuggestionProvider to ParsedEntryLink Collection bibEntries = (Collection) super.complete(request); return bibEntries.stream().map(ParsedEntryLink::new).collect(Collectors.toList()); } @@ -72,9 +72,9 @@ public void jumpToEntry(ParsedEntryLink parsedEntryLink) { // This feature was removed while converting the linked entries editor to JavaFX // Right now there is no nice way to re-implement it as we have no good interface to control the focus of the main table // (except directly using the JabRefFrame class as below) - //parsedEntryLink.getLinkedEntry().ifPresent( + // parsedEntryLink.getLinkedEntry().ifPresent( // e -> frame.getCurrentBasePanel().highlightEntry(e) - //); + // ); } } diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index 263c8c8ad0c..537a17fff08 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -92,7 +92,7 @@ private void handleOnDragDetected(@SuppressWarnings("unused") LinkedFileViewMode if (selectedItem != null) { ClipboardContent content = new ClipboardContent(); Dragboard dragboard = listView.startDragAndDrop(TransferMode.MOVE); - //We have to use the model class here, as the content of the dragboard must be serializable + // We have to use the model class here, as the content of the dragboard must be serializable content.put(DragAndDropDataFormats.LINKED_FILE, selectedItem); dragboard.setContent(content); } diff --git a/src/main/java/org/jabref/gui/fieldeditors/MapBasedEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/MapBasedEditorViewModel.java index 24df92ecc61..9fce68893e1 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/MapBasedEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/MapBasedEditorViewModel.java @@ -35,7 +35,7 @@ public String toString(T object) { if (object == null) { return null; } else { - return getItemMap().inverse().getOrDefault(object, object.toString()); //if the object is not found we simply return itself as string + return getItemMap().inverse().getOrDefault(object, object.toString()); // if the object is not found we simply return itself as string } } diff --git a/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java b/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java index bfa7eb0ee97..1d2f80b11ff 100644 --- a/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/filelist/LinkedFilesEditDialogViewModel.java @@ -93,7 +93,7 @@ public void setValues(LinkedFile linkedFile) { description.set(linkedFile.getDescription()); if (linkedFile.isOnlineLink()) { - link.setValue(linkedFile.getLink()); //Might be an URL + link.setValue(linkedFile.getLink()); // Might be an URL } else { link.setValue(relativize(Paths.get(linkedFile.getLink()))); } diff --git a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java index 4f40d4bb670..8fe28d2bf8b 100644 --- a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java @@ -108,10 +108,10 @@ private GroupNodeViewModel toViewModel(GroupTreeNode child) { public List addEntriesToGroup(List entries) { // TODO: warn if assignment has undesired side effects (modifies a field != keywords) - //if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(group, groupSelector.frame)) - //{ + // if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(group, groupSelector.frame)) + // { // return; // user aborted operation - //} + // } var changes = groupNode.addEntriesToGroup(entries); @@ -298,13 +298,13 @@ public boolean acceptableDrop(Dragboard dragboard) { public void moveTo(GroupNodeViewModel target) { // TODO: Add undo and display message - //MoveGroupChange undo = new MoveGroupChange(((GroupTreeNodeViewModel)source.getParent()).getNode(), + // MoveGroupChange undo = new MoveGroupChange(((GroupTreeNodeViewModel)source.getParent()).getNode(), // source.getNode().getPositionInParent(), target.getNode(), target.getChildCount()); getGroupNode().moveTo(target.getGroupNode()); - //panel.getUndoManager().addEdit(new UndoableMoveGroup(this.groupsRoot, moveChange)); - //panel.markBaseChanged(); - //frame.output(Localization.lang("Moved group \"%0\".", node.getNode().getGroup().getName())); + // panel.getUndoManager().addEdit(new UndoableMoveGroup(this.groupsRoot, moveChange)); + // panel.markBaseChanged(); + // frame.output(Localization.lang("Moved group \"%0\".", node.getNode().getGroup().getName())); } public void moveTo(GroupTreeNode target, int targetIndex) { diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 0e96156f96d..0e9809dce2b 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -220,7 +220,7 @@ public void initialize() { if ((event.getGestureSource() != row) && (row.getItem() != null) && row.getItem().acceptableDrop(dragboard)) { event.acceptTransferModes(TransferMode.MOVE, TransferMode.LINK); - //expand node and all children on drag over + // expand node and all children on drag over dragExpansionHandler.expandGroup(row.getTreeItem()); if (localDragboard.hasBibEntries()) { @@ -358,20 +358,20 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { menu.getItems().add(sortAlphabetically); // TODO: Disable some actions under certain conditions - //if (group.canBeEdited()) { - //editGroupPopupAction.setEnabled(false); - //addGroupPopupAction.setEnabled(false); - //removeGroupAndSubgroupsPopupAction.setEnabled(false); - //removeGroupKeepSubgroupsPopupAction.setEnabled(false); - //} else { - //editGroupPopupAction.setEnabled(true); - //addGroupPopupAction.setEnabled(true); - //addGroupPopupAction.setNode(node); - //removeGroupAndSubgroupsPopupAction.setEnabled(true); - //removeGroupKeepSubgroupsPopupAction.setEnabled(true); - //} - //sortSubmenu.setEnabled(!node.isLeaf()); - //removeSubgroupsPopupAction.setEnabled(!node.isLeaf()); + // if (group.canBeEdited()) { + // editGroupPopupAction.setEnabled(false); + // addGroupPopupAction.setEnabled(false); + // removeGroupAndSubgroupsPopupAction.setEnabled(false); + // removeGroupKeepSubgroupsPopupAction.setEnabled(false); + // } else { + // editGroupPopupAction.setEnabled(true); + // addGroupPopupAction.setEnabled(true); + // addGroupPopupAction.setNode(node); + // removeGroupAndSubgroupsPopupAction.setEnabled(true); + // removeGroupKeepSubgroupsPopupAction.setEnabled(true); + // } + // sortSubmenu.setEnabled(!node.isLeaf()); + // removeSubgroupsPopupAction.setEnabled(!node.isLeaf()); return menu; } diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index d0b77597aad..6f8a189bced 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -156,11 +156,11 @@ public void addNewSubgroup(GroupNodeViewModel parent) { parent.addSubgroup(group); // TODO: Add undo - //UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(parent, new GroupTreeNodeViewModel(newGroupNode), UndoableAddOrRemoveGroup.ADD_NODE); - //panel.getUndoManager().addEdit(undo); + // UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(parent, new GroupTreeNodeViewModel(newGroupNode), UndoableAddOrRemoveGroup.ADD_NODE); + // panel.getUndoManager().addEdit(undo); // TODO: Expand parent to make new group visible - //parent.expand(); + // parent.expand(); dialogService.notify(Localization.lang("Added group \"%0\".", group.getName())); writeGroupChangesToMetaData(); @@ -205,16 +205,16 @@ public void editGroup(GroupNodeViewModel oldGroup) { // UndoableModifyGroup undo = new UndoableModifyGroup(GroupSelector.this, groupsRoot, node, newGroup); // if (undoAddPreviousEntries == null) { // panel.getUndoManager().addEdit(undo); - //} else { + // } else { // NamedCompound nc = new NamedCompound("Modify Group"); // nc.addEdit(undo); // nc.addEdit(undoAddPreviousEntries); // nc.end();/ // panel.getUndoManager().addEdit(nc); - //} - //if (!addChange.isEmpty()) { + // } + // if (!addChange.isEmpty()) { // undoAddPreviousEntries = UndoableChangeEntriesOfGroup.getUndoableEdit(null, addChange); - //} + // } dialogService.notify(Localization.lang("Modified group \"%0\".", group.getName())); writeGroupChangesToMetaData(); @@ -231,8 +231,8 @@ public void removeSubgroups(GroupNodeViewModel group) { Localization.lang("Remove all subgroups of \"%0\"?", group.getDisplayName())); if (confirmation) { /// TODO: Add undo - //final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); - //panel.getUndoManager().addEdit(undo); + // final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); + // panel.getUndoManager().addEdit(undo); group.getGroupNode().removeAllChildren(); dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName())); writeGroupChangesToMetaData(); @@ -246,8 +246,8 @@ public void removeGroupKeepSubgroups(GroupNodeViewModel group) { if (confirmation) { // TODO: Add undo - //final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); - //panel.getUndoManager().addEdit(undo); + // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); + // panel.getUndoManager().addEdit(undo); GroupTreeNode groupNode = group.getGroupNode(); groupNode.getParent() .ifPresent(parent -> groupNode.moveAllChildrenTo(parent, parent.getIndexOfChild(groupNode).get())); @@ -268,8 +268,8 @@ public void removeGroupAndSubgroups(GroupNodeViewModel group) { Localization.lang("Remove")); if (confirmed) { // TODO: Add undo - //final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); - //panel.getUndoManager().addEdit(undo); + // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); + // panel.getUndoManager().addEdit(undo); removeGroupsAndSubGroupsFromEntries(group); @@ -305,11 +305,11 @@ public void addSelectedEntries(GroupNodeViewModel group) { // panel.getUndoManager().addEdit(undoAll); // TODO Display massages - //if (undo == null) { + // if (undo == null) { // frame.output(Localization.lang("The group \"%0\" already contains the selection.", // node.getGroup().getName())); // return; - //} + // } // panel.getUndoManager().addEdit(undo); // final String groupName = node.getGroup().getName(); // if (assignedEntries == 1) { @@ -317,7 +317,7 @@ public void addSelectedEntries(GroupNodeViewModel group) { // } else { // frame.output(Localization.lang("Assigned %0 entries to group \"%1\".", String.valueOf(assignedEntries), // groupName)); - //} + // } } public void removeSelectedEntries(GroupNodeViewModel group) { diff --git a/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java b/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java index 1f04933adde..c1f2ad3897e 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java +++ b/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java @@ -42,7 +42,7 @@ public void undo() { // remember modified children for redo m_modifiedSubtree.clear(); // get node to edit - final GroupTreeNode subtreeRoot = m_groupRoot.getDescendant(m_subtreeRootPath).get(); //TODO: NULL + final GroupTreeNode subtreeRoot = m_groupRoot.getDescendant(m_subtreeRootPath).get(); // TODO: NULL m_modifiedSubtree.addAll(subtreeRoot.getChildren()); // keep subtree handle, but restore everything else from backup subtreeRoot.removeAllChildren(); @@ -54,7 +54,7 @@ public void undo() { @Override public void redo() { super.redo(); - final GroupTreeNode subtreeRoot = m_groupRoot.getDescendant(m_subtreeRootPath).get(); //TODO: NULL + final GroupTreeNode subtreeRoot = m_groupRoot.getDescendant(m_subtreeRootPath).get(); // TODO: NULL subtreeRoot.removeAllChildren(); for (GroupTreeNode modifiedNode : m_modifiedSubtree) { modifiedNode.moveTo(subtreeRoot); diff --git a/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java b/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java index 93cb4bba6f8..2a0996bec5a 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java +++ b/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java @@ -19,7 +19,6 @@ class UndoableMoveGroup extends AbstractUndoableJabRefEdit { private final List pathToOldParent; private final int oldChildIndex; - public UndoableMoveGroup(GroupTreeNodeViewModel root, MoveGroupChange moveChange) { this.root = Objects.requireNonNull(root); Objects.requireNonNull(moveChange); @@ -38,9 +37,9 @@ public String getPresentationName() { public void undo() { super.undo(); - GroupTreeNode newParent = root.getNode().getDescendant(pathToNewParent).get(); //TODO: NULL - GroupTreeNode node = newParent.getChildAt(newChildIndex).get(); //TODO: Null - //TODO: NULL + GroupTreeNode newParent = root.getNode().getDescendant(pathToNewParent).get(); // TODO: NULL + GroupTreeNode node = newParent.getChildAt(newChildIndex).get(); // TODO: Null + // TODO: NULL node.moveTo(root.getNode().getDescendant(pathToOldParent).get(), oldChildIndex); } @@ -48,9 +47,9 @@ public void undo() { public void redo() { super.redo(); - GroupTreeNode oldParent = root.getNode().getDescendant(pathToOldParent).get(); //TODO: NULL - GroupTreeNode node = oldParent.getChildAt(oldChildIndex).get(); //TODO:Null - //TODO: NULL + GroupTreeNode oldParent = root.getNode().getDescendant(pathToOldParent).get(); // TODO: NULL + GroupTreeNode node = oldParent.getChildAt(oldChildIndex).get(); // TODO:Null + // TODO: NULL node.moveTo(root.getNode().getDescendant(pathToNewParent).get(), newChildIndex); } } diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 3e7efb6cd8a..f7143eb7155 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -192,49 +192,49 @@ public enum JabRefIcons implements JabRefIcon { RANK3(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR_OUTLINE, MaterialDesignIcon.STAR_OUTLINE), RANK4(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR_OUTLINE), RANK5(MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR, MaterialDesignIcon.STAR), - WWW(MaterialDesignIcon.WEB) /*css: web*/, - GROUP_INCLUDING(MaterialDesignIcon.FILTER_OUTLINE) /*css: filter-outline*/, - GROUP_REFINING(MaterialDesignIcon.FILTER) /*css: filter*/, - AUTO_GROUP(MaterialDesignIcon.AUTO_FIX), /*css: auto-fix*/ + WWW(MaterialDesignIcon.WEB), + GROUP_INCLUDING(MaterialDesignIcon.FILTER_OUTLINE), + GROUP_REFINING(MaterialDesignIcon.FILTER), + AUTO_GROUP(MaterialDesignIcon.AUTO_FIX), GROUP_INTERSECTION(JabRefMaterialDesignIcon.SET_CENTER), GROUP_UNION(JabRefMaterialDesignIcon.SET_ALL), - EMAIL(MaterialDesignIcon.EMAIL) /*css: email*/, - EXPORT_TO_CLIPBOARD(MaterialDesignIcon.CLIPBOARD_ARROW_LEFT) /*css: clipboard-arrow-left */, - ATTACH_FILE(MaterialDesignIcon.PAPERCLIP) /*css: paperclip*/, - AUTO_FILE_LINK(MaterialDesignIcon.FILE_FIND) /*css: file-find */, - AUTO_LINKED_FILE(MaterialDesignIcon.BRIEFCASE_CHECK) /*css: briefcase-check */, - QUALITY_ASSURED(MaterialDesignIcon.CERTIFICATE), /*css: certificate */ - QUALITY(MaterialDesignIcon.CERTIFICATE), /*css: certificate */ - OPEN(MaterialDesignIcon.FOLDER_OUTLINE) /*css: folder */, - ADD_ROW(MaterialDesignIcon.SERVER_PLUS) /* css: server-plus*/, - REMOVE_ROW(MaterialDesignIcon.SERVER_MINUS) /*css: server-minus */, - PICTURE(MaterialDesignIcon.FILE_IMAGE) /*css: file-image */, - READ_STATUS_READ(Color.rgb(111, 204, 117, 1), MaterialDesignIcon.EYE), /*css: eye */ - READ_STATUS_SKIMMED(Color.ORANGE, MaterialDesignIcon.EYE), /*css: eye */ - READ_STATUS(MaterialDesignIcon.EYE), /*css: eye */ - RELEVANCE(MaterialDesignIcon.STAR_CIRCLE), /*css: star-circle */ - MERGE_ENTRIES(MaterialDesignIcon.COMPARE), /* css: compare */ - CONNECT_OPEN_OFFICE(MaterialDesignIcon.OPEN_IN_APP) /*css: open-in-app */, - PLAIN_TEXT_IMPORT_TODO(MaterialDesignIcon.CHECKBOX_BLANK_CIRCLE_OUTLINE) /* css: checkbox-blank-circle-outline*/, - PLAIN_TEXT_IMPORT_DONE(MaterialDesignIcon.CHECKBOX_MARKED_CIRCLE_OUTLINE) /* checkbox-marked-circle-outline */, - DONATE(MaterialDesignIcon.GIFT), /* css: gift */ - MOVE_TAB_ARROW(MaterialDesignIcon.ARROW_UP_BOLD), /*css: arrow-up-bold */ - OPTIONAL(MaterialDesignIcon.LABEL_OUTLINE), /*css: label-outline */ - REQUIRED(MaterialDesignIcon.LABEL), /*css: label */ - INTEGRITY_FAIL(Color.RED, MaterialDesignIcon.CLOSE_CIRCLE), /*css: close-circle */ - INTEGRITY_INFO(MaterialDesignIcon.INFORMATION), /*css: information */ - INTEGRITY_WARN(MaterialDesignIcon.ALERT_CIRCLE), /*css alert-circle */ - INTEGRITY_SUCCESS(MaterialDesignIcon.CHECKBOX_MARKED_CIRCLE_OUTLINE) /*css: checkbox-marked-circle-outline */, - GITHUB(MaterialDesignIcon.GITHUB_CIRCLE), /*css: github-circle*/ - TOGGLE_ENTRY_PREVIEW(MaterialDesignIcon.LIBRARY_BOOKS), /*css: library-books */ - TOGGLE_GROUPS(MaterialDesignIcon.VIEW_LIST), /*css: view-list */ - SHOW_PREFERENCES_LIST(MaterialDesignIcon.VIEW_LIST), /*css: view-list */ - WRITE_XMP(MaterialDesignIcon.IMPORT), /* css: import */ - FILE_WORD(MaterialDesignIcon.FILE_WORD), /*css: file-word */ - FILE_EXCEL(MaterialDesignIcon.FILE_EXCEL), /*css: file-excel */ - FILE_POWERPOINT(MaterialDesignIcon.FILE_POWERPOINT), /*css: file-powerpoint */ - FILE_TEXT(MaterialDesignIcon.FILE_DOCUMENT), /*css: file-document */ - FILE_MULTIPLE(MaterialDesignIcon.FILE_MULTIPLE), /*css: file-multiple */ + EMAIL(MaterialDesignIcon.EMAIL), + EXPORT_TO_CLIPBOARD(MaterialDesignIcon.CLIPBOARD_ARROW_LEFT), + ATTACH_FILE(MaterialDesignIcon.PAPERCLIP), + AUTO_FILE_LINK(MaterialDesignIcon.FILE_FIND), + AUTO_LINKED_FILE(MaterialDesignIcon.BRIEFCASE_CHECK), + QUALITY_ASSURED(MaterialDesignIcon.CERTIFICATE), + QUALITY(MaterialDesignIcon.CERTIFICATE), + OPEN(MaterialDesignIcon.FOLDER_OUTLINE), + ADD_ROW(MaterialDesignIcon.SERVER_PLUS), + REMOVE_ROW(MaterialDesignIcon.SERVER_MINUS), + PICTURE(MaterialDesignIcon.FILE_IMAGE), + READ_STATUS_READ(Color.rgb(111, 204, 117, 1), MaterialDesignIcon.EYE), + READ_STATUS_SKIMMED(Color.ORANGE, MaterialDesignIcon.EYE), + READ_STATUS(MaterialDesignIcon.EYE), + RELEVANCE(MaterialDesignIcon.STAR_CIRCLE), + MERGE_ENTRIES(MaterialDesignIcon.COMPARE), + CONNECT_OPEN_OFFICE(MaterialDesignIcon.OPEN_IN_APP), + PLAIN_TEXT_IMPORT_TODO(MaterialDesignIcon.CHECKBOX_BLANK_CIRCLE_OUTLINE), + PLAIN_TEXT_IMPORT_DONE(MaterialDesignIcon.CHECKBOX_MARKED_CIRCLE_OUTLINE), + DONATE(MaterialDesignIcon.GIFT), + MOVE_TAB_ARROW(MaterialDesignIcon.ARROW_UP_BOLD), + OPTIONAL(MaterialDesignIcon.LABEL_OUTLINE), + REQUIRED(MaterialDesignIcon.LABEL), + INTEGRITY_FAIL(Color.RED, MaterialDesignIcon.CLOSE_CIRCLE), + INTEGRITY_INFO(MaterialDesignIcon.INFORMATION), + INTEGRITY_WARN(MaterialDesignIcon.ALERT_CIRCLE), + INTEGRITY_SUCCESS(MaterialDesignIcon.CHECKBOX_MARKED_CIRCLE_OUTLINE), + GITHUB(MaterialDesignIcon.GITHUB_CIRCLE), + TOGGLE_ENTRY_PREVIEW(MaterialDesignIcon.LIBRARY_BOOKS), + TOGGLE_GROUPS(MaterialDesignIcon.VIEW_LIST), + SHOW_PREFERENCES_LIST(MaterialDesignIcon.VIEW_LIST), + WRITE_XMP(MaterialDesignIcon.IMPORT), + FILE_WORD(MaterialDesignIcon.FILE_WORD), + FILE_EXCEL(MaterialDesignIcon.FILE_EXCEL), + FILE_POWERPOINT(MaterialDesignIcon.FILE_POWERPOINT), + FILE_TEXT(MaterialDesignIcon.FILE_DOCUMENT), + FILE_MULTIPLE(MaterialDesignIcon.FILE_MULTIPLE), FILE_OPENOFFICE(JabRefMaterialDesignIcon.OPEN_OFFICE), APPLICATION_EMACS(JabRefMaterialDesignIcon.EMACS), APPLICATION_LYX(JabRefMaterialDesignIcon.LYX), @@ -242,21 +242,21 @@ public enum JabRefIcons implements JabRefIcon { APPLICATION_TEXMAKER(JabRefMaterialDesignIcon.TEX_MAKER), APPLICATION_VIM(JabRefMaterialDesignIcon.VIM), APPLICATION_WINEDT(JabRefMaterialDesignIcon.WINEDT), - KEY_BINDINGS(MaterialDesignIcon.KEYBOARD), /*css: keyboard */ - FIND_DUPLICATES(MaterialDesignIcon.CODE_EQUAL), /*css: code-equal */ - CONNECT_DB(MaterialDesignIcon.CLOUD_UPLOAD), /*cloud-upload*/ + KEY_BINDINGS(MaterialDesignIcon.KEYBOARD), + FIND_DUPLICATES(MaterialDesignIcon.CODE_EQUAL), + CONNECT_DB(MaterialDesignIcon.CLOUD_UPLOAD), SUCCESS(MaterialDesignIcon.CHECK_CIRCLE), - CHECK(MaterialDesignIcon.CHECK) /*css: check */, + CHECK(MaterialDesignIcon.CHECK), WARNING(MaterialDesignIcon.ALERT), ERROR(MaterialDesignIcon.ALERT_CIRCLE), - CASE_SENSITIVE(MaterialDesignIcon.ALPHABETICAL), /* css: mdi-alphabetical */ - REG_EX(MaterialDesignIcon.REGEX), /*css: mdi-regex */ - CONSOLE(MaterialDesignIcon.CONSOLE), /*css: console */ - FORUM(MaterialDesignIcon.FORUM), /* css: forum */ - FACEBOOK(MaterialDesignIcon.FACEBOOK), /* css: facebook */ - TWITTER(MaterialDesignIcon.TWITTER), /* css: twitter */ - BLOG(MaterialDesignIcon.RSS), /* css: rss */ - DATE_PICKER(MaterialDesignIcon.CALENDAR), /* css: calendar */ + CASE_SENSITIVE(MaterialDesignIcon.ALPHABETICAL), + REG_EX(MaterialDesignIcon.REGEX), + CONSOLE(MaterialDesignIcon.CONSOLE), + FORUM(MaterialDesignIcon.FORUM), + FACEBOOK(MaterialDesignIcon.FACEBOOK), + TWITTER(MaterialDesignIcon.TWITTER), + BLOG(MaterialDesignIcon.RSS), + DATE_PICKER(MaterialDesignIcon.CALENDAR), DEFAULT_GROUP_ICON_COLORED(MaterialDesignIcon.PLAY), DEFAULT_GROUP_ICON(MaterialDesignIcon.LABEL_OUTLINE), ALL_ENTRIES_GROUP_ICON(MaterialDesignIcon.DATABASE), diff --git a/src/main/java/org/jabref/gui/importer/ImportAction.java b/src/main/java/org/jabref/gui/importer/ImportAction.java index 8395d3bac92..2c08c0e16ba 100644 --- a/src/main/java/org/jabref/gui/importer/ImportAction.java +++ b/src/main/java/org/jabref/gui/importer/ImportAction.java @@ -70,7 +70,7 @@ public void automatedImport(List filenames) { // TODO: show parserwarnings, if any (not here) // for (ImportFormatReader.UnknownFormatImport p : imports) { // ParserResultWarningDialog.showParserResultWarningDialog(p.parserResult, frame); - //} + // } if (bibtexResult.isEmpty()) { if (importError == null) { // TODO: No control flow using exceptions diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java index 3d2be86cfd7..1561e170a08 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java @@ -236,7 +236,7 @@ public void resolveDuplicate(BibEntry entry) { // TODO: Remove old entry. Or... add it to a list of entries // to be deleted. We only delete // it after Ok is clicked. - //entriesToDelete.add(other.get()); + // entriesToDelete.add(other.get()); // Replace entry by merged entry entries.add(dialog.getMergedEntry()); diff --git a/src/main/java/org/jabref/gui/importer/UnlinkedPDFFileFilter.java b/src/main/java/org/jabref/gui/importer/UnlinkedPDFFileFilter.java index e387a6bd758..6404e716c8d 100644 --- a/src/main/java/org/jabref/gui/importer/UnlinkedPDFFileFilter.java +++ b/src/main/java/org/jabref/gui/importer/UnlinkedPDFFileFilter.java @@ -23,7 +23,6 @@ public class UnlinkedPDFFileFilter implements FileFilter { private final DatabaseFileLookup lookup; private final FileFilter fileFilter; - public UnlinkedPDFFileFilter(FileFilter fileFilter, BibDatabaseContext databaseContext) { this.fileFilter = fileFilter; this.lookup = new DatabaseFileLookup(databaseContext, Globals.prefs.getFilePreferences()); diff --git a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java index 7515921fa03..cf78a65f58d 100644 --- a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java @@ -141,17 +141,16 @@ public void openFiles(List filesToOpen, boolean raisePanel) { final List theFiles = Collections.unmodifiableList(filesToOpen); for (Path theFile : theFiles) { - //This method will execute the concrete file opening and loading in a background thread + // This method will execute the concrete file opening and loading in a background thread openTheFile(theFile, raisePanel); } for (Path theFile : theFiles) { frame.getFileHistory().newFile(theFile); } - } - // If no files are remaining to open, this could mean that a file was - // already open. If so, we may have to raise the correct tab: - else if (toRaise != null) { + } else if (toRaise != null) { + // If no files are remaining to open, this could mean that a file was + // already open. If so, we may have to raise the correct tab: frame.showBasePanel(toRaise); } } diff --git a/src/main/java/org/jabref/gui/keyboard/KeyBinding.java b/src/main/java/org/jabref/gui/keyboard/KeyBinding.java index d2f8db9e875..414bcd64b14 100644 --- a/src/main/java/org/jabref/gui/keyboard/KeyBinding.java +++ b/src/main/java/org/jabref/gui/keyboard/KeyBinding.java @@ -21,7 +21,7 @@ public enum KeyBinding { COPY_BIBTEX_KEY_AND_LINK("Copy BibTeX key and link", Localization.lang("Copy BibTeX key and link"), "ctrl+alt+K", KeyBindingCategory.EDIT), COPY_PREVIEW("Copy preview", Localization.lang("Copy preview"), "ctrl+shift+C", KeyBindingCategory.VIEW), CUT("Cut", Localization.lang("Cut"), "ctrl+X", KeyBindingCategory.EDIT), - //We have to put Entry Editor Previous before, because otherwise the decrease font size is found first + // We have to put Entry Editor Previous before, because otherwise the decrease font size is found first ENTRY_EDITOR_PREVIOUS_PANEL_2("Entry editor, previous panel 2", Localization.lang("Entry editor, previous panel 2"), "ctrl+MINUS", KeyBindingCategory.VIEW), DELETE_ENTRY("Delete entry", Localization.lang("Delete entry"), "DELETE", KeyBindingCategory.BIBTEX), DEFAULT_DIALOG_ACTION("Execute default action in dialog", Localization.lang("Execute default action in dialog"), "ctrl+ENTER", KeyBindingCategory.VIEW), diff --git a/src/main/java/org/jabref/gui/maintable/CellFactory.java b/src/main/java/org/jabref/gui/maintable/CellFactory.java index 357d84e6dc5..29b164f657e 100644 --- a/src/main/java/org/jabref/gui/maintable/CellFactory.java +++ b/src/main/java/org/jabref/gui/maintable/CellFactory.java @@ -24,82 +24,82 @@ public class CellFactory { public CellFactory(ExternalFileTypes externalFileTypes, UndoManager undoManager) { JabRefIcon icon; icon = IconTheme.JabRefIcons.PDF_FILE; - //icon.setToo(Localization.lang("Open") + " PDF"); + // icon.setToo(Localization.lang("Open") + " PDF"); TABLE_ICONS.put(StandardField.PDF, icon); icon = IconTheme.JabRefIcons.WWW; - //icon.setToolTipText(Localization.lang("Open") + " URL"); + // icon.setToolTipText(Localization.lang("Open") + " URL"); TABLE_ICONS.put(StandardField.URL, icon); icon = IconTheme.JabRefIcons.WWW; - //icon.setToolTipText(Localization.lang("Open") + " CiteSeer URL"); + // icon.setToolTipText(Localization.lang("Open") + " CiteSeer URL"); TABLE_ICONS.put(new UnknownField("citeseerurl"), icon); icon = IconTheme.JabRefIcons.WWW; - //icon.setToolTipText(Localization.lang("Open") + " ArXiv URL"); + // icon.setToolTipText(Localization.lang("Open") + " ArXiv URL"); TABLE_ICONS.put(StandardField.EPRINT, icon); icon = IconTheme.JabRefIcons.DOI; - //icon.setToolTipText(Localization.lang("Open") + " DOI " + Localization.lang("web link")); + // icon.setToolTipText(Localization.lang("Open") + " DOI " + Localization.lang("web link")); TABLE_ICONS.put(StandardField.DOI, icon); icon = IconTheme.JabRefIcons.FILE; - //icon.setToolTipText(Localization.lang("Open") + " PS"); + // icon.setToolTipText(Localization.lang("Open") + " PS"); TABLE_ICONS.put(StandardField.PS, icon); icon = IconTheme.JabRefIcons.FOLDER; - //icon.setToolTipText(Localization.lang("Open folder")); + // icon.setToolTipText(Localization.lang("Open folder")); TABLE_ICONS.put(StandardField.FOLDER, icon); icon = IconTheme.JabRefIcons.FILE; - //icon.setToolTipText(Localization.lang("Open file")); + // icon.setToolTipText(Localization.lang("Open file")); TABLE_ICONS.put(StandardField.FILE, icon); for (ExternalFileType fileType : externalFileTypes.getExternalFileTypeSelection()) { icon = fileType.getIcon(); - //icon.setToolTipText(Localization.lang("Open %0 file", fileType.getName())); + // icon.setToolTipText(Localization.lang("Open %0 file", fileType.getName())); TABLE_ICONS.put(fileType.getField(), icon); } SpecialFieldViewModel relevanceViewModel = new SpecialFieldViewModel(SpecialField.RELEVANCE, undoManager); icon = relevanceViewModel.getIcon(); - //icon.setToolTipText(relevanceViewModel.getLocalization()); + // icon.setToolTipText(relevanceViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.RELEVANCE, icon); SpecialFieldViewModel qualityViewModel = new SpecialFieldViewModel(SpecialField.QUALITY, undoManager); icon = qualityViewModel.getIcon(); - //icon.setToolTipText(qualityViewModel.getLocalization()); + // icon.setToolTipText(qualityViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.QUALITY, icon); // Ranking item in the menu uses one star SpecialFieldViewModel rankViewModel = new SpecialFieldViewModel(SpecialField.RANKING, undoManager); icon = rankViewModel.getIcon(); - //icon.setToolTipText(rankViewModel.getLocalization()); + // icon.setToolTipText(rankViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.RANKING, icon); // Priority icon used for the menu SpecialFieldViewModel priorityViewModel = new SpecialFieldViewModel(SpecialField.PRIORITY, undoManager); icon = priorityViewModel.getIcon(); - //icon.setToolTipText(priorityViewModel.getLocalization()); + // icon.setToolTipText(priorityViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.PRIORITY, icon); // Read icon used for menu SpecialFieldViewModel readViewModel = new SpecialFieldViewModel(SpecialField.READ_STATUS, undoManager); icon = readViewModel.getIcon(); - //icon.setToolTipText(readViewModel.getLocalization()); + // icon.setToolTipText(readViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.READ_STATUS, icon); // Print icon used for menu SpecialFieldViewModel printedViewModel = new SpecialFieldViewModel(SpecialField.PRINTED, undoManager); icon = printedViewModel.getIcon(); - //icon.setToolTipText(printedViewModel.getLocalization()); + // icon.setToolTipText(printedViewModel.getLocalization()); TABLE_ICONS.put(SpecialField.PRINTED, icon); } public Node getTableIcon(Field field) { JabRefIcon icon = TABLE_ICONS.get(field); if (icon == null) { - //LOGGER.info("Error: no table icon defined for type '" + field + "'."); + // LOGGER.info("Error: no table icon defined for type '" + field + "'."); return null; } else { // node should be generated for each call, as nodes can be added to the scene graph only once diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index f182dbaf07d..e15ac98e4ce 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -116,7 +116,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame, new PersistenceVisualStateTable(this, Globals.prefs); // TODO: Float marked entries - //model.updateMarkingState(Globals.prefs.getBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES)); + // model.updateMarkingState(Globals.prefs.getBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES)); setupKeyBindings(keyBindingRepository); @@ -242,8 +242,8 @@ private void handleOnDragDetected(TableRow row, BibEntry List entries = getSelectionModel().getSelectedItems().stream().map(BibEntryTableViewModel::getEntry).collect(Collectors.toList()); - //The following is necesary to initiate the drag and drop in javafx, although we don't need the contents - //It doesn't work without + // The following is necesary to initiate the drag and drop in javafx, although we don't need the contents + // It doesn't work without ClipboardContent content = new ClipboardContent(); Dragboard dragboard = startDragAndDrop(TransferMode.MOVE); content.put(DragAndDropDataFormats.ENTRIES, ""); @@ -275,15 +275,15 @@ private void handleOnDragDropped(TableRow row, BibEntryT BibEntry entry = target.getEntry(); switch (event.getTransferMode()) { case LINK: - LOGGER.debug("Mode LINK"); //shift on win or no modifier + LOGGER.debug("Mode LINK"); // shift on win or no modifier importHandler.getLinker().addFilesToEntry(entry, files); break; case MOVE: - LOGGER.debug("Mode MOVE"); //alt on win + LOGGER.debug("Mode MOVE"); // alt on win importHandler.getLinker().moveFilesToFileDirAndAddToEntry(entry, files); break; case COPY: - LOGGER.debug("Mode Copy"); //ctrl on win + LOGGER.debug("Mode Copy"); // ctrl on win importHandler.getLinker().copyFilesToFileDirAndAddToEntry(entry, files); break; } diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java index ab6a2b40ff3..708d9cdfac1 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java @@ -38,7 +38,7 @@ public enum Type { NORMALFIELD("field"), SPECIALFIELD("special", Localization.lang("Special")); - public static final EnumSet ICON_COLUMNS = EnumSet.of(EXTRAFILE,FILES,GROUPS,LINKED_IDENTIFIER); + public static final EnumSet ICON_COLUMNS = EnumSet.of(EXTRAFILE, FILES, GROUPS, LINKED_IDENTIFIER); private String name; private String displayName; diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java b/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java index 4494773b151..08a407a0e41 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeEntries.java @@ -272,7 +272,7 @@ private void setupEntryTypeRow(GridPane mergePanel) { mergePanel.add(button, 2 + k, rowIndex); } if (defaultRadioButtonSelectionMode == DefaultRadioButtonSelectionMode.RIGHT) { - typeRadioButtons.get(1).setSelected(true); //This Radio Button list does not have a third option as compared to the fields, so do not use the constants here + typeRadioButtons.get(1).setSelected(true); // This Radio Button list does not have a third option as compared to the fields, so do not use the constants here rightRadioButtons.add(typeRadioButtons.get(1)); } else { typeRadioButtons.get(0).setSelected(true); diff --git a/src/main/java/org/jabref/gui/openoffice/Bootstrap.java b/src/main/java/org/jabref/gui/openoffice/Bootstrap.java index 28595927251..3cf88df2965 100644 --- a/src/main/java/org/jabref/gui/openoffice/Bootstrap.java +++ b/src/main/java/org/jabref/gui/openoffice/Bootstrap.java @@ -300,7 +300,7 @@ public static final XComponentContext bootstrap(String[] argArray, URLClassLoade } // create call with arguments - //We need a socket, pipe does not work. https://api.libreoffice.org/examples/examples.html + // We need a socket, pipe does not work. https://api.libreoffice.org/examples/examples.html String[] cmdArray = new String[argArray.length + 2]; cmdArray[0] = fOffice.getPath(); cmdArray[1] = ("--accept=socket,host=localhost,port=2083" + ";urp;"); diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java index d22362b7973..0b980933425 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java @@ -153,7 +153,7 @@ public boolean isConnectedToDocument() { public XTextDocument selectComponent(List list) { List viewModel = list.stream().map(DocumentTitleViewModel::new).collect(Collectors.toList()); - //this whole method is part of a background task when autodecting instances, so we need to show dialog in FX thread + // this whole method is part of a background task when autodecting instances, so we need to show dialog in FX thread Optional selectedDocument = dialogService.showChoiceDialogAndWait(Localization.lang("Select document"), Localization.lang("Found documents:"), Localization.lang("Use selected document"), viewModel); return selectedDocument.map(DocumentTitleViewModel::getXtextDocument).orElse(null); } @@ -237,12 +237,12 @@ private XDesktop simpleBootstrap(List jarUrls) URL[] urls = jarUrls.toArray(new URL[1]); URLClassLoader loader = new URLClassLoader(urls, null); - //Get the office component context: + // Get the office component context: XComponentContext xContext = org.jabref.gui.openoffice.Bootstrap.bootstrap(loader); - //Get the office service manager: + // Get the office service manager: XMultiComponentFactory xServiceManager = xContext.getServiceManager(); - //Create the desktop, which is the root frame of the - //hierarchy of frames that contain viewable components: + // Create the desktop, which is the root frame of the + // hierarchy of frames that contain viewable components: Object desktop; try { desktop = xServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", xContext); diff --git a/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java b/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java index 5305d9a45de..491653f3ad6 100644 --- a/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java +++ b/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java @@ -272,11 +272,11 @@ private void initPanel() { VBox row1 = new VBox(); VBox row2 = new VBox(); VBox row3 = new VBox(); - row1.getChildren().addAll(setStyleFile,pushEntries, pushEntriesInt); + row1.getChildren().addAll(setStyleFile, pushEntries, pushEntriesInt); row2.getChildren().addAll(pushEntriesAdvanced, pushEntriesEmpty, merge); row3.getChildren().addAll(manageCitations, exportCitations, settingsB); - HBox hbox1 = new HBox(); - hbox1.getChildren().addAll(row1,row2,row3); + HBox hbox1 = new HBox(); + hbox1.getChildren().addAll(row1, row2, row3); hbox1.getChildren().forEach(btn -> HBox.setHgrow(btn, Priority.ALWAYS)); vbox.setFillWidth(true); diff --git a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java index cf8b4e69c4c..f68f871ac52 100644 --- a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java +++ b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java @@ -21,17 +21,27 @@ public abstract class AbstractPreferenceTabView getRestartWarnings() { return viewModel.getRestartWarnings(); } + public List getRestartWarnings() { + return viewModel.getRestartWarnings(); + } } diff --git a/src/main/java/org/jabref/gui/preferences/AdvancedTabView.java b/src/main/java/org/jabref/gui/preferences/AdvancedTabView.java index 0da5d97b869..5462b442096 100644 --- a/src/main/java/org/jabref/gui/preferences/AdvancedTabView.java +++ b/src/main/java/org/jabref/gui/preferences/AdvancedTabView.java @@ -59,7 +59,9 @@ public AdvancedTabView(JabRefPreferences preferences) { } @Override - public String getTabName() { return Localization.lang("Advanced"); } + public String getTabName() { + return Localization.lang("Advanced"); + } public void initialize() { this.viewModel = new AdvancedTabViewModel(dialogService, preferences); diff --git a/src/main/java/org/jabref/gui/preferences/AdvancedTabViewModel.java b/src/main/java/org/jabref/gui/preferences/AdvancedTabViewModel.java index e573cc379de..ca0655c3a7b 100644 --- a/src/main/java/org/jabref/gui/preferences/AdvancedTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/AdvancedTabViewModel.java @@ -189,15 +189,25 @@ private Optional getPortAsInt(String value) { } } - public ValidationStatus remotePortValidationStatus() { return remotePortValidator.getValidationStatus(); } + public ValidationStatus remotePortValidationStatus() { + return remotePortValidator.getValidationStatus(); + } - public ValidationStatus proxyHostnameValidationStatus() { return proxyHostnameValidator.getValidationStatus(); } + public ValidationStatus proxyHostnameValidationStatus() { + return proxyHostnameValidator.getValidationStatus(); + } - public ValidationStatus proxyPortValidationStatus() { return proxyPortValidator.getValidationStatus(); } + public ValidationStatus proxyPortValidationStatus() { + return proxyPortValidator.getValidationStatus(); + } - public ValidationStatus proxyUsernameValidationStatus() { return proxyUsernameValidator.getValidationStatus(); } + public ValidationStatus proxyUsernameValidationStatus() { + return proxyUsernameValidator.getValidationStatus(); + } - public ValidationStatus proxyPasswordValidationStatus() { return proxyPasswordValidator.getValidationStatus(); } + public ValidationStatus proxyPasswordValidationStatus() { + return proxyPasswordValidator.getValidationStatus(); + } public boolean validateSettings() { CompositeValidator validator = new CompositeValidator(); @@ -226,27 +236,51 @@ public boolean validateSettings() { } @Override - public List getRestartWarnings() { return restartWarning; } + public List getRestartWarnings() { + return restartWarning; + } - public BooleanProperty remoteServerProperty() { return remoteServerProperty; } + public BooleanProperty remoteServerProperty() { + return remoteServerProperty; + } - public StringProperty remotePortProperty() { return remotePortProperty; } + public StringProperty remotePortProperty() { + return remotePortProperty; + } - public BooleanProperty useIEEELatexAbbreviationsProperty() { return useIEEELatexAbbreviationsProperty; } + public BooleanProperty useIEEELatexAbbreviationsProperty() { + return useIEEELatexAbbreviationsProperty; + } - public BooleanProperty useCaseKeeperProperty() { return useCaseKeeperProperty; } + public BooleanProperty useCaseKeeperProperty() { + return useCaseKeeperProperty; + } - public BooleanProperty useUnitFormatterProperty() { return useUnitFormatterProperty; } + public BooleanProperty useUnitFormatterProperty() { + return useUnitFormatterProperty; + } - public BooleanProperty proxyUseProperty() { return proxyUseProperty; } + public BooleanProperty proxyUseProperty() { + return proxyUseProperty; + } - public StringProperty proxyHostnameProperty() { return proxyHostnameProperty; } + public StringProperty proxyHostnameProperty() { + return proxyHostnameProperty; + } - public StringProperty proxyPortProperty() { return proxyPortProperty; } + public StringProperty proxyPortProperty() { + return proxyPortProperty; + } - public BooleanProperty proxyUseAuthenticationProperty() { return proxyUseAuthenticationProperty; } + public BooleanProperty proxyUseAuthenticationProperty() { + return proxyUseAuthenticationProperty; + } - public StringProperty proxyUsernameProperty() { return proxyUsernameProperty; } + public StringProperty proxyUsernameProperty() { + return proxyUsernameProperty; + } - public StringProperty proxyPasswordProperty() { return proxyPasswordProperty; } + public StringProperty proxyPasswordProperty() { + return proxyPasswordProperty; + } } diff --git a/src/main/java/org/jabref/gui/preferences/AppearanceTabView.java b/src/main/java/org/jabref/gui/preferences/AppearanceTabView.java index d2d13f3199c..1d97c4e0acf 100644 --- a/src/main/java/org/jabref/gui/preferences/AppearanceTabView.java +++ b/src/main/java/org/jabref/gui/preferences/AppearanceTabView.java @@ -27,14 +27,16 @@ public AppearanceTabView(JabRefPreferences preferences) { this.preferences = preferences; ViewLoader.view(this) - .root(this) - .load(); + .root(this) + .load(); } @Override - public String getTabName() { return Localization.lang("Appearance"); } + public String getTabName() { + return Localization.lang("Appearance"); + } - public void initialize () { + public void initialize() { this.viewModel = new AppearanceTabViewModel(dialogService, preferences); fontOverride.selectedProperty().bindBidirectional(viewModel.fontOverrideProperty()); diff --git a/src/main/java/org/jabref/gui/preferences/AppearanceTabViewModel.java b/src/main/java/org/jabref/gui/preferences/AppearanceTabViewModel.java index 46acbc077b5..6602791e261 100644 --- a/src/main/java/org/jabref/gui/preferences/AppearanceTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/AppearanceTabViewModel.java @@ -94,7 +94,9 @@ public void storeSettings() { } } - public ValidationStatus fontSizeValidationStatus() { return fontSizeValidator.getValidationStatus(); } + public ValidationStatus fontSizeValidationStatus() { + return fontSizeValidator.getValidationStatus(); + } @Override public boolean validateSettings() { @@ -107,14 +109,23 @@ public boolean validateSettings() { } @Override - public List getRestartWarnings() { return restartWarnings; } - - public BooleanProperty fontOverrideProperty() { return fontOverrideProperty; } + public List getRestartWarnings() { + return restartWarnings; + } - public StringProperty fontSizeProperty() { return fontSizeProperty; } + public BooleanProperty fontOverrideProperty() { + return fontOverrideProperty; + } - public BooleanProperty themeLightProperty() { return themeLightProperty; } + public StringProperty fontSizeProperty() { + return fontSizeProperty; + } - public BooleanProperty themeDarkProperty() { return themeDarkProperty; } + public BooleanProperty themeLightProperty() { + return themeLightProperty; + } + public BooleanProperty themeDarkProperty() { + return themeDarkProperty; + } } diff --git a/src/main/java/org/jabref/gui/preferences/BibtexKeyPatternTabView.java b/src/main/java/org/jabref/gui/preferences/BibtexKeyPatternTabView.java index 139c9bed6e7..20e22c01ac5 100644 --- a/src/main/java/org/jabref/gui/preferences/BibtexKeyPatternTabView.java +++ b/src/main/java/org/jabref/gui/preferences/BibtexKeyPatternTabView.java @@ -46,9 +46,11 @@ public BibtexKeyPatternTabView(JabRefPreferences preferences) { } @Override - public String getTabName() { return Localization.lang("BibTeX key generator"); } + public String getTabName() { + return Localization.lang("BibTeX key generator"); + } - public void initialize () { + public void initialize() { this.viewModel = new BibtexKeyPatternTabViewModel(dialogService, preferences); overwriteAllow.selectedProperty().bindBidirectional(viewModel.overwriteAllowProperty()); diff --git a/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java b/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java index 78b30681fcc..669205b6ab2 100644 --- a/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java +++ b/src/main/java/org/jabref/gui/preferences/EntryEditorTabView.java @@ -29,16 +29,17 @@ public class EntryEditorTabView extends AbstractPreferenceTabView defaultFileNamePatternsProperty = new SimpleListProperty<>(FXCollections.observableArrayList(DEFAULT_FILENAME_PATTERNS)); private final StringProperty fileNamePatternProperty = new SimpleStringProperty(); diff --git a/src/main/java/org/jabref/gui/preferences/NameFormatterTabView.java b/src/main/java/org/jabref/gui/preferences/NameFormatterTabView.java index ffb38f2d225..6e1858fa3cd 100644 --- a/src/main/java/org/jabref/gui/preferences/NameFormatterTabView.java +++ b/src/main/java/org/jabref/gui/preferences/NameFormatterTabView.java @@ -42,7 +42,7 @@ public NameFormatterTabView(JabRefPreferences preferences) { @Override public String getTabName() { return Localization.lang("Name formatter"); } - public void initialize () { + public void initialize() { this.viewModel = new NameFormatterTabViewModel(dialogService, preferences); formatterNameColumn.setSortable(true); diff --git a/src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java b/src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java index 1ff3f88a73b..5d5a841047a 100644 --- a/src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/PreviewTabViewModel.java @@ -205,7 +205,7 @@ public void storeSettings() { for (BasePanel basePanel : JabRefGUI.getMainFrame().getBasePanelList()) { // TODO: Find a better way to update preview basePanel.closeBottomPane(); - //basePanel.getPreviewPanel().updateLayout(preferences.getPreviewPreferences()); + // basePanel.getPreviewPanel().updateLayout(preferences.getPreviewPreferences()); } } diff --git a/src/main/java/org/jabref/gui/preferences/TableTabView.java b/src/main/java/org/jabref/gui/preferences/TableTabView.java index 1a799af40a8..0548f19bfd8 100644 --- a/src/main/java/org/jabref/gui/preferences/TableTabView.java +++ b/src/main/java/org/jabref/gui/preferences/TableTabView.java @@ -31,7 +31,7 @@ public TableTabView(JabRefPreferences preferences) { @Override public String getTabName() { return Localization.lang("Entry table"); } - public void initialize () { + public void initialize() { this.viewModel = new TableTabViewModel(dialogService, preferences); autoResizeName.selectedProperty().bindBidirectional(viewModel.autoResizeNameProperty()); diff --git a/src/main/java/org/jabref/gui/preferences/XmpPrivacyTabView.java b/src/main/java/org/jabref/gui/preferences/XmpPrivacyTabView.java index 1763b759651..03b67a19832 100644 --- a/src/main/java/org/jabref/gui/preferences/XmpPrivacyTabView.java +++ b/src/main/java/org/jabref/gui/preferences/XmpPrivacyTabView.java @@ -45,7 +45,7 @@ public XmpPrivacyTabView(JabRefPreferences preferences) { @Override public String getTabName() { return Localization.lang("XMP metadata"); } - public void initialize () { + public void initialize() { this.viewModel = new XmpPrivacyTabViewModel(dialogService, preferences); enableXmpFilter.selectedProperty().bindBidirectional(viewModel.xmpFilterEnabledProperty()); diff --git a/src/main/java/org/jabref/gui/preview/CopyCitationAction.java b/src/main/java/org/jabref/gui/preview/CopyCitationAction.java index ce7cbba25d6..0edabf2af5b 100644 --- a/src/main/java/org/jabref/gui/preview/CopyCitationAction.java +++ b/src/main/java/org/jabref/gui/preview/CopyCitationAction.java @@ -175,7 +175,7 @@ protected static ClipboardContent processHtml(List citations) { private void setClipBoardContent(List citations) { // if it's not a citation style take care of the preview - if (!(style instanceof CitationStylePreviewLayout)) { + if (!(style instanceof CitationStylePreviewLayout)) { clipBoardManager.setContent(processPreview(citations)); } else { // if it's generated by a citation style take care of each output format diff --git a/src/main/java/org/jabref/gui/preview/PreviewPanel.java b/src/main/java/org/jabref/gui/preview/PreviewPanel.java index 3c8f9b69c6f..3e61d92ca51 100644 --- a/src/main/java/org/jabref/gui/preview/PreviewPanel.java +++ b/src/main/java/org/jabref/gui/preview/PreviewPanel.java @@ -79,15 +79,15 @@ public PreviewPanel(BibDatabaseContext database, DialogService dialogService, Ex List files = event.getDragboard().getFiles().stream().map(File::toPath).collect(Collectors.toList()); if (event.getTransferMode() == TransferMode.MOVE) { - LOGGER.debug("Mode MOVE"); //shift on win or no modifier + LOGGER.debug("Mode MOVE"); // shift on win or no modifier fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); } if (event.getTransferMode() == TransferMode.LINK) { - LOGGER.debug("Node LINK"); //alt on win + LOGGER.debug("Node LINK"); // alt on win fileLinker.addFilesToEntry(entry, files); } if (event.getTransferMode() == TransferMode.COPY) { - LOGGER.debug("Mode Copy"); //ctrl on win, no modifier on Xubuntu + LOGGER.debug("Mode Copy"); // ctrl on win, no modifier on Xubuntu fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); } success = true; diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index bbd62196773..19b861a67e0 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -81,13 +81,9 @@ public void pushEntries(BibDatabaseContext database, List entries, Str ProcessBuilder processBuilder = new ProcessBuilder(getCommandLine(keyString)); processBuilder.start(); } - } - - // In case it did not work - catch (IOException excep) { + } catch (IOException excep) { + LOGGER.warn("Error: Could not call executable '{}'", commandPath, excep); couldNotCall = true; - - LOGGER.warn("Error: Could not call executable '" + commandPath + "'.", excep); } } diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index 4820df720d6..341ff97cc92 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -316,7 +316,7 @@ private void updateResults(int matched, TextFlow description, boolean grammarBas // searchIcon.setIcon(IconTheme.JabRefIcon.ADVANCED_SEARCH.getIcon()); } else { // TODO: switch Icon color - //searchIcon.setIcon(IconTheme.JabRefIcon.SEARCH.getIcon()); + // searchIcon.setIcon(IconTheme.JabRefIcon.SEARCH.getIcon()); } setHintTooltip(description); @@ -424,7 +424,7 @@ public AutoCompletePopup getSkinnable() { @Override public void dispose() { - //empty + // empty } } } diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java index d3a4a69376c..b8c604f0bbb 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java @@ -60,7 +60,7 @@ public SharedDatabaseLoginDialogView(JabRefFrame frame) { ControlHelper.setAction(connectButton, this.getDialogPane(), event -> openDatabase()); Button btnConnect = (Button) this.getDialogPane().lookupButton(connectButton); - //must be set here, because in initialize the button is still null + // must be set here, because in initialize the button is still null btnConnect.disableProperty().bind(viewModel.formValidation().validProperty().not()); btnConnect.textProperty().bind(EasyBind.map(viewModel.loadingProperty(), loading -> (loading) ? Localization.lang("Connecting...") : Localization.lang("Connect"))); } @@ -103,7 +103,7 @@ private void initialize() { passwordKeystore.disableProperty().bind(viewModel.useSSLProperty().not()); passwordKeystore.textProperty().bindBidirectional(viewModel.keyStorePasswordProperty()); - //Must be executed after the initialization of the view, otherwise it doesn't work + // Must be executed after the initialization of the view, otherwise it doesn't work Platform.runLater(() -> { visualizer.initVisualization(viewModel.dbValidation(), database, true); visualizer.initVisualization(viewModel.hostValidation(), host, true); diff --git a/src/main/java/org/jabref/gui/undo/NamedCompound.java b/src/main/java/org/jabref/gui/undo/NamedCompound.java index 1d663bc887b..55be19a96e3 100644 --- a/src/main/java/org/jabref/gui/undo/NamedCompound.java +++ b/src/main/java/org/jabref/gui/undo/NamedCompound.java @@ -10,7 +10,6 @@ public class NamedCompound extends CompoundEdit { private final String name; private boolean hasEdits; - public NamedCompound(String name) { super(); this.name = name; diff --git a/src/main/java/org/jabref/gui/util/DirectoryDialogConfiguration.java b/src/main/java/org/jabref/gui/util/DirectoryDialogConfiguration.java index aa82819a9bb..d390676c4b5 100644 --- a/src/main/java/org/jabref/gui/util/DirectoryDialogConfiguration.java +++ b/src/main/java/org/jabref/gui/util/DirectoryDialogConfiguration.java @@ -28,12 +28,12 @@ public DirectoryDialogConfiguration build() { public Builder withInitialDirectory(Path directory) { directory = directory.toAbsolutePath(); - //Dir must be a folder, not a file + // Dir must be a folder, not a file if (!Files.isDirectory(directory)) { directory = directory.getParent(); } - //The lines above work also if the dir does not exist at all! - //NULL is accepted by the filechooser as no inital path + // The lines above work also if the dir does not exist at all! + // NULL is accepted by the filechooser as no inital path if (!Files.exists(directory)) { diff --git a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java index 05edd7a05aa..c1e7d1b1f0d 100644 --- a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java +++ b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java @@ -65,15 +65,15 @@ public FileDialogConfiguration build() { } public Builder withInitialDirectory(Path directory) { - if (directory == null) { //It could be that somehow the path is null, for example if it got deleted in the meantime + if (directory == null) { // It could be that somehow the path is null, for example if it got deleted in the meantime initialDirectory = null; - } else { //Dir must be a folder, not a file + } else { // Dir must be a folder, not a file if (!Files.isDirectory(directory)) { directory = directory.getParent(); } - //The lines above work also if the dir does not exist at all! - //NULL is accepted by the filechooser as no inital path - //Explicit null check, if somehow the parent is null, as Files.exists throws an NPE otherwise + // The lines above work also if the dir does not exist at all! + // NULL is accepted by the filechooser as no inital path + // Explicit null check, if somehow the parent is null, as Files.exists throws an NPE otherwise if ((directory != null) && !Files.exists(directory)) { directory = null; } diff --git a/src/main/java/org/jabref/gui/util/RadioButtonCell.java b/src/main/java/org/jabref/gui/util/RadioButtonCell.java index 6dbe8b8b613..1019c6ebe0c 100644 --- a/src/main/java/org/jabref/gui/util/RadioButtonCell.java +++ b/src/main/java/org/jabref/gui/util/RadioButtonCell.java @@ -52,4 +52,4 @@ protected void updateItem(T item, boolean empty) { setGraphic(hb); } } -} \ No newline at end of file +} diff --git a/src/main/java/org/jabref/gui/util/component/DiffHighlightingTextPane.java b/src/main/java/org/jabref/gui/util/component/DiffHighlightingTextPane.java index 496feb1e5ee..de341c3cc5e 100644 --- a/src/main/java/org/jabref/gui/util/component/DiffHighlightingTextPane.java +++ b/src/main/java/org/jabref/gui/util/component/DiffHighlightingTextPane.java @@ -11,7 +11,6 @@ public class DiffHighlightingTextPane extends TextFlow { private static final String CONTENT_TYPE = "text/html"; - public DiffHighlightingTextPane() { super(); // setContentType(CONTENT_TYPE); diff --git a/src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java b/src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java index d58ba62cf1b..9970dc32730 100644 --- a/src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java +++ b/src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java @@ -131,8 +131,10 @@ private Optional determineBackupPath() { private void performBackup(Path backupPath) { try { Charset charset = bibDatabaseContext.getMetaData().getEncoding().orElse(preferences.getDefaultEncoding()); - SavePreferences savePreferences = preferences.loadForSaveFromPreferences().withEncoding - (charset).withMakeBackup(false); + SavePreferences savePreferences = preferences + .loadForSaveFromPreferences() + .withEncoding(charset) + .withMakeBackup(false); new BibtexDatabaseWriter(new AtomicFileWriter(backupPath, savePreferences.getEncoding()), savePreferences, entryTypesManager) .saveDatabase(bibDatabaseContext); } catch (IOException e) { diff --git a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java index c7ce8ea8a10..15e65163f67 100644 --- a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java +++ b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java @@ -60,7 +60,7 @@ private static void checkBraces(String text) throws InvalidFieldValueException { // Then we throw an exception if the error criteria are met. if (!(right == 0) && (left == 0)) { - LOGGER.error("Unescaped '}' character without opening bracket ends string prematurely. Field value: {}", text ); + LOGGER.error("Unescaped '}' character without opening bracket ends string prematurely. Field value: {}", text); throw new InvalidFieldValueException("Unescaped '}' character without opening bracket ends string prematurely. Field value: " + text); } if (!(right == 0) && (right < left)) { diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java index e663702d7a3..e3435b7ac7b 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java @@ -110,7 +110,7 @@ private static List compareEntries(List originalEntries, differences.add(new BibEntryDiff(originalEntry, null)); } } - + // Finally, look if there are still untouched entries in the new database. These may have been added. for (int i = 0; i < newEntries.size(); i++) { if (!used.contains(i)) { diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java b/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java index 312a4f51af6..c8fcda144d7 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java @@ -9,7 +9,6 @@ public class BibtexStringComparator implements Comparator { private final boolean considerRefs; - /** * @param considerRefs Indicates whether the strings should be * sorted according to internal references in addition to diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java b/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java index fdfc5568f5e..b7c9526e1cd 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparatorStack.java @@ -12,7 +12,6 @@ public class FieldComparatorStack implements Comparator { private final List> comparators; - public FieldComparatorStack(List> comparators) { this.comparators = comparators; } diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java b/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java index 8a03e9d0966..d887ac16a15 100644 --- a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java +++ b/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGenerator.java @@ -102,7 +102,7 @@ public static String removeUnwantedCharacters(String key, boolean enforceLegalKe } public static String cleanKey(String key, boolean enforceLegalKey) { - return removeUnwantedCharacters(key, enforceLegalKey).replaceAll("\\s",""); + return removeUnwantedCharacters(key, enforceLegalKey).replaceAll("\\s", ""); } public String generateKey(BibEntry entry) { diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java b/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java index 5b2b15eb964..8c0d7ff3a83 100644 --- a/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java +++ b/src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java @@ -108,7 +108,7 @@ public static String expandBrackets(String pattern, Character keywordDelimiter, Objects.requireNonNull(pattern); Objects.requireNonNull(entry); StringBuilder sb = new StringBuilder(); - StringTokenizer st = new StringTokenizer(pattern,"\\[]",true); + StringTokenizer st = new StringTokenizer(pattern, "\\[]", true); while (st.hasMoreTokens()) { String token = st.nextToken(); @@ -203,9 +203,8 @@ public static String getFieldValue(BibEntry entry, String value, Character keywo return allAuthors(authString); } else if ("authorsAlpha".equals(val)) { return authorsAlpha(authString); - } - // Last author's last name - else if ("authorLast".equals(val)) { + } else if ("authorLast".equals(val)) { + // Last author's last name return lastAuthor(authString); } else if ("authorLastForeIni".equals(val)) { return lastAuthorForenameInitials(authString); @@ -227,6 +226,7 @@ else if ("authorLast".equals(val)) { return authNofMth(authString, Integer.parseInt(nums[0]), Integer.parseInt(nums[1])); } else if (val.matches("auth\\d+")) { + // authN. First N chars of the first author's last name. int num = Integer.parseInt(val.substring(4)); return authN(authString, num, isEnforceLegalKey); } else if (val.matches("authors\\d+")) { @@ -264,10 +264,7 @@ else if ("authorLast".equals(val)) { return authAuthEa(entry.getResolvedFieldOrAlias(StandardField.EDITOR, database).orElse("")); } else if ("edtrshort".equals(val)) { return authshort(entry.getResolvedFieldOrAlias(StandardField.EDITOR, database).orElse("")); - } - // authN. First N chars of the first author's last - // name. - else if (val.matches("edtr\\d+")) { + } else if (val.matches("edtr\\d+")) { String fa = firstAuthor(entry.getResolvedFieldOrAlias(StandardField.EDITOR, database).orElse("")); int num = Integer.parseInt(val.substring(4)); if (num > fa.length()) { @@ -351,8 +348,7 @@ else if (val.matches("edtr\\d+")) { // we haven't seen any special demands return entry.getResolvedFieldOrAlias(FieldFactory.parseField(val), database).orElse(""); } - } - catch (NullPointerException ex) { + } catch (NullPointerException ex) { LOGGER.debug("Problem making expanding bracketed expression", ex); return ""; } diff --git a/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java b/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java index 7c1dc1ab81a..4704b0e36c9 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java +++ b/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java @@ -30,13 +30,13 @@ public enum FORMAT_MODE { // However, we decided against it and will probably do the other way round: https://github.com/JabRef/jabref/pull/215#issuecomment-146981624 // Each word should start with a capital letter - //EACH_FIRST_UPPERS('f'), + // EACH_FIRST_UPPERS('f'), // Converts all words to upper case, but converts articles, prepositions, and conjunctions to lower case // Capitalizes first and last word // Does not change words starting with "{" // DIFFERENCE to old CaseChangers.TITLE: last word is NOT capitalized in all cases - //TITLE_UPPERS('T'); + // TITLE_UPPERS('T'); private final char asChar; diff --git a/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java b/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java index ab602be398a..d24a4ba56ac 100644 --- a/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java +++ b/src/main/java/org/jabref/logic/bst/ChangeCaseFunction.java @@ -35,7 +35,6 @@ public class ChangeCaseFunction implements BstFunction { private final VM vm; - public ChangeCaseFunction(VM vm) { this.vm = vm; } diff --git a/src/main/java/org/jabref/logic/bst/FormatNameFunction.java b/src/main/java/org/jabref/logic/bst/FormatNameFunction.java index 75a8189159d..b2845c89be7 100644 --- a/src/main/java/org/jabref/logic/bst/FormatNameFunction.java +++ b/src/main/java/org/jabref/logic/bst/FormatNameFunction.java @@ -27,7 +27,6 @@ public class FormatNameFunction implements BstFunction { private final VM vm; - public FormatNameFunction(VM vm) { this.vm = vm; } diff --git a/src/main/java/org/jabref/logic/bst/PurifyFunction.java b/src/main/java/org/jabref/logic/bst/PurifyFunction.java index 387ed22d18a..b0df9df3735 100644 --- a/src/main/java/org/jabref/logic/bst/PurifyFunction.java +++ b/src/main/java/org/jabref/logic/bst/PurifyFunction.java @@ -19,7 +19,6 @@ public class PurifyFunction implements BstFunction { private final VM vm; - public PurifyFunction(VM vm) { this.vm = vm; } diff --git a/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java b/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java index e97defa4290..983792ad833 100644 --- a/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java +++ b/src/main/java/org/jabref/logic/bst/TextPrefixFunction.java @@ -24,7 +24,6 @@ public class TextPrefixFunction implements BstFunction { private final VM vm; - public TextPrefixFunction(VM vm) { this.vm = vm; } diff --git a/src/main/java/org/jabref/logic/bst/VM.java b/src/main/java/org/jabref/logic/bst/VM.java index 7b120710e1b..0c0aa46302a 100644 --- a/src/main/java/org/jabref/logic/bst/VM.java +++ b/src/main/java/org/jabref/logic/bst/VM.java @@ -514,7 +514,6 @@ private VM(CommonTree tree) { } }); - /* * Pops the top three literals (they are the two integers literals * len and start, and a string literal, in that order). It pushes @@ -685,10 +684,10 @@ private void textLengthFunction() { } // end } - } + // else if (str_pool[sp_ptr-1] = right_brace) then // begin - else if (c[i - 1] == '}') { + } else if (c[i - 1] == '}') { // if (sp_brace_level > 0) then if (braceLevel > 0) { // decr(sp_brace_level); diff --git a/src/main/java/org/jabref/logic/bst/WidthFunction.java b/src/main/java/org/jabref/logic/bst/WidthFunction.java index fed1346a152..06784267bf0 100644 --- a/src/main/java/org/jabref/logic/bst/WidthFunction.java +++ b/src/main/java/org/jabref/logic/bst/WidthFunction.java @@ -19,7 +19,6 @@ public class WidthFunction implements BstFunction { private final VM vm; - public WidthFunction(VM vm) { this.vm = vm; } diff --git a/src/main/java/org/jabref/logic/cleanup/Cleanups.java b/src/main/java/org/jabref/logic/cleanup/Cleanups.java index 7a9e510c7b7..d5bbc705523 100644 --- a/src/main/java/org/jabref/logic/cleanup/Cleanups.java +++ b/src/main/java/org/jabref/logic/cleanup/Cleanups.java @@ -67,7 +67,7 @@ public static List parse(String formatterString) { List actions = new ArrayList<>(); - //read concrete actions + // read concrete actions int startIndex = 0; // first remove all newlines for easier parsing @@ -82,7 +82,7 @@ public static List parse(String formatterString) { int endIndex = remainingString.indexOf(']'); startIndex += endIndex + 1; - //read each formatter + // read each formatter int tokenIndex = remainingString.indexOf(','); do { boolean doBreak = false; diff --git a/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java b/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java index 1bbecb2f41c..677d30bdf2a 100644 --- a/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java @@ -37,8 +37,7 @@ public List cleanup(BibEntry entry) { if (fileEntry.isOnlineLink()) { // keep online link untouched newFileName = oldFileName; - } - else { + } else { // only try to transform local file path to relative one newFileName = FileUtil .relativize(Paths.get(oldFileName), databaseContext.getFileDirectoriesAsPaths(filePreferences)) diff --git a/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java b/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java index f2769cfa39c..188dc80d060 100644 --- a/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java @@ -22,7 +22,6 @@ public class UpgradePdfPsToFileCleanup implements CleanupJob { // Field name and file type name (from ExternalFileTypes) private final Map fields = new HashMap<>(); - public UpgradePdfPsToFileCleanup() { fields.put(StandardField.PDF, "PDF"); fields.put(StandardField.PS, "PostScript"); diff --git a/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java b/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java index 67beb678b17..4492d052095 100644 --- a/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java +++ b/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java @@ -119,7 +119,7 @@ public static List getSortedEntries(BibDatabaseContext bibDatabaseCont Objects.requireNonNull(bibDatabaseContext); Objects.requireNonNull(entriesToSort); - //if no meta data are present, simply return in original order + // if no meta data are present, simply return in original order if (bibDatabaseContext.getMetaData() == null) { return new LinkedList<>(entriesToSort); } @@ -215,7 +215,7 @@ public void savePartOfDatabase(BibDatabaseContext bibDatabaseContext, List void parse(T entryType, BibEntry bibEntry, Entry entry) { } } - //set the entryType to the entry + // set the entryType to the entry List entryMethods = getListOfSetMethods(entry); for (Method method : entryMethods) { String methodWithoutSet = method.getName().replace("set", ""); diff --git a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java b/src/main/java/org/jabref/logic/exporter/GroupSerializer.java index 3e1c9d9fa03..635532c2f46 100644 --- a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java +++ b/src/main/java/org/jabref/logic/exporter/GroupSerializer.java @@ -117,13 +117,13 @@ private String serializeGroup(AbstractGroup group) { if (group instanceof AllEntriesGroup) { return serializeAllEntriesGroup(); } else if (group instanceof ExplicitGroup) { - return serializeExplicitGroup((ExplicitGroup)group); + return serializeExplicitGroup((ExplicitGroup) group); } else if (group instanceof KeywordGroup) { - return serializeKeywordGroup((KeywordGroup)group); + return serializeKeywordGroup((KeywordGroup) group); } else if (group instanceof SearchGroup) { - return serializeSearchGroup((SearchGroup)group); + return serializeSearchGroup((SearchGroup) group); } else if (group instanceof AutomaticKeywordGroup) { - return serializeAutomaticKeywordGroup((AutomaticKeywordGroup)group); + return serializeAutomaticKeywordGroup((AutomaticKeywordGroup) group); } else if (group instanceof AutomaticPersonsGroup) { return serializeAutomaticPersonsGroup((AutomaticPersonsGroup) group); } else if (group instanceof TexGroup) { diff --git a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java index 5876ee29ee1..4cfa57ce175 100644 --- a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java +++ b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java @@ -23,7 +23,7 @@ private MetaDataSerializer() { } /** - * Writes all data in the format . + * Writes all data in the format <key, serialized data>. */ public static Map getSerializedStringMap(MetaData metaData, GlobalBibtexKeyPattern globalCiteKeyPattern) { @@ -80,7 +80,7 @@ private static Map serializeMetaData(Map> s for (String dataItem : metaItem.getValue()) { stringBuilder.append(StringUtil.quote(dataItem, MetaData.SEPARATOR_STRING, MetaData.ESCAPE_CHARACTER)).append(MetaData.SEPARATOR_STRING); - //in case of save actions, add an additional newline after the enabled flag + // in case of save actions, add an additional newline after the enabled flag if (metaItem.getKey().equals(MetaData.SAVE_ACTIONS) && (FieldFormatterCleanups.ENABLED.equals(dataItem) || FieldFormatterCleanups.DISABLED.equals(dataItem))) { diff --git a/src/main/java/org/jabref/logic/exporter/ModsExporter.java b/src/main/java/org/jabref/logic/exporter/ModsExporter.java index 7e80a699ddd..7d352379748 100644 --- a/src/main/java/org/jabref/logic/exporter/ModsExporter.java +++ b/src/main/java/org/jabref/logic/exporter/ModsExporter.java @@ -155,7 +155,7 @@ private void createMarshallerAndWriteToFile(Path file, JAXBElement element = new JAXBElement<>(new QName(MODS_NAMESPACE_URI, "namePart"), @@ -390,12 +390,12 @@ private void addOriginInformation(Field field, String value, OriginInfoDefinitio originInfo.getPlaceOrPublisherOrDateIssued().add(element); } else if (field.equals(StandardField.ADDRESS)) { PlaceDefinition placeDefinition = new PlaceDefinition(); - //There can be more than one place, so we split to get all places and add them + // There can be more than one place, so we split to get all places and add them String[] places = value.split(", "); for (String place : places) { PlaceTermDefinition placeTerm = new PlaceTermDefinition(); - //There's no possibility to see from a bib entry whether it is code or text, but since it is in the bib entry - //we assume that it is text + // There's no possibility to see from a bib entry whether it is code or text, but since it is in the bib entry + // we assume that it is text placeTerm.setType(CodeOrText.TEXT); placeTerm.setValue(place); placeDefinition.getPlaceTerm().add(placeTerm); diff --git a/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java b/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java index ee84935708d..cce17100805 100644 --- a/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java +++ b/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java @@ -31,7 +31,6 @@ class OOCalcDatabase { private final List entries; - public OOCalcDatabase(BibDatabase bibtex, List entries) { // Make a list of comparators for sorting the entries: List comparators = new ArrayList<>(); @@ -61,7 +60,7 @@ public Document getDOMrepresentation() { DocumentBuilder dbuild = DocumentBuilderFactory.newInstance().newDocumentBuilder(); result = dbuild.newDocument(); Element collection = result.createElement("office:document-content"); - //collection.setAttribute("xmlns", "http://openoffice.org/2000/office"); + // collection.setAttribute("xmlns", "http://openoffice.org/2000/office"); collection.setAttribute("xmlns:office", "http://openoffice.org/2000/office"); collection.setAttribute("xmlns:style", "http://openoffice.org/2000/style"); collection.setAttribute("xmlns:text", "http://openoffice.org/2000/text"); @@ -145,7 +144,7 @@ public Document getDOMrepresentation() { addTableCell(result, row, new GetOpenOfficeType().format(e.getType().getName())); addTableCell(result, row, getField(e, StandardField.ISBN)); addTableCell(result, row, getField(e, InternalField.KEY_FIELD)); - addTableCell(result, row, getField(e, StandardField.AUTHOR));//new AuthorLastFirst().format(getField(e, StandardField.AUTHOR_FIELD))); + addTableCell(result, row, getField(e, StandardField.AUTHOR)); // new AuthorLastFirst().format(getField(e, StandardField.AUTHOR_FIELD))); addTableCell(result, row, new RemoveWhitespace().format(new RemoveBrackets().format(getField(e, StandardField.TITLE)))); addTableCell(result, row, getField(e, StandardField.JOURNAL)); addTableCell(result, row, getField(e, StandardField.VOLUME)); @@ -160,7 +159,7 @@ public Document getDOMrepresentation() { addTableCell(result, row, getField(e, StandardField.CHAPTER)); addTableCell(result, row, getField(e, StandardField.EDITION)); addTableCell(result, row, getField(e, StandardField.SERIES)); - addTableCell(result, row, getField(e, StandardField.EDITOR));//new AuthorLastFirst().format(getField(e, StandardField.EDITOR_FIELD))); + addTableCell(result, row, getField(e, StandardField.EDITOR)); // new AuthorLastFirst().format(getField(e, StandardField.EDITOR_FIELD))); addTableCell(result, row, getField(e, StandardField.PUBLISHER)); addTableCell(result, row, getField(e, new UnknownField("reporttype"))); addTableCell(result, row, getField(e, StandardField.HOWPUBLISHED)); @@ -199,7 +198,7 @@ private static void addTableCell(Document doc, Element parent, String content) { Element text = doc.createElement("text:p"); Text textNode = doc.createTextNode(content); text.appendChild(textNode); - //text.setTextContent(content); + // text.setTextContent(content); cell.appendChild(text); parent.appendChild(cell); } diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java index 3d402e9714f..c705dd4845f 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java +++ b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java @@ -32,7 +32,6 @@ class OpenDocumentRepresentation { private final BibDatabase database; - public OpenDocumentRepresentation(BibDatabase database, List entries) { this.database = database; // Make a list of comparators for sorting the entries: @@ -60,7 +59,7 @@ public Document getDOMrepresentation() { DocumentBuilder dbuild = DocumentBuilderFactory.newInstance().newDocumentBuilder(); result = dbuild.newDocument(); Element collection = result.createElement("office:document-content"); - //collection.setAttribute("xmlns", "http://openoffice.org/2000/office"); + // collection.setAttribute("xmlns", "http://openoffice.org/2000/office"); collection.setAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0"); collection.setAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0"); collection.setAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0"); @@ -148,13 +147,13 @@ public Document getDOMrepresentation() { addTableCell(result, row, getField(e, StandardField.ADDRESS)); addTableCell(result, row, getField(e, StandardField.ASSIGNEE)); addTableCell(result, row, getField(e, StandardField.ANNOTE)); - addTableCell(result, row, getField(e, StandardField.AUTHOR));//new AuthorLastFirst().format(getField(e, StandardField.AUTHOR_FIELD))); + addTableCell(result, row, getField(e, StandardField.AUTHOR)); // new AuthorLastFirst().format(getField(e, StandardField.AUTHOR_FIELD))); addTableCell(result, row, getField(e, StandardField.BOOKTITLE)); addTableCell(result, row, getField(e, StandardField.CHAPTER)); addTableCell(result, row, getField(e, StandardField.DAY)); addTableCell(result, row, getField(e, StandardField.DAYFILED)); addTableCell(result, row, getField(e, StandardField.EDITION)); - addTableCell(result, row, getField(e, StandardField.EDITOR));//new AuthorLastFirst().format(getField(e, StandardField.EDITOR_FIELD))); + addTableCell(result, row, getField(e, StandardField.EDITOR)); // new AuthorLastFirst().format(getField(e, StandardField.EDITOR_FIELD))); addTableCell(result, row, getField(e, StandardField.HOWPUBLISHED)); addTableCell(result, row, getField(e, StandardField.INSTITUTION)); addTableCell(result, row, getField(e, StandardField.JOURNAL)); @@ -205,7 +204,7 @@ private void addTableCell(Document doc, Element parent, String content) { Element text = doc.createElement("text:p"); Text textNode = doc.createTextNode(content); text.appendChild(textNode); - //text.setTextContent(content); + // text.setTextContent(content); cell.appendChild(text); parent.appendChild(cell); } diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java b/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java index 4281473f5e2..08391fb7a09 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java +++ b/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java @@ -40,7 +40,6 @@ public class OpenDocumentSpreadsheetCreator extends Exporter { private static final Logger LOGGER = LoggerFactory.getLogger(OpenDocumentSpreadsheetCreator.class); - /** * Creates a new instance of OpenOfficeDocumentCreator */ @@ -52,7 +51,7 @@ private static void storeOpenDocumentSpreadsheetFile(Path file, InputStream sour try (ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(Files.newOutputStream(file)))) { - //addResourceFile("mimetype", "/resource/ods/mimetype", out); + // addResourceFile("mimetype", "/resource/ods/mimetype", out); ZipEntry ze = new ZipEntry("mimetype"); String mime = "application/vnd.oasis.opendocument.spreadsheet"; ze.setMethod(ZipEntry.STORED); @@ -67,7 +66,7 @@ private static void storeOpenDocumentSpreadsheetFile(Path file, InputStream sour out.closeEntry(); ZipEntry zipEntry = new ZipEntry("content.xml"); - //zipEntry.setMethod(ZipEntry.DEFLATED); + // zipEntry.setMethod(ZipEntry.DEFLATED); out.putNextEntry(zipEntry); int c; while ((c = source.read()) >= 0) { diff --git a/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java b/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java index 746f97d55b7..e3b1fad0711 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java +++ b/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java @@ -38,7 +38,6 @@ public class OpenOfficeDocumentCreator extends Exporter { private static final Logger LOGGER = LoggerFactory.getLogger(OpenOfficeDocumentCreator.class); - /** * Creates a new instance of OpenOfficeDocumentCreator */ diff --git a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java index 3d95d91a3da..57d2a1f1c03 100644 --- a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java +++ b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java @@ -111,7 +111,6 @@ public TemplateExporter(String displayName, String consoleName, String lfFileNam this.savePreferences = savePreferences; } - /** * Initialize another export format based on templates stored in dir with * layoutFile lfFilename. diff --git a/src/main/java/org/jabref/logic/exporter/XmpExporter.java b/src/main/java/org/jabref/logic/exporter/XmpExporter.java index f622871bb2b..9a045f8ebc8 100644 --- a/src/main/java/org/jabref/logic/exporter/XmpExporter.java +++ b/src/main/java/org/jabref/logic/exporter/XmpExporter.java @@ -15,6 +15,7 @@ import org.jabref.logic.xmp.XmpUtilWriter; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.InternalField; /** * A custom exporter to write bib entries to a .xmp file for further processing @@ -49,7 +50,7 @@ public void export(BibDatabaseContext databaseContext, Path file, Charset encodi for (BibEntry entry : entries) { // Avoid situations, where two cite keys are null Path entryFile; - String suffix = entry.getId() + "_" + entry.getCiteKey() + ".xmp"; + String suffix = entry.getId() + "_" + entry.getField(InternalField.KEY_FIELD).orElse("") + ".xmp"; if (file.getParent() == null) { entryFile = Paths.get(suffix); } else { diff --git a/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java b/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java index ec7c4153adc..c1046b78208 100644 --- a/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java +++ b/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java @@ -142,8 +142,8 @@ public Optional findExistingFile(LinkedFile flEntry, BibEntry entry, Strin Path targetFilePath = flEntry.findIn(databaseContext, filePreferences) .get().getParent().resolve(targetFileName); Path oldFilePath = flEntry.findIn(databaseContext, filePreferences).get(); - //Check if file already exists in directory with different case. - //This is necessary because other entries may have such a file. + // Check if file already exists in directory with different case. + // This is necessary because other entries may have such a file. Optional matchedByDiffCase = Optional.empty(); try (Stream stream = Files.list(oldFilePath.getParent())) { matchedByDiffCase = stream.filter(name -> name.toString().equalsIgnoreCase(targetFilePath.toString())) diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java index 09d8a9b9799..c5d7dafa01f 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java @@ -33,6 +33,6 @@ public String getExampleInput() { @Override public String format(String fieldText) { // StringEscapeUtils converts characters and regex kills tags - return StringEscapeUtils.unescapeHtml4(fieldText).replaceAll("<[^>]*>",""); + return StringEscapeUtils.unescapeHtml4(fieldText).replaceAll("<[^>]*>", ""); } } diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java index c9bf179d201..20dc360ba0f 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java @@ -41,7 +41,7 @@ public String format(String oldString) { newValue = REPLACE_WITH_AT.matcher(newValue).replaceAll("$1@@"); // Replace $, but not \$ with @@ newValue = REPLACE_EVERY_OTHER_AT.matcher(newValue).replaceAll("$1\\$$2@@"); // Replace every other @@ with $ - //newValue = newValue.replaceAll("([0-9\\(\\.]+) \\$","\\$$1\\\\ "); // Move numbers followed by a space left of $ inside the equation, e.g., 0.35 $\mu$m + // newValue = newValue.replaceAll("([0-9\\(\\.]+) \\$","\\$$1\\\\ "); // Move numbers followed by a space left of $ inside the equation, e.g., 0.35 $\mu$m newValue = MOVE_NUMBERS_WITH_OPERATORS.matcher(newValue).replaceAll("\\$$1"); // Move numbers, possibly with operators +, -, or /, left of $ into the equation newValue = MOVE_NUMBERS_RIGHT_INTO_EQUATION.matcher(newValue).replaceAll(" $1@@"); // Move numbers right of @@ into the equation diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java index b32f14a1e11..140d8966b83 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java @@ -41,7 +41,7 @@ public class UnitsToLatexFormatter extends Formatter { "cd", // candela "dB", // decibel "dBm", // decibel - "dBc", //decibel + "dBc", // decibel "eV", // electron volts "inch", // inch "kat", // katal diff --git a/src/main/java/org/jabref/logic/help/HelpFile.java b/src/main/java/org/jabref/logic/help/HelpFile.java index b08b088c510..c010dcd6981 100644 --- a/src/main/java/org/jabref/logic/help/HelpFile.java +++ b/src/main/java/org/jabref/logic/help/HelpFile.java @@ -21,7 +21,7 @@ public enum HelpFile { REGEX_SEARCH("fields/filelinks#RegularExpressionSearch"), PREVIEW("setup/preview"), AUTOSAVE("general/autosave"), - //The help page covers both OO and LO. + // The help page covers both OO and LO. OPENOFFICE_LIBREOFFICE("import-export/openofficeintegration"), FETCHER_ACM("import-using-online-bibliographic-database/acmportal"), FETCHER_ADS("import-using-online-bibliographic-database/ads"), diff --git a/src/main/java/org/jabref/logic/importer/FetcherException.java b/src/main/java/org/jabref/logic/importer/FetcherException.java index 23bd9fc6826..d97a43a6ec1 100644 --- a/src/main/java/org/jabref/logic/importer/FetcherException.java +++ b/src/main/java/org/jabref/logic/importer/FetcherException.java @@ -4,7 +4,6 @@ public class FetcherException extends JabRefException { - public FetcherException(String errorMessage, Throwable cause) { super(errorMessage, cause); } diff --git a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java b/src/main/java/org/jabref/logic/importer/FulltextFetchers.java index 52f2dcbd8d6..6318e6d12c2 100644 --- a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java +++ b/src/main/java/org/jabref/logic/importer/FulltextFetchers.java @@ -89,7 +89,7 @@ private static Optional getResults(Future try { return future.get(); } catch (InterruptedException ignore) { - + // ignore thread interruptions } catch (ExecutionException | CancellationException e) { LOGGER.debug("Fetcher execution failed or was cancelled"); } diff --git a/src/main/java/org/jabref/logic/importer/ImportException.java b/src/main/java/org/jabref/logic/importer/ImportException.java index 061d74442a0..2c92c6f5d1e 100644 --- a/src/main/java/org/jabref/logic/importer/ImportException.java +++ b/src/main/java/org/jabref/logic/importer/ImportException.java @@ -4,7 +4,6 @@ public class ImportException extends JabRefException { - public ImportException(String errorMessage, Exception cause) { super(errorMessage, cause); } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java b/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java index 9dff54b8b74..4b76ff44886 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -156,7 +156,7 @@ public void doPostCleanup(BibEntry entry) { entry.getField(StandardField.ABSTRACT) .map(abstractText -> abstractText.replace("

", "").trim()) - .ifPresent(abstractText-> entry.setField(StandardField.ABSTRACT,abstractText)); + .ifPresent(abstractText -> entry.setField(StandardField.ABSTRACT, abstractText)); // The fetcher adds some garbage (number of found entries etc before) entry.setCommentsBeforeEntry(""); } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java b/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java index d1fcd79b406..9586fb6c519 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java @@ -49,7 +49,7 @@ public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLE uriBuilder.addParameter("sort", "rlv"); // Sort by relevance uriBuilder.addParameter("q", query); // Query uriBuilder.addParameter("t", "doc"); // Type: documents - //uriBuilder.addParameter("start", "0"); // Start index (not supported at the moment) + // uriBuilder.addParameter("start", "0"); // Start index (not supported at the moment) return uriBuilder.build().toURL(); } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java index 96f9d4f4140..39146f3f120 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java @@ -191,8 +191,10 @@ public Optional getHelpPage() { public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLException, FetcherException { URIBuilder uriBuilder = new URIBuilder(SEARCH_URL); DOAJFetcher.addPath(uriBuilder, query); - uriBuilder.addParameter("pageSize", "30"); // Number of results - //uriBuilder.addParameter("page", "1"); // Page (not needed so far) + // Number of results + uriBuilder.addParameter("pageSize", "30"); + // Page (not needed so far) + // uriBuilder.addParameter("page", "1"); return uriBuilder.build().toURL(); } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java b/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java index a8850bd9822..2154325aa3c 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java @@ -44,7 +44,7 @@ public class GoogleScholar implements FulltextFetcher, SearchBasedFetcher { private static final Pattern LINK_TO_BIB_PATTERN = Pattern.compile("(https:\\/\\/scholar.googleusercontent.com\\/scholar.bib[^\"]*)"); private static final String BASIC_SEARCH_URL = "https://scholar.google.com/scholar?"; - private static final String SEARCH_IN_TITLE_URL = "https://scholar.google.com//scholar?"; + private static final String SEARCH_IN_TITLE_URL = "https://scholar.google.com// scholar?"; private static final int NUM_RESULTS = 10; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java b/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java index 0ffd58376ae..1bd9e41bd81 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java @@ -80,7 +80,7 @@ private static BibEntry parseJsonRespone(JSONObject jsonEntry, Character keyword } entry.setField(StandardField.ABSTRACT, jsonEntry.optString("abstract")); - //entry.setField(StandardField.IEEE_ID, jsonEntry.optString("article_number")); + // entry.setField(StandardField.IEEE_ID, jsonEntry.optString("article_number")); final List authors = new ArrayList<>(); JSONObject authorsContainer = jsonEntry.optJSONObject("authors"); @@ -91,7 +91,7 @@ private static BibEntry parseJsonRespone(JSONObject jsonEntry, Character keyword entry.setField(StandardField.AUTHOR, authors.stream().collect(Collectors.joining(" and "))); entry.setField(StandardField.LOCATION, jsonEntry.optString("conference_location")); entry.setField(StandardField.DOI, jsonEntry.optString("doi")); - entry.setField(StandardField.YEAR,jsonEntry.optString("publication_year")); + entry.setField(StandardField.YEAR, jsonEntry.optString("publication_year")); entry.setField(StandardField.PAGES, jsonEntry.optString("start_page") + "--" + jsonEntry.optString("end_page")); JSONObject keywordsContainer = jsonEntry.optJSONObject("index_terms"); @@ -141,7 +141,7 @@ public Optional findFullText(BibEntry entry) throws IOException { stampString = STAMP_BASE_STRING_DOCUMENT + docId; } - //You get this url if you export bibtex from IEEE + // You get this url if you export bibtex from IEEE Matcher stampMatcher = STAMP_PATTERN.matcher(urlString.get()); if (stampMatcher.find()) { // Found it @@ -156,7 +156,7 @@ public Optional findFullText(BibEntry entry) throws IOException { if (doi.isPresent() && doi.get().getDOI().startsWith(IEEE_DOI) && doi.get().getExternalURI().isPresent()) { // Download the HTML page from IEEE URLDownload urlDownload = new URLDownload(doi.get().getExternalURI().get().toURL()); - //We don't need to modify the cookies, but we need support for them + // We don't need to modify the cookies, but we need support for them urlDownload.getCookieFromUrl(); String resolvedDOIPage = urlDownload.asString(); @@ -176,7 +176,7 @@ public Optional findFullText(BibEntry entry) throws IOException { // Download the HTML page containing a frame with the PDF URLDownload urlDownload = new URLDownload(BASE_URL + stampString); - //We don't need to modify the cookies, but we need support for them + // We don't need to modify the cookies, but we need support for them urlDownload.getCookieFromUrl(); String framePage = urlDownload.asString(); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java index 7a676021eff..5497e49c120 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java @@ -60,7 +60,7 @@ public Optional getHelpPage() { public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLException, FetcherException { URIBuilder uriBuilder = new URIBuilder(INSPIRE_HOST); uriBuilder.addParameter("p", query); // Query - //uriBuilder.addParameter("jrec", "1"); // Start index (not needed at the moment) + // uriBuilder.addParameter("jrec", "1"); // Start index (not needed at the moment) uriBuilder.addParameter("rg", "100"); // Should return up to 100 items (instead of default 25) uriBuilder.addParameter("of", "hx"); // BibTeX format return uriBuilder.build().toURL(); @@ -79,7 +79,7 @@ public Parser getParser() { Elements preElements = doc.getElementsByTag("pre"); for (Element elem : preElements) { - //We have to use a new instance here, because otherwise only the first entry gets parsed + // We have to use a new instance here, because otherwise only the first entry gets parsed BibtexParser bibtexParser = new BibtexParser(preferences, new DummyFileUpdateMonitor()); List entry = bibtexParser.parseEntries(elem.text()); entries.addAll(entry); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java index 9168c7f7282..c03fb80265c 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java @@ -64,7 +64,7 @@ private static String replaceCommaWithAND(String query) { } /** - * When using 'esearch.fcgi?db=&term=' we will get a list of IDs matching the query. + * When using 'esearch.fcgi?db=<database>&term=<query>' we will get a list of IDs matching the query. * Input: Any text query (&term) * Output: List of UIDs matching the query * @@ -106,7 +106,7 @@ private List getPubMedIdsFromQuery(String query) throws FetcherException break; case XMLStreamConstants.END_ELEMENT: - //Everything relevant is listed before the IdList. So we break the loop right after the IdList tag closes. + // Everything relevant is listed before the IdList. So we break the loop right after the IdList tag closes. if (streamReader.getName().toString().equals("IdList")) { break fetchLoop; } @@ -166,7 +166,7 @@ public List performSearch(String query) throws FetcherException { } else { String searchTerm = replaceCommaWithAND(query); - //searching for pubmed ids matching the query + // searching for pubmed ids matching the query List idList = getPubMedIdsFromQuery(searchTerm); if (idList.isEmpty()) { @@ -178,7 +178,7 @@ public List performSearch(String query) throws FetcherException { numberOfResultsFound + " results found. Only 50 relevant results will be fetched by default."); } - //pass the list of ids to fetchMedline to download them. like a id fetcher for mutliple ids + // pass the list of ids to fetchMedline to download them. like a id fetcher for mutliple ids entryList = fetchMedline(idList); return entryList; @@ -204,7 +204,7 @@ private URL createSearchUrl(String term) throws URISyntaxException, MalformedURL */ private List fetchMedline(List ids) throws FetcherException { try { - //Separate the IDs with a comma to search multiple entries + // Separate the IDs with a comma to search multiple entries URL fetchURL = getURLForID(String.join(",", ids)); URLConnection data = fetchURL.openConnection(); ParserResult result = new MedlineImporter().importDatabase( diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java index 2b42b3e44ae..600a659e0a3 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -39,7 +39,6 @@ public class MrDLibFetcher implements EntryBasedFetcher { private String description; private String recommendationSetId; - public MrDLibFetcher(String language, Version version) { LANGUAGE = language; VERSION = version; @@ -100,7 +99,7 @@ private String makeServerRequest(String queryByTitle) throws FetcherException { URLDownload.bypassSSLVerification(); String response = urlDownload.asString(); - //Conversion of < and > + // Conversion of < and > response = response.replaceAll(">", ">"); response = response.replaceAll("<", "<"); return response; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java index 19f6128e708..cba36d0dabe 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java @@ -24,7 +24,7 @@ public class RfcFetcher implements IdBasedParserFetcher { private final ImportFormatPreferences importFormatPreferences; - public RfcFetcher (ImportFormatPreferences importFormatPreferences) { + public RfcFetcher(ImportFormatPreferences importFormatPreferences) { this.importFormatPreferences = importFormatPreferences; } diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java b/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java index 56e27018273..23fee42ab0d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java @@ -27,8 +27,7 @@ /** * FulltextFetcher implementation that attempts to find a PDF URL at ScienceDirect. - * - * @see 'https://dev.elsevier.com/' + * See https://dev.elsevier.com/ */ public class ScienceDirect implements FulltextFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(ScienceDirect.class); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java index 817f07f76aa..d27ec8998e7 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java @@ -160,7 +160,7 @@ public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLE uriBuilder.addParameter("q", query); // Search query uriBuilder.addParameter("api_key", API_KEY); // API key uriBuilder.addParameter("p", "20"); // Number of results to return - //uriBuilder.addParameter("s", "1"); // Start item (not needed at the moment) + // uriBuilder.addParameter("s", "1"); // Start item (not needed at the moment) return uriBuilder.build().toURL(); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java index 9fc35b6bb43..23bcec07827 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java @@ -177,14 +177,13 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("TH".equals(entry.getKey())) { comments.add("Short Title: " + entry.getValue()); - } else if ("SE".equals(entry.getKey())) - { + } else if ("SE".equals(entry.getKey())) { hm.put(StandardField.CHAPTER, entry .getValue().toString()); - //else if (entry.getKey().equals("AC")) - // hm.put("",entry.getValue().toString()); - //else if (entry.getKey().equals("LP")) - // hm.put("",entry.getValue().toString()); + // else if (entry.getKey().equals("AC")) + // hm.put("",entry.getValue().toString()); + // else if (entry.getKey().equals("LP")) + // hm.put("",entry.getValue().toString()); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java index 7284171237a..b8e5ce78712 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java @@ -32,6 +32,7 @@ public BibtexImporter(ImportFormatPreferences importFormatPreferences, FileUpdat this.importFormatPreferences = importFormatPreferences; this.fileMonitor = fileMonitor; } + /** * @return true as we have no effective way to decide whether a file is in bibtex format or not. See * https://github.com/JabRef/jabref/pull/379#issuecomment-158685726 for more details. diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java b/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java index 0934f841398..d3b1c2ba865 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java @@ -38,6 +38,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.FieldProperty; +import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.metadata.MetaData; @@ -89,7 +90,7 @@ public BibtexParser(ImportFormatPreferences importFormatPreferences, FileUpdateM * * @param bibtexString * @param fileMonitor - * @return An Optional. Optional.empty() if non was found or an error occurred. + * @return An Optional<BibEntry>. Optional.empty() if non was found or an error occurred. * @throws ParseException */ public static Optional singleFromString(String bibtexString, ImportFormatPreferences importFormatPreferences, FileUpdateMonitor fileMonitor) throws ParseException { @@ -247,7 +248,9 @@ private void parseAndAddEntry(String type) { boolean duplicateKey = database.insertEntry(entry); if (duplicateKey) { - parserResult.addDuplicateKey(entry.getCiteKey()); + entry.getField(InternalField.KEY_FIELD).ifPresent( + key -> parserResult.addDuplicateKey(key) + ); } } catch (IOException ex) { // Trying to make the parser more robust. @@ -574,7 +577,7 @@ private void parseField(BibEntry entry) throws IOException { if (field.getProperties().contains(FieldProperty.PERSON_NAMES)) { entry.setField(field, entry.getField(field).get() + " and " + content); } else if (StandardField.KEYWORDS.equals(field)) { - //multiple keywords fields should be combined to one + // multiple keywords fields should be combined to one entry.addKeyword(content, importFormatPreferences.getKeywordSeparator()); } } else { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java index f306a5e307a..794030a0423 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java @@ -197,9 +197,8 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else { hm.put(StandardField.PUBLISHER, val); } - } - // replace single dash page ranges (23-45) with double dashes (23--45): - else if ("P".equals(prefix)) { + } else if ("P".equals(prefix)) { + // replace single dash page ranges (23-45) with double dashes (23--45): hm.put(StandardField.PAGES, val.replaceAll("([0-9]) *- *([0-9])", "$1--$2")); } else if ("V".equals(prefix)) { hm.put(StandardField.VOLUME, val); @@ -245,14 +244,14 @@ else if ("P".equals(prefix)) { author = ""; } - //fixauthorscomma + // fixauthorscomma if (!"".equals(author)) { hm.put(StandardField.AUTHOR, fixAuthor(author)); } if (!"".equals(editor)) { hm.put(StandardField.EDITOR, fixAuthor(editor)); } - //if pages missing and article number given, use the article number + // if pages missing and article number given, use the article number if (((hm.get(StandardField.PAGES) == null) || "-".equals(hm.get(StandardField.PAGES))) && !"".equals(artnum)) { hm.put(StandardField.PAGES, artnum); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java b/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java index 29c24e20f4d..16aca51e16d 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/GvkParser.java @@ -49,7 +49,7 @@ private List parseEntries(Document content) { // Namespace srwNamespace = Namespace.getNamespace("srw","http://www.loc.gov/zing/srw/"); // Schleife ueber allen Teilergebnissen - //Element root = content.getDocumentElement(); + // Element root = content.getDocumentElement(); Element root = (Element) content.getElementsByTagName("zs:searchRetrieveResponse").item(0); Element srwrecords = getChild("zs:records", root); if (srwrecords == null) { @@ -111,12 +111,12 @@ private BibEntry parseEntry(Element e) { } } - //ppn + // ppn if ("003@".equals(tag)) { ppn = getSubfield("0", datafield); } - //author + // author if ("028A".equals(tag)) { String vorname = getSubfield("d", datafield); String nachname = getSubfield("a", datafield); @@ -128,7 +128,7 @@ private BibEntry parseEntry(Element e) { } author = author.concat(vorname + " " + nachname); } - //author (weiterer) + // author (weiterer) if ("028B".equals(tag)) { String vorname = getSubfield("d", datafield); String nachname = getSubfield("a", datafield); @@ -141,7 +141,7 @@ private BibEntry parseEntry(Element e) { author = author.concat(vorname + " " + nachname); } - //editor + // editor if ("028C".equals(tag)) { String vorname = getSubfield("d", datafield); String nachname = getSubfield("a", datafield); @@ -154,24 +154,24 @@ private BibEntry parseEntry(Element e) { editor = editor.concat(vorname + " " + nachname); } - //title and subtitle + // title and subtitle if ("021A".equals(tag)) { title = getSubfield("a", datafield); subtitle = getSubfield("d", datafield); } - //publisher and address + // publisher and address if ("033A".equals(tag)) { publisher = getSubfield("n", datafield); address = getSubfield("p", datafield); } - //year + // year if ("011@".equals(tag)) { year = getSubfield("a", datafield); } - //year, volume, number, pages (year bei Zeitschriften (evtl. redundant mit 011@)) + // year, volume, number, pages (year bei Zeitschriften (evtl. redundant mit 011@)) if ("031A".equals(tag)) { year = getSubfield("j", datafield); @@ -194,13 +194,13 @@ private BibEntry parseEntry(Element e) { } number = title; } - //title and subtitle + // title and subtitle title = getSubfield("a", datafield); subtitle = getSubfield("d", datafield); volume = getSubfield("l", datafield); } - //series and number + // series and number if ("036E".equals(tag)) { series = getSubfield("a", datafield); number = getSubfield("l", datafield); @@ -211,17 +211,17 @@ private BibEntry parseEntry(Element e) { } } - //note + // note if ("037A".equals(tag)) { note = getSubfield("a", datafield); } - //edition + // edition if ("032@".equals(tag)) { edition = getSubfield("a", datafield); } - //isbn + // isbn if ("004A".equals(tag)) { final String isbn10 = getSubfield("0", datafield); final String isbn13 = getSubfield("A", datafield); @@ -252,7 +252,7 @@ private BibEntry parseEntry(Element e) { } } - //journal oder booktitle + // journal oder booktitle /* Problematiken hier: Sowohl für Artikel in * Zeitschriften als für Beiträge in Büchern @@ -271,7 +271,7 @@ private BibEntry parseEntry(Element e) { publisher = getSubfield("n", datafield); } - //pagetotal + // pagetotal if ("034D".equals(tag)) { pagetotal = getSubfield("a", datafield); @@ -297,13 +297,13 @@ private BibEntry parseEntry(Element e) { entryType = StandardEntryType.Book; } - //Hilfskategorien zur Entscheidung @article - //oder @incollection; hier könnte man auch die - //ISBN herausparsen als Erleichterung für das - //Auffinden der Quelle, die über die - //SRU-Schnittstelle gelieferten Daten zur - //Quelle unvollständig sind (z.B. nicht Serie - //und Nummer angegeben werden) + // Hilfskategorien zur Entscheidung @article + // oder @incollection; hier könnte man auch die + // ISBN herausparsen als Erleichterung für das + // Auffinden der Quelle, die über die + // SRU-Schnittstelle gelieferten Daten zur + // Quelle unvollständig sind (z.B. nicht Serie + // und Nummer angegeben werden) if ("039B".equals(tag)) { quelle = getSubfield("8", datafield); } @@ -353,7 +353,7 @@ private BibEntry parseEntry(Element e) { } else if (mak.startsWith("O")) { entryType = BibEntry.DEFAULT_TYPE; // FIXME: online only available in Biblatex - //entryType = "online"; + // entryType = "online"; } /* diff --git a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java index 8e5b9873075..2fa6dcdf462 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java @@ -348,7 +348,7 @@ static String parseMonth(String value) { for (String part : parts) { try { int number = Integer.parseInt(part); - Optional month = Month.getMonthByNumber(number); + Optional month = Month.getMonthByNumber(number); if (month.isPresent()) { return month.get().getJabRefFormat(); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java index c37038bbb81..cd91bd6c3c8 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -151,7 +151,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { try { Object unmarshalledObject = unmarshallRoot(reader); - //check whether we have an article set, an article, a book article or a book article set + // check whether we have an article set, an article, a book article or a book article set if (unmarshalledObject instanceof PubmedArticleSet) { PubmedArticleSet articleSet = (PubmedArticleSet) unmarshalledObject; for (Object article : articleSet.getPubmedArticleOrPubmedBookArticle()) { @@ -189,7 +189,7 @@ private Object unmarshallRoot(BufferedReader reader) throws JAXBException, XMLSt XMLInputFactory xmlInputFactory = XMLInputFactory.newFactory(); XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(reader); - //go to the root element + // go to the root element while (!xmlStreamReader.isStartElement()) { xmlStreamReader.next(); } @@ -290,7 +290,7 @@ private void addBookInformation(Map fields, Book book) { } if (book.getAuthorList() != null) { List authorLists = book.getAuthorList(); - //authorLists size should be one + // authorLists size should be one if (authorLists.size() == 1) { for (AuthorList authorList : authorLists) { handleAuthors(fields, authorList); @@ -458,7 +458,7 @@ private void addInvestigators(Map fields, InvestigatorList invest } investigatorNames.add(name); - //now add the affiliation info + // now add the affiliation info if (investigator.getAffiliationInfo() != null) { for (AffiliationInfo info : investigator.getAffiliationInfo()) { for (Serializable affiliation : info.getAffiliation().getContent()) { @@ -476,7 +476,7 @@ private void addInvestigators(Map fields, InvestigatorList invest private void addKeyWords(Map fields, List allKeywordLists) { List keywordStrings = new ArrayList<>(); - //add keywords to the list + // add keywords to the list for (KeywordList keywordList : allKeywordLists) { for (Keyword keyword : keywordList.getKeyword()) { for (Serializable content : keyword.getContent()) { @@ -486,12 +486,12 @@ private void addKeyWords(Map fields, List allKeyword } } } - //Check whether MeshHeadingList exist or not + // Check whether MeshHeadingList exist or not if (fields.get(StandardField.KEYWORDS) == null) { fields.put(StandardField.KEYWORDS, join(keywordStrings, KEYWORD_SEPARATOR)); } else { if (keywordStrings.size() > 0) { - //if it exists, combine the MeshHeading with the keywords + // if it exists, combine the MeshHeading with the keywords String result = join(keywordStrings, "; "); result = fields.get(StandardField.KEYWORDS) + KEYWORD_SEPARATOR + result; fields.put(StandardField.KEYWORDS, result); @@ -509,7 +509,7 @@ private void addOtherId(Map fields, List otherID) { private void addPersonalNames(Map fields, PersonalNameSubjectList personalNameSubjectList) { if (fields.get(StandardField.AUTHOR) == null) { - //if no authors appear, then add the personal names as authors + // if no authors appear, then add the personal names as authors List personalNames = new ArrayList<>(); if (personalNameSubjectList.getPersonalNameSubject() != null) { List personalNameSubject = personalNameSubjectList.getPersonalNameSubject(); @@ -600,7 +600,7 @@ private void addElocationID(Map fields, ELocationID eLocationID) private void addPubDate(Map fields, PubDate pubDate) { if (pubDate.getYear() == null) { - //if year of the pubdate is null, the medlineDate shouldn't be null + // if year of the pubdate is null, the medlineDate shouldn't be null fields.put(StandardField.YEAR, extractYear(pubDate.getMedlineDate())); } else { fields.put(StandardField.YEAR, pubDate.getYear()); @@ -635,19 +635,19 @@ private void addPagination(Map fields, Pagination pagination) { if ("MedlinePgn".equals(element.getName().getLocalPart())) { putIfValueNotNull(fields, StandardField.PAGES, fixPageRange(element.getValue())); } else if ("StartPage".equals(element.getName().getLocalPart())) { - //it could happen, that the article has only a start page + // it could happen, that the article has only a start page startPage = element.getValue() + endPage; putIfValueNotNull(fields, StandardField.PAGES, startPage); } else if ("EndPage".equals(element.getName().getLocalPart())) { endPage = element.getValue(); - //but it should not happen, that a endpage appears without startpage + // but it should not happen, that a endpage appears without startpage fields.put(StandardField.PAGES, fixPageRange(startPage + "-" + endPage)); } } } private String extractYear(String medlineDate) { - //The year of the medlineDate should be the first 4 digits + // The year of the medlineDate should be the first 4 digits return medlineDate.substring(0, 4); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java index 4e911b1e8b2..1d6d49349e0 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java @@ -75,7 +75,7 @@ public boolean isRecognizedFormat(BufferedReader reader) throws IOException { public ParserResult importDatabase(BufferedReader reader) throws IOException { List bibitems = new ArrayList<>(); - //use optional here, so that no exception will be thrown if the file is empty + // use optional here, so that no exception will be thrown if the file is empty String linesAsString = reader.lines().reduce((line, nextline) -> line + "\n" + nextline).orElse(""); String[] entries = linesAsString.replace("\u2013", "-").replace("\u2014", "--").replace("\u2015", "--") @@ -146,7 +146,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } } - //store the fields in a map + // store the fields in a map Map hashMap = new HashMap<>(); hashMap.put("PG", StandardField.PAGES); hashMap.put("PL", StandardField.ADDRESS); @@ -172,7 +172,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { hashMap.put("OTO", new UnknownField("termowner")); hashMap.put("OWN", InternalField.OWNER); - //add the fields to hm + // add the fields to hm for (Map.Entry mapEntry : hashMap.entrySet()) { String medlineKey = mapEntry.getKey(); Field bibtexKey = mapEntry.getValue(); @@ -256,9 +256,9 @@ private EntryType addSourceType(String value, EntryType type) { private void addStandardNumber(Map hm, String lab, String value) { if ("IS".equals(lab)) { Field key = StandardField.ISSN; - //it is possible to have two issn, one for electronic and for print - //if there are two then it comes at the end in brackets (electronic) or (print) - //so search for the brackets + // it is possible to have two issn, one for electronic and for print + // if there are two then it comes at the end in brackets (electronic) or (print) + // so search for the brackets if (value.indexOf('(') > 0) { int keyStart = value.indexOf('('); int keyEnd = value.indexOf(')'); @@ -342,10 +342,10 @@ private void addTitles(Map hm, String lab, String val, EntryType private void addAbstract(Map hm, String lab, String value) { String abstractValue = ""; if ("AB".equals(lab)) { - //adds copyright information that comes at the end of an abstract + // adds copyright information that comes at the end of an abstract if (value.contains("Copyright")) { int copyrightIndex = value.lastIndexOf("Copyright"); - //remove the copyright from the field since the name of the field is copyright + // remove the copyright from the field since the name of the field is copyright String copyrightInfo = value.substring(copyrightIndex).replaceAll("Copyright ", ""); hm.put(new UnknownField("copyright"), copyrightInfo); abstractValue = value.substring(0, copyrightIndex); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java index b234fdf53a2..1055d692fba 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java @@ -101,7 +101,7 @@ public ParserResult importDatabase(BufferedReader input) throws IOException { } Unmarshaller unmarshaller = context.createUnmarshaller(); - //The unmarshalled object is a jaxbElement. + // The unmarshalled object is a jaxbElement. JAXBElement unmarshalledObject = (JAXBElement) unmarshaller.unmarshal(input); Optional collection = getElement(unmarshalledObject.getValue(), @@ -150,7 +150,7 @@ private void parseModsGroup(Map fields, List modsGroup, B for (Object groupElement : modsGroup) { - //Get the element. Only one of the elements should be not an empty optional. + // Get the element. Only one of the elements should be not an empty optional. Optional abstractDefinition = getElement(groupElement, AbstractDefinition.class); Optional genreDefinition = getElement(groupElement, GenreDefinition.class); Optional languageDefinition = getElement(groupElement, LanguageDefinition.class); @@ -165,7 +165,7 @@ private void parseModsGroup(Map fields, List modsGroup, B Optional identifierDefinition = getElement(groupElement, IdentifierDefinition.class); Optional titleInfoDefinition = getElement(groupElement, TitleInfoDefinition.class); - //Now parse the information if the element is present + // Now parse the information if the element is present abstractDefinition .ifPresent(abstractDef -> putIfValueNotNull(fields, StandardField.ABSTRACT, abstractDef.getValue())); @@ -198,9 +198,9 @@ private void parseModsGroup(Map fields, List modsGroup, B } - //The element subject can appear more than one time, that's why the keywords has to be put out of the for loop + // The element subject can appear more than one time, that's why the keywords has to be put out of the for loop putIfListIsNotEmpty(fields, keywords, StandardField.KEYWORDS, this.keywordSeparator); - //same goes for authors and notes + // same goes for authors and notes putIfListIsNotEmpty(fields, authors, StandardField.AUTHOR, " and "); putIfListIsNotEmpty(fields, notes, StandardField.NOTE, ", "); @@ -224,7 +224,7 @@ private void parseIdentifier(Map fields, IdentifierDefinition ide if ("citekey".equals(type) && !entry.getCiteKeyOptional().isPresent()) { entry.setCiteKey(identifier.getValue()); } else if (!"local".equals(type) && !"citekey".equals(type)) { - //put all identifiers (doi, issn, isbn,...) except of local and citekey + // put all identifiers (doi, issn, isbn,...) except of local and citekey putIfValueNotNull(fields, FieldFactory.parseField(identifier.getType()), identifier.getValue()); } } @@ -319,10 +319,10 @@ private void parseRelatedModsGroup(Map fields, List relat List> numberOrCaptionOrTitle = detail .getNumberOrCaptionOrTitle(); - //In the for loop should only be the value of the element that belongs to the detail not be null + // In the for loop should only be the value of the element that belongs to the detail not be null for (JAXBElement jaxbElement : numberOrCaptionOrTitle) { StringPlusLanguage value = jaxbElement.getValue(); - //put details like volume, issue,... + // put details like volume, issue,... putIfValueNotNull(fields, FieldFactory.parseField(detail.getType()), value.getValue()); } } else if (object instanceof ExtentDefinition) { @@ -354,8 +354,8 @@ private void putPageInformation(ExtentDefinition extentDefinition, Map fields, String elementName, DateDefiniti switch (elementName) { case "dateIssued": - //The first 4 digits of dateIssued should be the year + // The first 4 digits of dateIssued should be the year fields.put(StandardField.YEAR, date.getValue().substring(0, 4)); break; case "dateCreated": - //If there was no year in date issued, then take the year from date created + // If there was no year in date issued, then take the year from date created fields.computeIfAbsent(StandardField.YEAR, k -> date.getValue().substring(0, 4)); fields.put(new UnknownField("created"), date.getValue()); break; @@ -436,13 +436,13 @@ private void handleAuthorsInNamePart(NameDefinition name, List authors, if ((type == null) && (namePart.getValue() != null)) { authors.add(namePart.getValue()); } else if ("family".equals(type) && (namePart.getValue() != null)) { - //family should come first, so if family appears we can set the author then comes before - //we have to check if forename and family name are not empty in case it's the first author + // family should come first, so if family appears we can set the author then comes before + // we have to check if forename and family name are not empty in case it's the first author if (!foreName.isEmpty() && !familyName.isEmpty()) { - //now set and add the old author + // now set and add the old author author = familyName + ", " + Joiner.on(" ").join(foreName); authors.add(author); - //remove old forenames + // remove old forenames foreName.clear(); } else if (foreName.isEmpty() && !familyName.isEmpty()) { authors.add(familyName); @@ -457,7 +457,7 @@ private void handleAuthorsInNamePart(NameDefinition name, List authors, } } - //last author is not added, so do it here + // last author is not added, so do it here if (!foreName.isEmpty() && !familyName.isEmpty()) { author = familyName + ", " + Joiner.on(" ").join(foreName); authors.add(author.trim()); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java index 791f40439a6..cb1034354bb 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java @@ -230,7 +230,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { */ private static String fixNames(String content) { String names; - if (content.indexOf(';') > 0) { //LN FN; [LN FN;]* + if (content.indexOf(';') > 0) { // LN FN; [LN FN;]* names = content.replaceAll("[^\\.A-Za-z,;\\- ]", "").replace(";", " and"); } else if (content.indexOf(" ") > 0) { String[] sNames = content.split(" "); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java index 79060c67918..afcf25d5a1a 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java @@ -232,7 +232,7 @@ public ParserResult importDatabase(Path filePath, Charset defaultEncoding) { return new ParserResult(result); } - //make this method package visible so we can test it + // make this method package visible so we can test it Optional getEntryFromPDFContent(String firstpageContents, String lineSeparator) { // idea: split[] contains the different lines @@ -248,7 +248,7 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS lines = firstpageContentsUnifiedLineBreaks.split(lineSeparator); - lineIndex = 0; //to prevent array index out of bounds exception on second run we need to reset i to zero + lineIndex = 0; // to prevent array index out of bounds exception on second run we need to reset i to zero proceedToNextNonEmptyLine(); if (lineIndex >= lines.length) { @@ -300,7 +300,7 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS fillCurStringWithNonEmptyLines(); title = streamlineTitle(curString); curString = ""; - //i points to the next non-empty line + // i points to the next non-empty line // after title: authors author = null; @@ -391,9 +391,9 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS editor = streamlineNames(curString.substring(0, pos - 1)); int edslength = "(Eds.)".length(); - int posWithEditor = pos + edslength + 2;//+2 because of ":" after (Eds.) and the subsequent space + int posWithEditor = pos + edslength + 2; // +2 because of ":" after (Eds.) and the subsequent space if (posWithEditor > curString.length()) { - curString = curString.substring(posWithEditor - 2); //we don't have any spaces after Eds so we substract the 2 + curString = curString.substring(posWithEditor - 2); // we don't have any spaces after Eds so we substract the 2 } else { curString = curString.substring(posWithEditor); } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java index 218e52d9260..9aa1d53ca9f 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java @@ -21,7 +21,6 @@ public class PdfXmpImporter extends Importer { private final XmpPreferences xmpPreferences; - public PdfXmpImporter(XmpPreferences xmpPreferences) { this.xmpPreferences = xmpPreferences; } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java index 550972ea591..2e4d753c708 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java @@ -149,7 +149,6 @@ public class RepecNepImporter extends Importer { private String preLine = ""; private boolean inOverviewSection; - public RepecNepImporter(ImportFormatPreferences importFormatPreferences) { this.importFormatPreferences = importFormatPreferences; } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java index 5c941f75fcb..59b896a2242 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -58,13 +58,13 @@ public boolean isRecognizedFormat(BufferedReader reader) throws IOException { public ParserResult importDatabase(BufferedReader reader) throws IOException { List bibitems = new ArrayList<>(); - //use optional here, so that no exception will be thrown if the file is empty + // use optional here, so that no exception will be thrown if the file is empty String linesAsString = reader.lines().reduce((line, nextline) -> line + "\n" + nextline).orElse(""); String[] entries = linesAsString.replace("\u2013", "-").replace("\u2014", "--").replace("\u2015", "--") .split("ER -.*\\n"); - //stores all the date tags from highest to lowest priority + // stores all the date tags from highest to lowest priority List dateTags = Arrays.asList("Y1", "PY", "DA", "Y2"); for (String entry1 : entries) { @@ -141,10 +141,10 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { } else if ("BT".equals(tag)) { fields.put(StandardField.BOOKTITLE, value); } else if (("T2".equals(tag) || "J2".equals(tag) || "JA".equals(tag)) && ((fields.get(StandardField.JOURNAL) == null) || "".equals(fields.get(StandardField.JOURNAL)))) { - //if there is no journal title, then put second title as journal title + // if there is no journal title, then put second title as journal title fields.put(StandardField.JOURNAL, value); } else if ("JO".equals(tag) || "J1".equals(tag) || "JF".equals(tag)) { - //if this field appears then this should be the journal title + // if this field appears then this should be the journal title fields.put(StandardField.JOURNAL, value); } else if ("T3".equals(tag)) { fields.put(StandardField.SERIES, value); @@ -211,12 +211,12 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { try { Year.parse(year, formatter); - //if the year is parsebale we have found a higher priority date + // if the year is parsebale we have found a higher priority date dateTag = tag; dateValue = value; datePriority = tagPriority; } catch (DateTimeParseException ex) { - //We can't parse the year, we ignore it + // We can't parse the year, we ignore it } } } else if ("KW".equals(tag)) { @@ -244,9 +244,9 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { fields.put(StandardField.EPRINTTYPE, "pubmed"); } else if ("TA".equals(tag)) { fields.put(StandardField.TRANSLATOR, value); - } + // fields for which there is no direct mapping in the bibtext standard - else if ("AV".equals(tag)) { + } else if ("AV".equals(tag)) { fields.put(new UnknownField("archive_location"), value); } else if ("CN".equals(tag) || "VO".equals(tag)) { fields.put(new UnknownField("call-number"), value); diff --git a/src/main/java/org/jabref/logic/importer/util/GrobidService.java b/src/main/java/org/jabref/logic/importer/util/GrobidService.java index e7dc450724e..48e0316a7db 100644 --- a/src/main/java/org/jabref/logic/importer/util/GrobidService.java +++ b/src/main/java/org/jabref/logic/importer/util/GrobidService.java @@ -51,7 +51,7 @@ public String processCitation(String rawCitation, ConsolidateCitations consolida urlDownload.setPostData("citations=" + rawCitation + "&consolidateCitations=" + consolidateCitations); String httpResponse = urlDownload.asString(); - if (httpResponse == null || httpResponse.equals("@misc{-1,\n\n}\n")) { //This filters empty BibTeX entries + if (httpResponse == null || httpResponse.equals("@misc{-1,\n\n}\n")) { // This filters empty BibTeX entries throw new IOException("The GROBID server response does not contain anything."); } diff --git a/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java b/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java index 580eb8e82d3..83f49759bd0 100644 --- a/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java +++ b/src/main/java/org/jabref/logic/importer/util/INSPIREBibtexFilterReader.java @@ -25,7 +25,6 @@ public class INSPIREBibtexFilterReader extends FilterReader { private boolean pre; - public INSPIREBibtexFilterReader(final Reader initialReader) { super(initialReader); inReader = new BufferedReader(initialReader); diff --git a/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java b/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java index a74745f0021..4c39290c0de 100644 --- a/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java +++ b/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java @@ -15,9 +15,7 @@ import org.apache.http.client.utils.URIBuilder; /** - * Class for obtaining shortened DOI names. - * - * @see 'https://shortdoi.org' + * Class for obtaining shortened DOI names. See https://shortdoi.org. */ public class ShortDOIService { diff --git a/src/main/java/org/jabref/logic/integrity/BracesCorrector.java b/src/main/java/org/jabref/logic/integrity/BracesCorrector.java index 75d59fb5bee..5535fdf3ebc 100644 --- a/src/main/java/org/jabref/logic/integrity/BracesCorrector.java +++ b/src/main/java/org/jabref/logic/integrity/BracesCorrector.java @@ -6,7 +6,6 @@ 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) { diff --git a/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java b/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java index 3a7cafd5422..a1197beb7cb 100644 --- a/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java +++ b/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java @@ -18,7 +18,6 @@ public class EntryLinkChecker implements Checker { private final BibDatabase database; - public EntryLinkChecker(BibDatabase database) { this.database = Objects.requireNonNull(database); } diff --git a/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java b/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java index 1406e3641a5..75e358732fa 100644 --- a/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java +++ b/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java @@ -15,7 +15,6 @@ public class HowPublishedChecker implements ValueChecker { private final BibDatabaseContext databaseContext; - public HowPublishedChecker(BibDatabaseContext databaseContext) { this.databaseContext = Objects.requireNonNull(databaseContext); } @@ -32,7 +31,7 @@ public Optional checkValue(String value) { return Optional.empty(); } - //BibTeX + // BibTeX if (!databaseContext.isBiblatexMode() && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } diff --git a/src/main/java/org/jabref/logic/integrity/MonthChecker.java b/src/main/java/org/jabref/logic/integrity/MonthChecker.java index 402fbf65f66..d0140ee3803 100644 --- a/src/main/java/org/jabref/logic/integrity/MonthChecker.java +++ b/src/main/java/org/jabref/logic/integrity/MonthChecker.java @@ -19,7 +19,6 @@ public class MonthChecker implements ValueChecker { private final BibDatabaseContext bibDatabaseContextMonth; - public MonthChecker(BibDatabaseContext bibDatabaseContext) { this.bibDatabaseContextMonth = Objects.requireNonNull(bibDatabaseContext); } @@ -38,13 +37,13 @@ public Optional checkValue(String value) { return Optional.empty(); } - //biblatex + // biblatex if (bibDatabaseContextMonth.isBiblatexMode() && !(ONLY_AN_INTEGER.test(value.trim()) || MONTH_NORMALIZED.test(value.trim()))) { return Optional.of(Localization.lang("should be an integer or normalized")); } - //BibTeX + // BibTeX if (!bibDatabaseContextMonth.isBiblatexMode() && !MONTH_NORMALIZED.test(value.trim())) { return Optional.of(Localization.lang("should be normalized")); } diff --git a/src/main/java/org/jabref/logic/integrity/NoteChecker.java b/src/main/java/org/jabref/logic/integrity/NoteChecker.java index e6cdc6e6ba3..db80442d1e9 100644 --- a/src/main/java/org/jabref/logic/integrity/NoteChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoteChecker.java @@ -15,7 +15,6 @@ public class NoteChecker implements ValueChecker { private final BibDatabaseContext bibDatabaseContextEdition; - public NoteChecker(BibDatabaseContext bibDatabaseContext) { this.bibDatabaseContextEdition = Objects.requireNonNull(bibDatabaseContext); } @@ -32,7 +31,7 @@ public Optional checkValue(String value) { return Optional.empty(); } - //BibTeX + // BibTeX if (!bibDatabaseContextEdition.isBiblatexMode() && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } diff --git a/src/main/java/org/jabref/logic/l10n/Language.java b/src/main/java/org/jabref/logic/l10n/Language.java index 45c565714a3..b0b598a4b80 100644 --- a/src/main/java/org/jabref/logic/l10n/Language.java +++ b/src/main/java/org/jabref/logic/l10n/Language.java @@ -21,7 +21,7 @@ public enum Language { DUTCH("Nederlands", "nl"), NORWEGIAN("Norsk", "no"), PERSIAN("Persian (فارسی)", "fa"), - PORTUGUESE("Português","pt"), + PORTUGUESE("Português", "pt"), RUSSIAN("Russian", "ru"), SIMPLIFIED_CHINESE("Simplified Chinese", "zh"), SVENSKA("Svenska", "sv"), @@ -42,7 +42,7 @@ public enum Language { public static Optional convertToSupportedLocale(Language language) { Objects.requireNonNull(language); - //Very important to split languages like pt_BR into two parts, because otherwise the country would be treated lowercase and create problems in loading + // Very important to split languages like pt_BR into two parts, because otherwise the country would be treated lowercase and create problems in loading String[] languageParts = language.getId().split("_"); Locale locale; if (languageParts.length == 1) { diff --git a/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java b/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java index 1a40052b4f1..44e67a312f7 100644 --- a/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java +++ b/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java @@ -11,7 +11,6 @@ public abstract class AbstractParamLayoutFormatter implements ParamLayoutFormatt private static final char SEPARATOR = ','; - protected AbstractParamLayoutFormatter() { } diff --git a/src/main/java/org/jabref/logic/layout/LayoutHelper.java b/src/main/java/org/jabref/logic/layout/LayoutHelper.java index dde7ad47e24..ccdd6385435 100644 --- a/src/main/java/org/jabref/logic/layout/LayoutHelper.java +++ b/src/main/java/org/jabref/logic/layout/LayoutHelper.java @@ -37,7 +37,6 @@ public class LayoutHelper { private final LayoutFormatterPreferences prefs; private boolean endOfFile; - public LayoutHelper(Reader in, LayoutFormatterPreferences prefs) { this.in = new PushbackReader(Objects.requireNonNull(in)); this.prefs = Objects.requireNonNull(prefs); @@ -178,10 +177,9 @@ private void doBracketedOptionField() throws IOException { // changed section begin - arudert // keep the backslash so we know wether this is a fieldname or an ordinary parameter - //if (c != '\\') - //{ + // if (c != '\\') { buffer.append((char) c); - //} + // } // changed section end - arudert } diff --git a/src/main/java/org/jabref/logic/layout/StringInt.java b/src/main/java/org/jabref/logic/layout/StringInt.java index eb6b3fe0bf3..0078e2a2e63 100644 --- a/src/main/java/org/jabref/logic/layout/StringInt.java +++ b/src/main/java/org/jabref/logic/layout/StringInt.java @@ -15,7 +15,6 @@ public class StringInt implements java.io.Serializable { */ public final int i; - /** * Constructor for the StringInt object * diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java b/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java index 110315b2895..f2ff504b7aa 100644 --- a/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java +++ b/src/main/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacer.java @@ -8,9 +8,6 @@ */ public class AuthorAndsCommaReplacer implements LayoutFormatter { - /* (non-Javadoc) - * @see org.jabref.export.layout.LayoutFormatter#format(java.lang.String) - */ @Override public String format(String fieldText) { @@ -19,7 +16,7 @@ public String format(String fieldText) { switch (authors.length) { case 1: - //Does nothing; + // Does nothing s = authors[0]; break; case 2: diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java b/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java index 52531b47466..a2826c7798e 100644 --- a/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java +++ b/src/main/java/org/jabref/logic/layout/format/AuthorAndsReplacer.java @@ -18,7 +18,7 @@ public String format(String fieldText) { return null; } String[] authors = fieldText.split(" and "); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF String s = switch (authors.length) { case 1 -> authors[0]; // just no action case 2 -> authors[0] + " & " + authors[1]; @@ -33,7 +33,7 @@ public String format(String fieldText) { yield sb.toString(); } }; - //CHECKSTYLE:ON + // CHECKSTYLE:ON return s; diff --git a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java b/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java index 477dda33942..afd96ff63d4 100644 --- a/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java +++ b/src/main/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommas.java @@ -8,8 +8,9 @@ *
  • Names are given in order: von last, jr, first.
  • *
  • First names will NOT be abbreviated.
  • *
  • Individual authors are separated by commas.
  • - *
  • The 'and' of a list of three or more authors is preceeded by a comma - * (Oxford comma)
  • + *
  • The 'and' of a list of three or more authors is preceded by a comma + * (Oxford comma) + * */ public class AuthorLastFirstOxfordCommas implements LayoutFormatter { diff --git a/src/main/java/org/jabref/logic/layout/format/Authors.java b/src/main/java/org/jabref/logic/layout/format/Authors.java index b1514623c87..92ff6c6e8a2 100644 --- a/src/main/java/org/jabref/logic/layout/format/Authors.java +++ b/src/main/java/org/jabref/logic/layout/format/Authors.java @@ -155,11 +155,10 @@ private void handleArgument(String key, String value) { abbrDots = false; lastFirstSeparator = ", "; } - } + } else if (Authors.SEPARATORS.contains(key.trim().toLowerCase(Locale.ROOT)) || Authors.LAST_SEPARATORS.contains(key.trim().toLowerCase(Locale.ROOT))) { + // AuthorSep = [Comma | And | Colon | Semicolon | sep=] + // AuthorLastSep = [And | Comma | Colon | Semicolon | Amp | Oxford | lastsep=] - // AuthorSep = [Comma | And | Colon | Semicolon | sep=] - // AuthorLastSep = [And | Comma | Colon | Semicolon | Amp | Oxford | lastsep=] - else if (Authors.SEPARATORS.contains(key.trim().toLowerCase(Locale.ROOT)) || Authors.LAST_SEPARATORS.contains(key.trim().toLowerCase(Locale.ROOT))) { if (comp(key, "Comma")) { if (setSep) { lastSeparator = Authors.COMMA; @@ -275,8 +274,6 @@ private void addSingleName(StringBuilder sb, Author a, boolean firstFirst) { String abbr = firstNameResult; firstNameResult = a.getFirst().get(); int index = firstNameResult.indexOf(' '); - //System.out.println(firstNamePart); - //System.out.println(index); if (index >= 0) { firstNameResult = firstNameResult.substring(0, index + 1); if (abbr.length() > 3) { diff --git a/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java b/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java index 4f683dfa740..5126872663b 100644 --- a/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java +++ b/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java @@ -9,13 +9,11 @@ /** * A layout formatter that is the composite of the given Formatters executed in * order. - * */ public class CompositeFormat implements LayoutFormatter { private final List formatters; - /** * If called with this constructor, this formatter does nothing. */ diff --git a/src/main/java/org/jabref/logic/layout/format/CreateDocBook4Editors.java b/src/main/java/org/jabref/logic/layout/format/CreateDocBook4Editors.java index 86830860e58..26803d4904f 100644 --- a/src/main/java/org/jabref/logic/layout/format/CreateDocBook4Editors.java +++ b/src/main/java/org/jabref/logic/layout/format/CreateDocBook4Editors.java @@ -11,7 +11,7 @@ public class CreateDocBook4Editors implements LayoutFormatter { @Override public String format(String fieldText) { - // L.Xue + // L.Xue StringBuilder sb = new StringBuilder(100); AuthorList al = AuthorList.parse(fieldText); DocBookAuthorFormatter formatter = new DocBookAuthorFormatter(); diff --git a/src/main/java/org/jabref/logic/layout/format/CreateDocBook5Editors.java b/src/main/java/org/jabref/logic/layout/format/CreateDocBook5Editors.java index 79df2cff342..c98e256d733 100644 --- a/src/main/java/org/jabref/logic/layout/format/CreateDocBook5Editors.java +++ b/src/main/java/org/jabref/logic/layout/format/CreateDocBook5Editors.java @@ -11,7 +11,7 @@ public class CreateDocBook5Editors implements LayoutFormatter { @Override public String format(String fieldText) { - // L.Xue + // L.Xue StringBuilder sb = new StringBuilder(100); AuthorList al = AuthorList.parse(fieldText); DocBookAuthorFormatter formatter = new DocBookAuthorFormatter(); diff --git a/src/main/java/org/jabref/logic/layout/format/HTMLChars.java b/src/main/java/org/jabref/logic/layout/format/HTMLChars.java index 5961d5c7f76..fb2eeb3cfbb 100644 --- a/src/main/java/org/jabref/logic/layout/format/HTMLChars.java +++ b/src/main/java/org/jabref/logic/layout/format/HTMLChars.java @@ -81,7 +81,7 @@ public String format(String inField) { incommand = false; escaped = false; } else { - // Are we already at the end of the string? + // Are we already at the end of the string? if ((i + 1) == field.length()) { String command = currentCommand.toString(); String result = HTML_CHARS.get(command); diff --git a/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java b/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java index b00b69bdb72..cf1f05ddae2 100644 --- a/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java +++ b/src/main/java/org/jabref/logic/layout/format/Iso690FormatDate.java @@ -1,28 +1,28 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; +import org.jabref.model.strings.StringUtil; public class Iso690FormatDate implements LayoutFormatter { @Override public String format(String s) { - - if (s == null || s.trim().isEmpty()) { + if (StringUtil.isBlank(s)) { return ""; } StringBuilder sb = new StringBuilder(); String[] date = s.split("de"); - //parte el string en los distintos campos de la fecha - if (date.length == 1) { //sólo pone el año + // parte el string en los distintos campos de la fecha + if (date.length == 1) { // sólo pone el año sb.append(date[0].trim()); - } else if (date.length == 2) { //primer campo mes, segundo campo año - //cambiamos al formato año - mes + } else if (date.length == 2) { // primer campo mes, segundo campo año + // cambiamos al formato año - mes sb.append(date[1].trim()).append('-').append(date[0].trim()); } else if (date.length == 3) { - //primer campo día, segundo campo mes y tercer campo año + // primer campo día, segundo campo mes y tercer campo año // cambiamos al formato año-mes-día sb.append(date[2].trim()).append('-').append(date[1].trim()).append('-').append(date[0].trim()); } - return sb.toString();//retorna el string creado con la fecha. + return sb.toString(); // retorna el string creado con la fecha. } } diff --git a/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java b/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java index 248f46eeded..99fb842f052 100644 --- a/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java +++ b/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java @@ -3,29 +3,29 @@ import java.util.Locale; import org.jabref.logic.layout.LayoutFormatter; +import org.jabref.model.strings.StringUtil; public class Iso690NamesAuthors implements LayoutFormatter { @Override public String format(String s) { - - if (s == null || s.trim().isEmpty()) { + if (StringUtil.isBlank(s)) { return ""; } StringBuilder sb = new StringBuilder(); String[] authors = s.split("and"); - //parte el string en los distintos autores + // parte el string en los distintos autores for (int i = 0; i < authors.length; i++) { - //parte el string author en varios campos, según el separador "," + // parte el string author en varios campos, según el separador "," String[] author = authors[i].split(","); // No separa apellidos y nombre con coma (,) if (author.length < 2) { // Caso 1: Nombre Apellidos - //parte el string author en varios campos, según el separador " " + // parte el string author en varios campos, según el separador " " author = authors[i].split(" "); - //declaramos y damos un valor para evitar problemas + // declaramos y damos un valor para evitar problemas String name; String surname; @@ -33,34 +33,34 @@ public String format(String s) { sb.append(author[0].trim().toUpperCase(Locale.ROOT)); } else if (author.length == 2) { // Caso 1.1: Nombre Apellido - //primer campo Nombre + // primer campo Nombre name = author[0].trim(); - //Segundo campo Apellido + // Segundo campo Apellido surname = author[1].trim().toUpperCase(Locale.ROOT); - //añadimos los campos modificados al string final + // añadimos los campos modificados al string final sb.append(surname); sb.append(", "); sb.append(name); } else if (author.length == 3) { // Caso 1.2: Nombre Apellido1 Apellido2 - //primer campo Nombre + // primer campo Nombre name = author[0].trim(); - //Segundo y tercer campo Apellido1 Apellido2 + // Segundo y tercer campo Apellido1 Apellido2 surname = author[1].trim().toUpperCase(Locale.ROOT) + ' ' + author[2].trim().toUpperCase(Locale.ROOT); - //añadimos los campos modificados al string final + // añadimos los campos modificados al string final sb.append(surname); sb.append(", "); sb.append(name); } else if (author.length == 4) { // Caso 1.3: Nombre SegundoNombre Apellido1 Apellido2 - //primer y segundo campo Nombre SegundoNombre + // primer y segundo campo Nombre SegundoNombre name = author[0].trim() + ' ' + author[1].trim(); - //tercer y cuarto campo Apellido1 Apellido2 + // tercer y cuarto campo Apellido1 Apellido2 surname = author[2].trim().toUpperCase(Locale.ROOT) + ' ' + author[3].trim().toUpperCase(Locale.ROOT); - //añadimos los campos modificados al string final + // añadimos los campos modificados al string final sb.append(surname); sb.append(", "); sb.append(name); @@ -71,17 +71,17 @@ public String format(String s) { String surname = author[0].trim().toUpperCase(Locale.ROOT); // campo 2 nombre String name = author[1].trim(); - //añadimos los campos modificados al string final + // añadimos los campos modificados al string final sb.append(surname); sb.append(", "); sb.append(name); } - if (i < authors.length - 2) { //si hay mas de 2 autores, lo separamos por ", " + if (i < authors.length - 2) { // si hay mas de 2 autores, lo separamos por ", " sb.append(", "); } else if (i == authors.length - 2) { // si hay 2 autores, lo separamos por " y " sb.append(" y "); } } - return sb.toString();//retorna el string creado de autores. + return sb.toString(); // retorna el string creado de autores. } } diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatter.java b/src/main/java/org/jabref/logic/layout/format/NameFormatter.java index e8830ad1c5b..feb043ef22f 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatter.java @@ -14,9 +14,9 @@ * * The formatter needs a parameter to be passed in that follows the following format: * - * @@""@@""@...@@ + * <case1>@<range11>@"<format>"@<range12>@"<format>"@<range13>...@@ * - * @@... and so on. + * <case2>@<range21>@... and so on. * * Individual cases are separated by @@ and items in a case by @. * @@ -29,7 +29,7 @@ * case2 = 3 * case3 = * * - * Ranges are either .., or the character * using a 1 based index for indexing + * Ranges are either <integer>..<integer>, <integer> or the character * using a 1 based index for indexing * authors from the given authorlist. Integer indexes can be negative to denote them to start from * the end of the list where -1 is the last author. * @@ -43,7 +43,7 @@ * * 2..-1 will affect Mary, Bruce and Arthur * - * The uses the Bibtex formatter format: + * The <format> uses the Bibtex formatter format: * * The four letter v, f, l, j indicate the name parts von, first, last, jr which * are used within curly braces. A single letter v, f, l, j indicates that the name should be abbreviated. diff --git a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java index ef509030eff..922bc12b2e0 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java @@ -7,7 +7,6 @@ public class NameFormatterPreferences { private final List nameFormatterKey; private final List nameFormatterValue; - public NameFormatterPreferences(List nameFormatterKey, List nameFormatterValue) { this.nameFormatterKey = nameFormatterKey; this.nameFormatterValue = nameFormatterValue; diff --git a/src/main/java/org/jabref/logic/layout/format/Ordinal.java b/src/main/java/org/jabref/logic/layout/format/Ordinal.java index 85290643e79..645dcae4236 100644 --- a/src/main/java/org/jabref/logic/layout/format/Ordinal.java +++ b/src/main/java/org/jabref/logic/layout/format/Ordinal.java @@ -23,14 +23,14 @@ public String format(String fieldText) { while (m.find()) { String result = m.group(1); int value = Integer.parseInt(result); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF String ordinalString = switch (value) { case 1 -> "st"; case 2 -> "nd"; case 3 -> "rd"; default -> "th"; }; - //CHECKSTYLE:ON + // CHECKSTYLE:ON m.appendReplacement(sb, result + ordinalString); } m.appendTail(sb); diff --git a/src/main/java/org/jabref/logic/layout/format/RTFChars.java b/src/main/java/org/jabref/logic/layout/format/RTFChars.java index 85bfa75fd03..e68996dc5f8 100644 --- a/src/main/java/org/jabref/logic/layout/format/RTFChars.java +++ b/src/main/java/org/jabref/logic/layout/format/RTFChars.java @@ -42,9 +42,7 @@ public String format(String field) { if (escaped && (c == '\\')) { sb.append('\\'); escaped = false; - } - - else if (c == '\\') { + } else if (c == '\\') { escaped = true; incommand = true; currentCommand = new StringBuilder(); diff --git a/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java b/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java index 1c9cba82a1c..d66e016e3a0 100644 --- a/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java +++ b/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java @@ -219,7 +219,7 @@ public String format(String field) { * * https://sourceforge.net/tracker/index.php?func=detail&aid=1469903&group_id=92314&atid=600306 */ - sb.append(replaceStrings(flEntry.getLink()));//f.toURI().toString(); + sb.append(replaceStrings(flEntry.getLink())); // f.toURI().toString(); break; case FILE_EXTENSION: diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index de99ce6d919..e883908ae68 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -69,7 +69,7 @@ public static MSBibEntry convert(BibEntry entry) { result.journalName = entry.getFieldOrAliasLatexFree(StandardField.JOURNAL).orElse(null); // Value must be converted - //Currently only english is supported + // Currently only english is supported entry.getLatexFreeField(StandardField.LANGUAGE) .ifPresent(lang -> result.fields.put("LCID", String.valueOf(MSBibMapping.getLCID(lang)))); StringBuilder sbNumber = new StringBuilder(); @@ -120,12 +120,12 @@ public static MSBibEntry convert(BibEntry entry) { private static List getAuthors(BibEntry entry, String authors, Field field) { List result = new ArrayList<>(); boolean corporate = false; - //Only one corporate author is supported - //We have the possible rare case that are multiple authors which start and end with latex , this is currently not considered + // Only one corporate author is supported + // We have the possible rare case that are multiple authors which start and end with latex , this is currently not considered if (authors.startsWith("{") && authors.endsWith("}")) { corporate = true; } - //FIXME: #4152 This is an ugly hack because the latex2unicode formatter kills of all curly braces, so no more corporate author parsing possible + // FIXME: #4152 This is an ugly hack because the latex2unicode formatter kills of all curly braces, so no more corporate author parsing possible String authorLatexFree = entry.getLatexFreeField(field).orElse(""); if (corporate) { authorLatexFree = "{" + authorLatexFree + "}"; diff --git a/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java b/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java index b62bd47c24f..94defb646e3 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java @@ -38,7 +38,6 @@ public class MSBibDatabase { private Set entries; - /** * Creates a {@link MSBibDatabase} for import */ diff --git a/src/main/java/org/jabref/logic/msbib/MSBibEntry.java b/src/main/java/org/jabref/logic/msbib/MSBibEntry.java index d1ed681af58..80a814c6761 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibEntry.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibEntry.java @@ -78,7 +78,7 @@ class MSBibEntry { private final Pattern ADDRESS_PATTERN = Pattern.compile("\\b(\\w+)\\s?[,]?\\s?(\\w*)\\s?[,]?\\s?(\\w*)\\b"); public MSBibEntry() { - //empty + // empty } /** @@ -304,7 +304,7 @@ private void addField(Document document, Element parent, String name, String val parent.appendChild(elem); } - //Add authors for export + // Add authors for export private void addAuthor(Document document, Element allAuthors, String entryName, List authorsLst) { if (authorsLst == null) { return; diff --git a/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java b/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java index 0205c9113b3..5c9e02cb1de 100644 --- a/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java +++ b/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java @@ -134,6 +134,7 @@ public OOBibStyle(File styleFile, LayoutFormatterPreferences prefs, fromResource = false; path = styleFile.getPath(); } + public OOBibStyle(String resourcePath, LayoutFormatterPreferences prefs) throws IOException { this.prefs = Objects.requireNonNull(prefs); Objects.requireNonNull(resourcePath); diff --git a/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java b/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java index 61127acb12d..92c88e7ca4d 100644 --- a/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java +++ b/src/main/java/org/jabref/logic/openoffice/OOPreFormatter.java @@ -45,7 +45,7 @@ public String format(String field) { incommand = true; currentCommand = new StringBuilder(); } else if (!incommand && ((c == '{') || (c == '}'))) { - //Swallow braces, necessary for replacing encoded characters + // Swallow braces, necessary for replacing encoded characters } else if (Character.isLetter(c) || (c == '%') || StringUtil.SPECIAL_COMMAND_CHARS.contains(String.valueOf(c))) { @@ -83,7 +83,7 @@ public String format(String field) { incommand = false; escaped = false; } else { - // Are we already at the end of the string? + // Are we already at the end of the string? if ((i + 1) == finalResult.length()) { String command = currentCommand.toString(); String result = OOPreFormatter.CHARS.get(command); @@ -134,11 +134,10 @@ public String format(String field) { sb.append(Objects.requireNonNullElse(result, command)); sb.append(' '); } - } /* else if (c == '}') { - System.out.printf("com term by }: '%s'\n", currentCommand.toString()); - - argument = ""; - }*/ else { + } else if (c == '}') { + // System.out.printf("com term by }: '%s'\n", currentCommand.toString()); + // argument = ""; + } else { /* * TODO: this point is reached, apparently, if a command is * terminated in a strange way, such as with "$\omega$". diff --git a/src/main/java/org/jabref/logic/openoffice/OOUtil.java b/src/main/java/org/jabref/logic/openoffice/OOUtil.java index d3798b943a7..d45e0d3b321 100644 --- a/src/main/java/org/jabref/logic/openoffice/OOUtil.java +++ b/src/main/java/org/jabref/logic/openoffice/OOUtil.java @@ -210,7 +210,7 @@ public static void insertTextAtCurrentLocation(XText text, XTextCursor cursor, S if (formatting.contains(Formatting.SMALLCAPS)) { xCursorProps.setPropertyValue(CHAR_CASE_MAP, com.sun.star.style.CaseMap.SMALLCAPS); - } else { + } else { xCursorProps.setPropertyValue(CHAR_CASE_MAP, com.sun.star.style.CaseMap.NONE); } diff --git a/src/main/java/org/jabref/logic/openoffice/StyleLoader.java b/src/main/java/org/jabref/logic/openoffice/StyleLoader.java index b6e367a38f6..687a83a6c9b 100644 --- a/src/main/java/org/jabref/logic/openoffice/StyleLoader.java +++ b/src/main/java/org/jabref/logic/openoffice/StyleLoader.java @@ -83,7 +83,7 @@ private void loadExternalStyles() { for (String filename : lists) { try { OOBibStyle style = new OOBibStyle(new File(filename), layoutFormatterPreferences, encoding); - if (style.isValid()) { //Problem! + if (style.isValid()) { // Problem! externalStyles.add(style); } else { LOGGER.error(String.format("Style with filename %s is invalid", filename)); diff --git a/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java b/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java index 99ec460594c..c112e274bbd 100644 --- a/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java +++ b/src/main/java/org/jabref/logic/openoffice/UndefinedBibtexEntry.java @@ -11,7 +11,6 @@ public class UndefinedBibtexEntry extends BibEntry { private final String key; - public UndefinedBibtexEntry(String key) { this.key = key; setField(StandardField.AUTHOR, OOBibStyle.UNDEFINED_CITATION_MARKER); diff --git a/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java b/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java index 5f640d16271..99f0212d4a2 100644 --- a/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java +++ b/src/main/java/org/jabref/logic/openoffice/UndefinedParagraphFormatException.java @@ -8,7 +8,6 @@ public class UndefinedParagraphFormatException extends Exception { private final String formatName; - public UndefinedParagraphFormatException(String formatName) { super(); this.formatName = formatName; diff --git a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java index 0906d7ed2cf..731e7063864 100644 --- a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java @@ -47,7 +47,7 @@ public Map> importAnnotationsFromFiles(BibDatabaseCon Map> annotations = new HashMap<>(); AnnotationImporter importer = new PdfAnnotationImporter(); - //import annotationsOfFiles if the selected files are valid which is checked in getFilteredFileList() + // import annotationsOfFiles if the selected files are valid which is checked in getFilteredFileList() for (LinkedFile linkedFile : this.getFilteredFileList()) { linkedFile.findIn(databaseContext, filePreferences) .ifPresent(file -> annotations.put(file, importer.importAnnotations(file))); diff --git a/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java b/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java index 22a2e7cb872..86a3c29b53f 100644 --- a/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java +++ b/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java @@ -18,10 +18,10 @@ public class FileAnnotationCache { private static final Logger LOGGER = LoggerFactory.getLogger(FileAnnotation.class); - //cache size in entries + // cache size in entries private final static int CACHE_SIZE = 10; - //the inner list holds the annotations per file, the outer collection maps this to a BibEntry. + // the inner list holds the annotations per file, the outer collection maps this to a BibEntry. private LoadingCache>> annotationCache; /** diff --git a/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java index 207bc2d31dd..eef7c2a55a2 100644 --- a/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java @@ -99,7 +99,7 @@ private FileAnnotation createMarkedAnnotations(int pageIndex, PDPage page, PDAnn } } - //Marked text that has a sticky note on it should be linked to the sticky note + // Marked text that has a sticky note on it should be linked to the sticky note return new FileAnnotation(annotation, pageIndex + 1, annotationBelongingToMarking); } diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java index dcec9014e5e..5293cc40f69 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java @@ -25,7 +25,6 @@ public class ProtectedTermsList implements Comparable { private final boolean internalList; private boolean enabled; - public ProtectedTermsList(String description, List termList, String location, boolean internalList) { this.description = Objects.requireNonNull(description); this.termsList = Objects.requireNonNull(termList); diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java index face86756e1..017680e0f5f 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java @@ -9,7 +9,6 @@ public class ProtectedTermsPreferences { private final List disabledInternalTermLists; private final List disabledExternalTermLists; - public ProtectedTermsPreferences(List enabledInternalTermLists, List enabledExternalTermLists, List disabledInternalTermLists, List disabledExternalTermLists) { this.enabledInternalTermLists = enabledInternalTermLists; diff --git a/src/main/java/org/jabref/logic/remote/RemotePreferences.java b/src/main/java/org/jabref/logic/remote/RemotePreferences.java index edda18d005c..084692ca5dd 100644 --- a/src/main/java/org/jabref/logic/remote/RemotePreferences.java +++ b/src/main/java/org/jabref/logic/remote/RemotePreferences.java @@ -11,7 +11,6 @@ public class RemotePreferences { private int port; private boolean useRemoteServer; - public RemotePreferences(int port, boolean useRemoteServer) { this.port = port; this.useRemoteServer = useRemoteServer; diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java index b0a4c6ebc29..9fb1935f720 100644 --- a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java +++ b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java @@ -24,7 +24,6 @@ public class RemoteListenerServer implements Runnable { private final MessageHandler messageHandler; private final ServerSocket serverSocket; - public RemoteListenerServer(MessageHandler messageHandler, int port) throws IOException { this.serverSocket = new ServerSocket(port, BACKLOG, RemotePreferences.getIpAddress()); this.messageHandler = messageHandler; diff --git a/src/main/java/org/jabref/logic/remote/shared/Protocol.java b/src/main/java/org/jabref/logic/remote/shared/Protocol.java index 446690059ad..27442ab571c 100644 --- a/src/main/java/org/jabref/logic/remote/shared/Protocol.java +++ b/src/main/java/org/jabref/logic/remote/shared/Protocol.java @@ -24,7 +24,6 @@ public class Protocol implements AutoCloseable { private final ObjectOutputStream out; private final ObjectInputStream in; - public Protocol(Socket socket) throws IOException { this.socket = socket; this.out = new ObjectOutputStream(socket.getOutputStream()); diff --git a/src/main/java/org/jabref/logic/shared/OracleProcessor.java b/src/main/java/org/jabref/logic/shared/OracleProcessor.java index f4fd183a1d3..5910e65f896 100644 --- a/src/main/java/org/jabref/logic/shared/OracleProcessor.java +++ b/src/main/java/org/jabref/logic/shared/OracleProcessor.java @@ -29,7 +29,6 @@ public class OracleProcessor extends DBMSProcessor { private DatabaseChangeRegistration databaseChangeRegistration; - public OracleProcessor(DatabaseConnection connection) { super(connection); } @@ -169,7 +168,8 @@ protected void insertIntoFieldTable(List bibEntries) { fieldsCompleted += 1; } } - preparedFieldStatement.executeUpdate(); } + preparedFieldStatement.executeUpdate(); + } } catch (SQLException e) { LOGGER.error("SQL Error: ", e); } diff --git a/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java b/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java index ad53d54fd3b..061c8f09569 100644 --- a/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java +++ b/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java @@ -92,7 +92,7 @@ String escape(String expression) { @Override public void startNotificationListener(DBMSSynchronizer dbmsSynchronizer) { // Disable cleanup output of ThreadedHousekeeper - //Logger.getLogger(ThreadedHousekeeper.class.getName()).setLevel(Level.SEVERE); + // Logger.getLogger(ThreadedHousekeeper.class.getName()).setLevel(Level.SEVERE); try { connection.createStatement().execute("LISTEN jabrefLiveUpdate"); // Do not use `new PostgresSQLNotificationListener(...)` as the object has to exist continuously! diff --git a/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java b/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java index 8661734e6e3..0b91566a9ab 100644 --- a/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java +++ b/src/main/java/org/jabref/logic/shared/exception/OfflineLockException.java @@ -11,7 +11,6 @@ public class OfflineLockException extends Exception { private final BibEntry localBibEntry; private final BibEntry sharedBibEntry; - public OfflineLockException(BibEntry localBibEntry, BibEntry sharedBibEntry) { super("Local BibEntry data is not up-to-date."); this.localBibEntry = localBibEntry; diff --git a/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java b/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java index 1ac90d4ed13..79ea2d3b02e 100644 --- a/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java +++ b/src/main/java/org/jabref/logic/shared/exception/SharedEntryNotPresentException.java @@ -9,7 +9,6 @@ public class SharedEntryNotPresentException extends Exception { private final BibEntry nonPresentBibEntry; - public SharedEntryNotPresentException(BibEntry nonPresentbibEntry) { super("Required BibEntry is not present on shared database."); this.nonPresentBibEntry = nonPresentbibEntry; diff --git a/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java b/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java index eecaa0e9cc5..51aec6ddaaa 100644 --- a/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java +++ b/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java @@ -12,7 +12,6 @@ public class OracleNotificationListener implements DatabaseChangeListener { private final DBMSSynchronizer dbmsSynchronizer; - public OracleNotificationListener(DBMSSynchronizer dbmsSynchronizer) { this.dbmsSynchronizer = dbmsSynchronizer; } diff --git a/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java b/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java index 77a3d6d9128..96b8b7ccaf6 100644 --- a/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java +++ b/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java @@ -25,11 +25,12 @@ public PostgresSQLNotificationListener(DBMSSynchronizer dbmsSynchronizer, PGConn this.dbmsSynchronizer = dbmsSynchronizer; this.pgConnection = pgConnection; } + @Override public void run() { stop = false; try { - //noinspection InfiniteLoopStatement + // noinspection InfiniteLoopStatement while (!stop) { PGNotification notifications[] = pgConnection.getNotifications(); diff --git a/src/main/java/org/jabref/logic/shared/security/Password.java b/src/main/java/org/jabref/logic/shared/security/Password.java index 50ebab42e01..f637677bc39 100644 --- a/src/main/java/org/jabref/logic/shared/security/Password.java +++ b/src/main/java/org/jabref/logic/shared/security/Password.java @@ -23,7 +23,6 @@ public class Password { private final SecretKeySpec secretKey; private final IvParameterSpec ivSpec; - /** * @param phrase Phrase which should be encrypted or decrypted * @param key Key which is used to improve symmetric encryption diff --git a/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java b/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java index 30040d513f3..c2a1896d50e 100644 --- a/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java +++ b/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java @@ -11,7 +11,6 @@ public class UndoChangeEvent { private final boolean canRedo; private final String redoDescription; - public UndoChangeEvent(boolean canUndo, String undoDescription, boolean canRedo, String redoDescription) { this.canUndo = canUndo; this.undoDescription = undoDescription; diff --git a/src/main/java/org/jabref/logic/util/io/FileUtil.java b/src/main/java/org/jabref/logic/util/io/FileUtil.java index 1a489720431..58d64fe984e 100644 --- a/src/main/java/org/jabref/logic/util/io/FileUtil.java +++ b/src/main/java/org/jabref/logic/util/io/FileUtil.java @@ -266,7 +266,7 @@ public static String createFileNameFromPattern(BibDatabase database, BibEntry en targetName = entry.getCiteKeyOptional().orElse("default"); } - //Removes illegal characters from filename + // Removes illegal characters from filename targetName = FileNameCleaner.cleanFileName(targetName); return targetName; } @@ -286,7 +286,7 @@ public static String createDirNameFromPattern(BibDatabase database, BibEntry ent targetName = entry.getCiteKeyOptional().orElse("default"); } - //Removes illegal characters from filename + // Removes illegal characters from filename targetName = FileNameCleaner.cleanDirectoryName(targetName); return targetName; } diff --git a/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java b/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java index ac4b78c0857..2f07045fdf4 100644 --- a/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java +++ b/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java @@ -571,8 +571,8 @@ public class HTMLUnicodeConversionMaps { {"316", "", "{\\c{l}}"}, // small l with cedilla {"317", "", "{{\\v{L}}}"}, // capital L with caron {"318", "", "{\\v{l}}"}, // small l with caron - //{"319", "Lmidot", "{\\Lmidot}"}, // upper case L with mid dot - //{"320", "lmidot", "{\\lmidot}"}, // lower case l with mid dot + // {"319", "Lmidot", "{\\Lmidot}"}, // upper case L with mid dot + // {"320", "lmidot", "{\\lmidot}"}, // lower case l with mid dot {"321", "Lstrok", "{{\\L}}"}, // upper case L with stroke {"322", "lstrok", "{{\\l}}"}, // lower case l with stroke {"323", "Nacute", "{{\\'{N}}}"}, // upper case N with acute @@ -669,8 +669,8 @@ public class HTMLUnicodeConversionMaps { {"733", "dblac", "{{\\H{}}}"}, // Double acute {"949", "epsi", "$\\epsilon$"}, // Epsilon - double check {"1013", "epsiv", "$\\varepsilonup$"}, // lunate epsilon, requires txfonts - //{"1055", "", "{{\\cyrchar\\CYRP}}"}, // Cyrillic capital Pe - //{"1082", "", "{\\cyrchar\\cyrk}"}, // Cyrillic small Ka + // {"1055", "", "{{\\cyrchar\\CYRP}}"}, // Cyrillic capital Pe + // {"1082", "", "{\\cyrchar\\cyrk}"}, // Cyrillic small Ka // {"2013", "", ""}, // NKO letter FA -- Maybe en dash = 0x2013? // {"2014", "", ""}, // NKO letter FA -- Maybe em dash = 0x2014? {"8192", "", "\\hspace{0.5em}"}, // en quad @@ -745,7 +745,7 @@ public class HTMLUnicodeConversionMaps { {"8897", "xvee", "$\\bigvee$"}, // Big vee {"8942", "vdots", "$\\vdots$"}, // vertical ellipsis U+22EE {"8943", "cdots", "$\\cdots$"}, // midline horizontal ellipsis U+22EF - /*{"8944", "", "$\\ddots$"}, // up right diagonal ellipsis U+22F0 */ + /* {"8944", "", "$\\ddots$"}, // up right diagonal ellipsis U+22F0 */ {"8945", "ddots", "$\\ddots$"}, // down right diagonal ellipsis U+22F1 {"9426", "circledc", "{\\copyright}"}, // circled small letter C diff --git a/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java b/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java index 8c27e745dd4..a2c2eae60bf 100644 --- a/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java +++ b/src/main/java/org/jabref/logic/util/strings/QuotedStringTokenizer.java @@ -12,7 +12,6 @@ public class QuotedStringTokenizer { private final char quoteChar; private int index; - /** * @param content * The String to be tokenized. diff --git a/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java b/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java index 87d8da6e329..21b744ded3d 100644 --- a/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java +++ b/src/main/java/org/jabref/logic/util/strings/RtfCharMap.java @@ -6,7 +6,7 @@ public class RtfCharMap { private HashMap rtfMap = new HashMap<>(); - public RtfCharMap () { + public RtfCharMap() { put("`a", "\\'e0"); put("`e", "\\'e8"); put("`i", "\\'ec"); @@ -54,8 +54,8 @@ public RtfCharMap () { put("S", "\\u167S"); // Section sign put("`!", "\\u161!"); // Inverted exclamation point - put("pounds","\\u163?"); // Pound sign - put("copyright","\\u169?"); // Copyright sign + put("pounds", "\\u163?"); // Pound sign + put("copyright", "\\u169?"); // Copyright sign put("P", "\\u182P"); // Paragraph sign put("`?", "\\u191?"); // Inverted question mark put("~A", "\\u195A"); // "Atilde" @@ -82,7 +82,7 @@ public RtfCharMap () { put("TH", "\\u222TH"); // "THORN" put("ss", "\\u223ss"); // "szlig" - //RTFCHARS.put("ss", "AFFEN"); // "szlig" + // RTFCHARS.put("ss", "AFFEN"); // "szlig" put("~a", "\\u227a"); // "atilde" put("aa", "\\u229a"); // "aring" diff --git a/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java b/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java index 77c54dec6b1..a5466c684d4 100644 --- a/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java +++ b/src/main/java/org/jabref/logic/util/strings/UnicodeLigaturesMap.java @@ -21,7 +21,7 @@ public UnicodeLigaturesMap() { put("\uA737", "au"); put("\uA738", "AV"); put("\uA739", "av"); - //AV, av with bar + // AV, av with bar put("\uA73A", "AV"); put("\uA73B", "av"); put("\uA73C", "AY"); diff --git a/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java b/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java index 2da12c692a3..7f13068dca2 100644 --- a/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java +++ b/src/main/java/org/jabref/logic/util/strings/XmlCharsMap.java @@ -15,7 +15,7 @@ public XmlCharsMap() { put("\\{\\\\\\\"\\{u\\}\\}", "ü"); put("\\{\\\\\\\"\\{U\\}\\}", "Ü"); - //next 2 rows were missing... + // next 2 rows were missing... put("\\{\\\\\\`\\{a\\}\\}", "à"); put("\\{\\\\\\`\\{A\\}\\}", "À"); @@ -28,7 +28,7 @@ public XmlCharsMap() { put("\\{\\\\\\`\\{u\\}\\}", "ù"); put("\\{\\\\\\`\\{U\\}\\}", "Ù"); - //corrected these 10 lines below... + // corrected these 10 lines below... put("\\{\\\\\\'\\{a\\}\\}", "á"); put("\\{\\\\\\'\\{A\\}\\}", "Á"); put("\\{\\\\\\'\\{e\\}\\}", "é"); @@ -39,7 +39,7 @@ public XmlCharsMap() { put("\\{\\\\\\'\\{O\\}\\}", "Ó"); put("\\{\\\\\\'\\{u\\}\\}", "ú"); put("\\{\\\\\\'\\{U\\}\\}", "Ú"); - //added next four chars... + // added next four chars... put("\\{\\\\\\'\\{c\\}\\}", "ć"); put("\\{\\\\\\'\\{C\\}\\}", "Ć"); put("\\{\\\\c\\{c\\}\\}", "ç"); @@ -55,7 +55,7 @@ public XmlCharsMap() { put("\\{\\\\\\\uFFFD\\{a\\}\\}", "á"); put("\\{\\\\\\\uFFFD\\{A\\}\\}", "Á"); - //next 2 rows were missing... + // next 2 rows were missing... put("\\{\\\\\\^\\{a\\}\\}", "â"); put("\\{\\\\\\^\\{A\\}\\}", "Â"); @@ -86,7 +86,7 @@ public XmlCharsMap() { put("\\{\\\\\\\"u\\}", "ü"); put("\\{\\\\\\\"U\\}", "Ü"); - //next 2 rows were missing... + // next 2 rows were missing... put("\\{\\\\\\`a\\}", "à"); put("\\{\\\\\\`A\\}", "À"); @@ -108,11 +108,11 @@ public XmlCharsMap() { put("\\{\\\\\\'U\\}", "Ú"); put("\\{\\\\\\'a\\}", "á"); put("\\{\\\\\\'A\\}", "Á"); - //added next two chars... + // added next two chars... put("\\{\\\\\\'c\\}", "ć"); put("\\{\\\\\\'C\\}", "Ć"); - //next two lines were wrong... + // next two lines were wrong... put("\\{\\\\\\^a\\}", "â"); put("\\{\\\\\\^A\\}", "Â"); diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java index 72eb8941436..1e37920ec3c 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java @@ -26,8 +26,8 @@ public class XmpUtilReader { private static final String END_TAG = ""; private XmpUtilReader() { - //See: https://pdfbox.apache.org/2.0/getting-started.html - System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); //To get higher rendering speed on java 8 oder 9 for images + // See: https://pdfbox.apache.org/2.0/getting-started.html + System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); // To get higher rendering speed on java 8 oder 9 for images } /** @@ -142,8 +142,7 @@ private static List getXmpMetadata(PDDocument document) throws IOEx * Loads the specified file with the basic pdfbox functionality and uses an empty string as default password. * * @param path The path to load. - * @return - * @throws IOException from the underlying {@link PDDocument#load(File)} + * @throws IOException from the underlying @link PDDocument#load(File) */ public static PDDocument loadWithAutomaticDecryption(Path path) throws IOException { // try to load the document diff --git a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java index 57d4b1de9e1..a938cb1859b 100644 --- a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java +++ b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java @@ -15,7 +15,7 @@ class CustomEntryTypePreferenceMigration { - //non-default preferences + // non-default preferences private static final String CUSTOM_TYPE_NAME = "customTypeName_"; private static final String CUSTOM_TYPE_REQ = "customTypeReq_"; private static final String CUSTOM_TYPE_OPT = "customTypeOpt_"; diff --git a/src/main/java/org/jabref/migrations/PreferencesMigrations.java b/src/main/java/org/jabref/migrations/PreferencesMigrations.java index 27f6c67fed3..e12dacfa316 100644 --- a/src/main/java/org/jabref/migrations/PreferencesMigrations.java +++ b/src/main/java/org/jabref/migrations/PreferencesMigrations.java @@ -189,7 +189,7 @@ private static void upgradeLabelPatternToBibtexKeyPattern(JabRefPreferences pref LOGGER.info("Upgraded old default key generator pattern '" + oldDefault + "' to new version."); } } - //Pref node already exists do not migrate from previous version + // Pref node already exists do not migrate from previous version if (mainPrefsNode.nodeExists(JabRefPreferences.BIBTEX_KEY_PATTERNS_NODE)) { return; } @@ -247,7 +247,7 @@ static void upgradeImportFileAndDirePatterns(JabRefPreferences prefs, Preference String[] newStylePatterns = new String[] {"[bibtexkey]", "[bibtexkey] - [title]"}; - String[] oldDisplayStylePattern = new String[] {"bibtexkey", "bibtexkey - title",}; + String[] oldDisplayStylePattern = new String[]{"bibtexkey", "bibtexkey - title"}; for (int i = 0; i < oldStylePatterns.length; i++) { migrateFileImportPattern(oldStylePatterns[i], newStylePatterns[i], prefs, mainPrefsNode); @@ -276,7 +276,7 @@ private static void upgradeKeyBindingsToJavaFX(JabRefPreferences prefs) { } private static void addCrossRefRelatedFieldsForAutoComplete(JabRefPreferences prefs) { - //LinkedHashSet because we want to retain the order and add new fields to the end + // LinkedHashSet because we want to retain the order and add new fields to the end Set keys = new LinkedHashSet<>(prefs.getStringList(JabRefPreferences.AUTOCOMPLETER_COMPLETE_FIELDS)); keys.add("crossref"); keys.add("related"); diff --git a/src/main/java/org/jabref/model/ChainNode.java b/src/main/java/org/jabref/model/ChainNode.java index 1423ebefb96..e5861937cb1 100644 --- a/src/main/java/org/jabref/model/ChainNode.java +++ b/src/main/java/org/jabref/model/ChainNode.java @@ -9,11 +9,11 @@ *

    * In usual implementations, nodes function as wrappers around a data object. Thus normally they have a value property * which allows access to the value stored in the node. - * In contrast to this approach, the ChainNode class is designed to be used as a base class which provides the + * In contrast to this approach, the ChainNode<T> class is designed to be used as a base class which provides the * tree traversing functionality via inheritance. *

    * Example usage: - * private class BasicChainNode extends ChainNode { + * private class BasicChainNode extends ChainNode<BasicChainNode> { * public BasicChainNode() { * super(BasicChainNode.class); * } @@ -36,7 +36,7 @@ public abstract class ChainNode> { /** * Constructs a chain node without parent and no child. * - * @param derivingClass class deriving from TreeNode. It should always be "T.class". + * @param derivingClass class deriving from TreeNode<T>. It should always be "T.class". * We need this parameter since it is hard to get this information by other means. */ public ChainNode(Class derivingClass) { diff --git a/src/main/java/org/jabref/model/TreeNode.java b/src/main/java/org/jabref/model/TreeNode.java index 1e30747ff28..883c0391e63 100644 --- a/src/main/java/org/jabref/model/TreeNode.java +++ b/src/main/java/org/jabref/model/TreeNode.java @@ -15,11 +15,11 @@ * Represents a node in a tree. *

    * Usually, tree nodes have a value property which allows access to the value stored in the node. - * In contrast to this approach, the TreeNode class is designed to be used as a base class which provides the + * In contrast to this approach, the TreeNode<T> class is designed to be used as a base class which provides the * tree traversing functionality via inheritance. *

    * Example usage: - * private class BasicTreeNode extends TreeNode { + * private class BasicTreeNode extends TreeNode<BasicTreeNode> { * public BasicTreeNode() { * super(BasicTreeNode.class); * } @@ -50,7 +50,7 @@ /** * Constructs a tree node without parent and no children. * - * @param derivingClass class deriving from TreeNode. It should always be "T.class". + * @param derivingClass class deriving from TreeNode<,T>. It should always be "T.class". * We need this parameter since it is hard to get this information by other means. */ public TreeNode(Class derivingClass) { @@ -424,7 +424,7 @@ public void removeChild(T child) { children.remove(child); child.setParent(null); - notifyAboutDescendantChange((T)this); + notifyAboutDescendantChange((T) this); } /** @@ -441,7 +441,7 @@ public void removeChild(int childIndex) { child.get().setParent(null); } - notifyAboutDescendantChange((T)this); + notifyAboutDescendantChange((T) this); } /** @@ -473,7 +473,7 @@ public T addChild(T child, int index) { child.setParent((T) this); children.add(index, child); - notifyAboutDescendantChange((T)this); + notifyAboutDescendantChange((T) this); return child; } diff --git a/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java b/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java index 82570f1e0af..32504f13a41 100644 --- a/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java +++ b/src/main/java/org/jabref/model/bibtexkeypattern/DatabaseBibtexKeyPattern.java @@ -8,7 +8,6 @@ public class DatabaseBibtexKeyPattern extends AbstractBibtexKeyPattern { private final GlobalBibtexKeyPattern globalBibtexKeyPattern; - public DatabaseBibtexKeyPattern(GlobalBibtexKeyPattern globalBibtexKeyPattern) { this.globalBibtexKeyPattern = globalBibtexKeyPattern; } diff --git a/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java b/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java index b0e43f0e756..3e9dd09e293 100644 --- a/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java +++ b/src/main/java/org/jabref/model/cleanup/FieldFormatterCleanups.java @@ -91,7 +91,7 @@ public List getAsStringList(String newline) { } private static String getMetaDataString(List actionList, String newline) { - //first, group all formatters by the field for which they apply + // first, group all formatters by the field for which they apply Map> groupedByField = new TreeMap<>(Comparator.comparing(Field::getName)); for (FieldFormatterCleanup cleanup : actionList) { Field key = cleanup.getField(); @@ -101,7 +101,7 @@ private static String getMetaDataString(List actionList, groupedByField.put(key, new ArrayList<>()); } - //add the formatter to the map if it is not already there + // add the formatter to the map if it is not already there List formattersForKey = groupedByField.get(key); if (!formattersForKey.contains(cleanup.getFormatter().getKey())) { formattersForKey.add(cleanup.getFormatter().getKey()); diff --git a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java index fb1a3688a01..3fa1f5745a5 100644 --- a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java +++ b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java @@ -10,6 +10,7 @@ public class BibDatabaseModeDetection { private BibDatabaseModeDetection() { } + /** * Tries to infer the database type by examining a BibDatabase database. * diff --git a/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java b/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java index 3229664ab16..3e6de8cb5d8 100644 --- a/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java +++ b/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java @@ -27,7 +27,7 @@ public EntriesAddedEvent(List bibEntries, BibEntry firstEntry, Entries } /** - * @param bibEntries List of BibEntry objects which are being added. + * @param bibEntries List of BibEntry objects which are being added. * @param location Location affected by this event */ public EntriesAddedEvent(List bibEntries, EntriesEventSource location) { diff --git a/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java b/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java index 666ca89aca0..64e98089ba9 100644 --- a/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java +++ b/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java @@ -14,14 +14,14 @@ public class EntriesRemovedEvent extends EntriesEvent { /** - * @param bibEntries List of BibEntry objects which are being removed. + * @param bibEntries List of BibEntry objects which are being removed. */ public EntriesRemovedEvent(List bibEntries) { super(bibEntries); } /** - * @param bibEntries List of BibEntry objects which are being removed. + * @param bibEntries List of BibEntry objects which are being removed. * @param location Location affected by this event */ public EntriesRemovedEvent(List bibEntries, EntriesEventSource location) { diff --git a/src/main/java/org/jabref/model/entry/AuthorList.java b/src/main/java/org/jabref/model/entry/AuthorList.java index 629fca34501..8499a466598 100644 --- a/src/main/java/org/jabref/model/entry/AuthorList.java +++ b/src/main/java/org/jabref/model/entry/AuthorList.java @@ -352,7 +352,7 @@ public Author getAuthor(int i) { /** * Returns the a list of Author objects. * - * @return the List object. + * @return the List<Author> object. */ public List getAuthors() { return authors; @@ -622,7 +622,7 @@ public int hashCode() { * Brown"

  • *
  • "John von Neumann and John Smith and Black Brown, Peter" ==> "John * von Neumann and John Smith and Peter Black Brown"
  • - * + * * * @return formatted list of authors. */ @@ -644,9 +644,9 @@ public String getAsFirstLastNamesWithAnd() { * is treated similarly if abbreviated in one case and not in another. This * form is not intended to be suitable for presentation, only for sorting. *

    - *

    *

      *
    • "John Smith" ==> "Smith, J.";
    • + *
    * * @return formatted list of authors */ diff --git a/src/main/java/org/jabref/model/entry/BibEntry.java b/src/main/java/org/jabref/model/entry/BibEntry.java index a7b87a31579..2f9ffec5133 100644 --- a/src/main/java/org/jabref/model/entry/BibEntry.java +++ b/src/main/java/org/jabref/model/entry/BibEntry.java @@ -68,7 +68,7 @@ public class BibEntry implements Cloneable { private final Map latexFreeFields = new ConcurrentHashMap<>(); /** - * Cache that stores the field as keyword lists (format ) + * Cache that stores the field as keyword lists (format <Field, Separator, Keyword list>) */ private final MultiKeyMap fieldsAsKeywords = new MultiKeyMap<>(); @@ -151,29 +151,39 @@ private Optional getSourceField(Field targetField, EntryType targetEntry, //// 2. Handle special field mappings if (((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.InBook)) || - ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.BookInBook)) || - ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.SuppBook)) || - ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.InBook)) || - ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.BookInBook)) || - ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.SuppBook))) { - if (targetField == StandardField.AUTHOR) { return Optional.of(StandardField.AUTHOR); } - if (targetField == StandardField.BOOKAUTHOR) { return Optional.of(StandardField.AUTHOR); } + ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.BookInBook)) || + ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.SuppBook)) || + ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.InBook)) || + ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.BookInBook)) || + ((sourceEntry == StandardEntryType.Book) && (targetEntry == StandardEntryType.SuppBook))) { + if (targetField == StandardField.AUTHOR) { + return Optional.of(StandardField.AUTHOR); + } + if (targetField == StandardField.BOOKAUTHOR) { + return Optional.of(StandardField.AUTHOR); + } } if (((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.Book)) || - ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.InBook)) || - ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.BookInBook)) || - ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.SuppBook)) || - ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.Collection)) || - ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.InCollection)) || - ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.SuppCollection)) || - ((sourceEntry == StandardEntryType.MvProceedings) && (targetEntry == StandardEntryType.Proceedings)) || - ((sourceEntry == StandardEntryType.MvProceedings) && (targetEntry == StandardEntryType.InProceedings)) || - ((sourceEntry == StandardEntryType.MvReference) && (targetEntry == StandardEntryType.Reference)) || - ((sourceEntry == StandardEntryType.MvReference) && (targetEntry == StandardEntryType.InReference))) { - if (targetField == StandardField.MAINTITLE) { return Optional.of(StandardField.TITLE); } - if (targetField == StandardField.MAINSUBTITLE) { return Optional.of(StandardField.SUBTITLE); } - if (targetField == StandardField.MAINTITLEADDON) { return Optional.of(StandardField.TITLEADDON); } + ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.InBook)) || + ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.BookInBook)) || + ((sourceEntry == StandardEntryType.MvBook) && (targetEntry == StandardEntryType.SuppBook)) || + ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.Collection)) || + ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.InCollection)) || + ((sourceEntry == StandardEntryType.MvCollection) && (targetEntry == StandardEntryType.SuppCollection)) || + ((sourceEntry == StandardEntryType.MvProceedings) && (targetEntry == StandardEntryType.Proceedings)) || + ((sourceEntry == StandardEntryType.MvProceedings) && (targetEntry == StandardEntryType.InProceedings)) || + ((sourceEntry == StandardEntryType.MvReference) && (targetEntry == StandardEntryType.Reference)) || + ((sourceEntry == StandardEntryType.MvReference) && (targetEntry == StandardEntryType.InReference))) { + if (targetField == StandardField.MAINTITLE) { + return Optional.of(StandardField.TITLE); + } + if (targetField == StandardField.MAINSUBTITLE) { + return Optional.of(StandardField.SUBTITLE); + } + if (targetField == StandardField.MAINTITLEADDON) { + return Optional.of(StandardField.TITLEADDON); + } // those fields are no more available for the same-name inheritance strategy if ((targetField == StandardField.TITLE) || @@ -183,7 +193,7 @@ private Optional getSourceField(Field targetField, EntryType targetEntry, } // for these fields, inheritance is not allowed for the specified entry types - if ((targetField == StandardField.SHORTTITLE)) { + if (targetField == StandardField.SHORTTITLE) { return Optional.empty(); } } @@ -195,9 +205,15 @@ private Optional getSourceField(Field targetField, EntryType targetEntry, ((sourceEntry == StandardEntryType.Collection) && (targetEntry == StandardEntryType.SuppCollection)) || ((sourceEntry == StandardEntryType.Reference) && (targetEntry == StandardEntryType.InReference)) || ((sourceEntry == StandardEntryType.Proceedings) && (targetEntry == StandardEntryType.InProceedings))) { - if (targetField == StandardField.BOOKTITLE) { return Optional.of(StandardField.TITLE); } - if (targetField == StandardField.BOOKSUBTITLE) { return Optional.of(StandardField.SUBTITLE); } - if (targetField == StandardField.BOOKTITLEADDON) { return Optional.of(StandardField.TITLEADDON); } + if (targetField == StandardField.BOOKTITLE) { + return Optional.of(StandardField.TITLE); + } + if (targetField == StandardField.BOOKSUBTITLE) { + return Optional.of(StandardField.SUBTITLE); + } + if (targetField == StandardField.BOOKTITLEADDON) { + return Optional.of(StandardField.TITLEADDON); + } // those fields are no more available for the same-name inheritance strategy if ((targetField == StandardField.TITLE) || @@ -214,8 +230,12 @@ private Optional getSourceField(Field targetField, EntryType targetEntry, if (((sourceEntry == IEEETranEntryType.Periodical) && (targetEntry == StandardEntryType.Article)) || ((sourceEntry == IEEETranEntryType.Periodical) && (targetEntry == StandardEntryType.SuppPeriodical))) { - if (targetField == StandardField.JOURNALTITLE) { return Optional.of(StandardField.TITLE); } - if (targetField == StandardField.JOURNALSUBTITLE) { return Optional.of(StandardField.SUBTITLE); } + if (targetField == StandardField.JOURNALTITLE) { + return Optional.of(StandardField.TITLE); + } + if (targetField == StandardField.JOURNALSUBTITLE) { + return Optional.of(StandardField.SUBTITLE); + } // those fields are no more available for the same-name inheritance strategy if ((targetField == StandardField.TITLE) || @@ -306,15 +326,6 @@ public void setId(String id) { changed = true; } - /** - * Returns the cite key AKA citation key AKA BibTeX key, or null if it is not set. - * Note: this is not the internal Id of this entry. The internal Id is always present, whereas the BibTeX key might not be present. - */ - @Deprecated - public String getCiteKey() { - return fields.get(InternalField.KEY_FIELD); - } - /** * Sets the cite key AKA citation key AKA BibTeX key. Note: This is not the internal Id of this entry. * The internal Id is always present, whereas the BibTeX key might not be present. @@ -336,7 +347,7 @@ public Optional getCiteKeyOptional() { } public boolean hasCiteKey() { - return !Strings.isNullOrEmpty(getCiteKey()); + return this.getField(InternalField.KEY_FIELD).map(key -> !Strings.isNullOrEmpty(key)).orElse(false); } /** @@ -485,7 +496,7 @@ public Optional getFieldOrAliasLatexFree(Field name) { * archiveprefix <-> eprinttype
    * journal <-> journaltitle
    * key <-> sortkey
    - * pdf <-> file
    file
    * primaryclass <-> eprintclass
    * school <-> institution
    * These work bidirectional.
    @@ -905,10 +916,10 @@ public Optional setFiles(List files) { * Changes to the underlying list will have no effect on the entry itself. Use {@link #addFile(LinkedFile)} */ public List getFiles() { - //Extract the path + // Extract the path Optional oldValue = getField(StandardField.FILE); if (!oldValue.isPresent()) { - return new ArrayList<>(); //Return new ArrayList because emptyList is immutable + return new ArrayList<>(); // Return new ArrayList because emptyList is immutable } return FileFieldParser.parse(oldValue.get()); diff --git a/src/main/java/org/jabref/model/entry/BibtexString.java b/src/main/java/org/jabref/model/entry/BibtexString.java index 551dc749ad4..3080dd40fb6 100644 --- a/src/main/java/org/jabref/model/entry/BibtexString.java +++ b/src/main/java/org/jabref/model/entry/BibtexString.java @@ -185,10 +185,10 @@ public boolean equals(Object o) { return false; } BibtexString that = (BibtexString) o; - return (Objects.equals(hasChanged,that.hasChanged) && + return (Objects.equals(hasChanged, that.hasChanged) && Objects.equals(name, that.name) && Objects.equals(content, that.content) && - Objects.equals(id, that.id) && + Objects.equals(id, that.id) && Objects.equals(type, that.type) && Objects.equals(parsedSerialization, that.parsedSerialization)); } diff --git a/src/main/java/org/jabref/model/entry/FileFieldParser.java b/src/main/java/org/jabref/model/entry/FileFieldParser.java index 442a18b2361..86ac1b2c443 100644 --- a/src/main/java/org/jabref/model/entry/FileFieldParser.java +++ b/src/main/java/org/jabref/model/entry/FileFieldParser.java @@ -22,10 +22,9 @@ public static List parse(String value) { if (!escaped && (c == '\\')) { escaped = true; continue; - } - // Check if we are entering an XML special character construct such - // as ",", because we need to know in order to ignore the semicolon. - else if (!escaped && (c == '&') && !inXmlChar) { + } else if (!escaped && (c == '&') && !inXmlChar) { + // Check if we are entering an XML special character construct such + // as ",", because we need to know in order to ignore the semicolon. sb.append(c); if ((value.length() > (i + 1)) && (value.charAt(i + 1) == '#')) { inXmlChar = true; diff --git a/src/main/java/org/jabref/model/entry/LinkedFile.java b/src/main/java/org/jabref/model/entry/LinkedFile.java index 3c79ffd6812..dac550e9ded 100644 --- a/src/main/java/org/jabref/model/entry/LinkedFile.java +++ b/src/main/java/org/jabref/model/entry/LinkedFile.java @@ -28,7 +28,7 @@ public class LinkedFile implements Serializable { private static final LinkedFile NULL_OBJECT = new LinkedFile("", "", ""); - //We have to mark these properties as transient because they can't be serialized directly + // We have to mark these properties as transient because they can't be serialized directly private transient StringProperty description = new SimpleStringProperty(); private transient StringProperty link = new SimpleStringProperty(); private transient StringProperty fileType = new SimpleStringProperty(); diff --git a/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java b/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java index 90151a111ba..cdf55f380f3 100644 --- a/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java +++ b/src/main/java/org/jabref/model/entry/event/FieldChangedEvent.java @@ -14,7 +14,6 @@ public class FieldChangedEvent extends EntryChangedEvent { private final String oldValue; private int delta = 0; - /** * @param bibEntry Affected BibEntry object * @param field Name of field which has been changed diff --git a/src/main/java/org/jabref/model/entry/identifier/DOI.java b/src/main/java/org/jabref/model/entry/identifier/DOI.java index 68e1ff2968d..c11a614cc18 100644 --- a/src/main/java/org/jabref/model/entry/identifier/DOI.java +++ b/src/main/java/org/jabref/model/entry/identifier/DOI.java @@ -14,10 +14,7 @@ import org.slf4j.LoggerFactory; /** - * Class for working with Digital object identifiers (DOIs) and Short DOIs - * - * @see https://en.wikipedia.org/wiki/Digital_object_identifier - * @see http://shortdoi.org + * Class for working with Digital object identifiers (DOIs) and Short DOIs */ public class DOI implements Identifier { private static final Logger LOGGER = LoggerFactory.getLogger(DOI.class); @@ -119,7 +116,7 @@ public DOI(String doi) { } /** - * Creates an Optional from various schemes including URL, URN, and plain DOIs. + * Creates an Optional<DOI> from various schemes including URL, URN, and plain DOIs. * * Useful for suppressing the IllegalArgumentException of the Constructor and checking for * Optional.isPresent() instead. diff --git a/src/main/java/org/jabref/model/entry/identifier/Eprint.java b/src/main/java/org/jabref/model/entry/identifier/Eprint.java index 99343c24410..93b85a722a1 100644 --- a/src/main/java/org/jabref/model/entry/identifier/Eprint.java +++ b/src/main/java/org/jabref/model/entry/identifier/Eprint.java @@ -16,8 +16,7 @@ /** * Class for working with Eprint identifiers * - * @see https://arxiv.org/help/arxiv_identifier - * @see https://arxiv.org/hypertex/bibstyles/ + * See also https://arxiv.org/help/arxiv_identifier and https://arxiv.org/hypertex/bibstyles/ */ public class Eprint implements Identifier { public static final URI RESOLVER = URI.create("https://arxiv.org"); @@ -80,7 +79,7 @@ public Eprint(String eprint) { } /** - * Creates an Optional from various schemes including URL. + * Creates an Optional<Eprint> from various schemes including URL. * * Useful for suppressing the IllegalArgumentException of the Constructor * and checking for Optional.isPresent() instead. diff --git a/src/main/java/org/jabref/model/entry/identifier/ISBN.java b/src/main/java/org/jabref/model/entry/identifier/ISBN.java index 59697fcf9ca..aa8005ce860 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ISBN.java +++ b/src/main/java/org/jabref/model/entry/identifier/ISBN.java @@ -16,7 +16,6 @@ public class ISBN implements Identifier { private final String isbnString; - public ISBN(String isbnString) { this.isbnString = Objects.requireNonNull(isbnString).trim().replace("-", ""); } diff --git a/src/main/java/org/jabref/model/entry/identifier/ISSN.java b/src/main/java/org/jabref/model/entry/identifier/ISSN.java index 07795373aee..e60e582cde5 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ISSN.java +++ b/src/main/java/org/jabref/model/entry/identifier/ISSN.java @@ -11,7 +11,6 @@ public class ISSN { private final String issnString; - public ISSN(String issnString) { this.issnString = Objects.requireNonNull(issnString).trim(); } diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java index 9344c2faff4..874db26a41a 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java @@ -352,7 +352,7 @@ public class BiblatexEntryTypeDefinitions { .withRequiredFields(StandardField.AUTHOR, StandardField.TITLE, StandardField.DATE) .withDetailFields(StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.LANGUAGE, StandardField.HOWPUBLISHED, StandardField.NOTE, StandardField.LOCATION, StandardField.ADDENDUM, StandardField.PUBSTATE, StandardField.EVENTTITLE, - StandardField.EVENTDATE,StandardField.VENUE, StandardField.URL, StandardField.URLDATE) + StandardField.EVENTDATE, StandardField.VENUE, StandardField.URL, StandardField.URLDATE) .build(); private static final BibEntryType CONFERENCE = new BibEntryTypeBuilder() diff --git a/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java b/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java index 6c9745bde10..86756afde42 100644 --- a/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java +++ b/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java @@ -48,8 +48,8 @@ private static boolean isBiblatex(EntryType type) { public static EntryType parse(String typeName) { - List types = new ArrayList<>(Arrays. asList(StandardEntryType.values())); - types.addAll(Arrays. asList(IEEETranEntryType.values())); + List types = new ArrayList<>(Arrays.asList(StandardEntryType.values())); + types.addAll(Arrays.asList(IEEETranEntryType.values())); return types.stream().filter(type -> type.getName().equals(typeName.toLowerCase(Locale.ENGLISH))).findFirst().orElse(new UnknownEntryType(typeName)); } diff --git a/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java index 9c04458b92c..694c055042b 100644 --- a/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java @@ -12,7 +12,7 @@ /** * This class represents all supported IEEETran entry types. * - * @see http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/IEEEtran/bibtex/IEEEtran_bst_HOWTO.pdf + * See http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/IEEEtran/bibtex/IEEEtran_bst_HOWTO.pdf *

    * Electronic, IEEETranBSTCTL, Periodical, Patent, Standard */ diff --git a/src/main/java/org/jabref/model/groups/AllEntriesGroup.java b/src/main/java/org/jabref/model/groups/AllEntriesGroup.java index fdb5b0d5fbf..d0b92fe4760 100644 --- a/src/main/java/org/jabref/model/groups/AllEntriesGroup.java +++ b/src/main/java/org/jabref/model/groups/AllEntriesGroup.java @@ -9,7 +9,6 @@ */ public class AllEntriesGroup extends AbstractGroup { - public AllEntriesGroup(String name) { super(name, GroupHierarchyType.INDEPENDENT); } diff --git a/src/main/java/org/jabref/model/groups/GroupTreeNode.java b/src/main/java/org/jabref/model/groups/GroupTreeNode.java index 85795e36194..5bba190df12 100644 --- a/src/main/java/org/jabref/model/groups/GroupTreeNode.java +++ b/src/main/java/org/jabref/model/groups/GroupTreeNode.java @@ -116,7 +116,7 @@ private SearchMatcher getSearchMatcher(GroupHierarchyType originalContext) { } } else if ((context == GroupHierarchyType.REFINING) && !isRoot() && (originalContext != GroupHierarchyType.INCLUDING)) { - //noinspection OptionalGetWithoutIsPresent + // noinspection OptionalGetWithoutIsPresent searchRule.addRule(getParent().get().getSearchMatcher(originalContext)); } return searchRule; diff --git a/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java b/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java index 4ca84ac2604..de28ff25840 100644 --- a/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java +++ b/src/main/java/org/jabref/model/metadata/SaveOrderConfig.java @@ -11,7 +11,7 @@ /** * Stores the save order config from MetaData *

    - * Format: , pair of field + ascending (boolean) + * Format: <choice>, pair of field + ascending (boolean) */ public class SaveOrderConfig { diff --git a/src/main/java/org/jabref/model/util/FileHelper.java b/src/main/java/org/jabref/model/util/FileHelper.java index da0ff3ee853..dba58b1fd21 100644 --- a/src/main/java/org/jabref/model/util/FileHelper.java +++ b/src/main/java/org/jabref/model/util/FileHelper.java @@ -152,7 +152,7 @@ private static Optional expandFilename(String filename, Path directory) { Objects.requireNonNull(directory); Path file = Paths.get(filename); - //Explicitly check for an empty String, as File.exists returns true on that empty path, because it maps to the default jar location + // Explicitly check for an empty String, as File.exists returns true on that empty path, because it maps to the default jar location // if we then call toAbsoluteDir, it would always return the jar-location folder. This is not what we want here if (filename.isEmpty()) { return Optional.of(directory); diff --git a/src/main/java/org/jabref/preferences/CustomImportList.java b/src/main/java/org/jabref/preferences/CustomImportList.java index 7aca6a3d720..5b05e052512 100644 --- a/src/main/java/org/jabref/preferences/CustomImportList.java +++ b/src/main/java/org/jabref/preferences/CustomImportList.java @@ -22,7 +22,6 @@ public class CustomImportList extends TreeSet { private final JabRefPreferences prefs; - public CustomImportList(JabRefPreferences prefs) { super(); this.prefs = prefs; diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index a98c4ae7289..9af9a2a81c1 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -293,10 +293,10 @@ public class JabRefPreferences implements PreferencesService { public static final String CUSTOMIZED_BIBLATEX_TYPES = "customizedBiblatexTypes"; // Version public static final String VERSION_IGNORED_UPDATE = "versionIgnoreUpdate"; - //KeyBindings - keys - public because needed for pref migration + // KeyBindings - keys - public because needed for pref migration public static final String BINDINGS = "bindings"; - //AutcompleteFields - public because needed for pref migration + // AutcompleteFields - public because needed for pref migration public static final String AUTOCOMPLETER_COMPLETE_FIELDS = "autoCompleteFields"; // Id Entry Generator Preferences @@ -350,7 +350,7 @@ public class JabRefPreferences implements PreferencesService { private static final String PROTECTED_TERMS_ENABLED_INTERNAL = "protectedTermsEnabledInternal"; private static final String PROTECTED_TERMS_DISABLED_INTERNAL = "protectedTermsDisabledInternal"; - //GroupViewMode + // GroupViewMode private static final String GROUP_INTERSECT_UNION_VIEW_MODE = "groupIntersectUnionViewModes"; // Dialog states @@ -626,7 +626,7 @@ private JabRefPreferences() { // use BibTeX key appended with filename as default pattern defaults.put(IMPORT_FILENAMEPATTERN, ImportTabViewModel.DEFAULT_FILENAME_PATTERNS[1]); - //Default empty String to be backwards compatible + // Default empty String to be backwards compatible defaults.put(IMPORT_FILEDIRPATTERN, ""); customImports = new CustomImportList(this); @@ -648,7 +648,7 @@ private JabRefPreferences() { defaults.put(FILE_BROWSER_COMMAND, ""); } - //versioncheck defaults + // versioncheck defaults defaults.put(VERSION_IGNORED_UPDATE, ""); // preview @@ -829,7 +829,7 @@ public Map getCustomTabsNamesAndFields() { int defNumber = 0; while (true) { - //Saved as CUSTOMTABNAME_def{number} and ; separated + // Saved as CUSTOMTABNAME_def{number} and ; separated String name = (String) defaults.get(CUSTOM_TAB_NAME + "_def" + defNumber); String fields = (String) defaults.get(CUSTOM_TAB_FIELDS + "_def" + defNumber); diff --git a/src/main/java/org/jabref/preferences/SearchPreferences.java b/src/main/java/org/jabref/preferences/SearchPreferences.java index 78c1ba8aff8..0d5520cd666 100644 --- a/src/main/java/org/jabref/preferences/SearchPreferences.java +++ b/src/main/java/org/jabref/preferences/SearchPreferences.java @@ -18,7 +18,6 @@ public class SearchPreferences { private final JabRefPreferences preferences; - public SearchPreferences(JabRefPreferences preferences) { this.preferences = Objects.requireNonNull(preferences); } diff --git a/src/main/java/org/jabref/preferences/VersionPreferences.java b/src/main/java/org/jabref/preferences/VersionPreferences.java index 24e5bb737cc..e9b46bc8a6c 100644 --- a/src/main/java/org/jabref/preferences/VersionPreferences.java +++ b/src/main/java/org/jabref/preferences/VersionPreferences.java @@ -6,7 +6,6 @@ public class VersionPreferences { private final Version ignoredVersion; - public VersionPreferences(Version ignoredVersion) { this.ignoredVersion = ignoredVersion; } diff --git a/src/test/java/org/jabref/architecture/MainArchitectureTestsWithArchUnit.java b/src/test/java/org/jabref/architecture/MainArchitectureTestsWithArchUnit.java index dc7308e77f4..6237103e62e 100644 --- a/src/test/java/org/jabref/architecture/MainArchitectureTestsWithArchUnit.java +++ b/src/test/java/org/jabref/architecture/MainArchitectureTestsWithArchUnit.java @@ -47,7 +47,7 @@ public static void doNotUseGlyphsDirectly(JavaClasses classes) { noClasses().that().resideOutsideOfPackage("org.jabref.gui.icon").should().accessClassesThat().resideInAnyPackage("de.jensd.fx.glyphs", "de.jensd.fx.glyphs.materialdesignicons").check(classes); } - //"Currently disabled as there is no alternative for the rest of classes who need awt" + // "Currently disabled as there is no alternative for the rest of classes who need awt" @ArchIgnore @ArchTest public static void doNotUseJavaAWT(JavaClasses classes) { diff --git a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java index 04050a9bd20..1bcd3895338 100644 --- a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java @@ -42,7 +42,7 @@ public void setUp(@TempDir Path folder) throws Exception { @Test public void test() throws Exception { - //Due to mocking the externalFileType class, the file extension will not be found + // Due to mocking the externalFileType class, the file extension will not be found List expected = Collections.singletonList(new LinkedFile("", "CiteKey.pdf", "")); diff --git a/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java b/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java index 86ab685cc8c..bac8b112273 100644 --- a/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java +++ b/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java @@ -157,7 +157,7 @@ void downloadDoesNotOverwriteFileTypeExtension() throws MalformedURLException { linkedFile = new LinkedFile(new URL("http://arxiv.org/pdf/1207.0408v1"), ""); databaseContext = mock(BibDatabaseContext.class); - when(filePreferences.getFileNamePattern()).thenReturn("[bibtexkey]"); //use this variant, as we cannot mock the linkedFileHandler cause it's initialized inside the viewModel + when(filePreferences.getFileNamePattern()).thenReturn("[bibtexkey]"); // use this variant, as we cannot mock the linkedFileHandler cause it's initialized inside the viewModel LinkedFileViewModel viewModel = new LinkedFileViewModel(linkedFile, entry, databaseContext, new CurrentThreadTaskExecutor(), dialogService, xmpPreferences, filePreferences, externalFileType); diff --git a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelMixedAbbreviationsTest.java b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelMixedAbbreviationsTest.java index 1f2eaa7112a..e3347ad405c 100644 --- a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelMixedAbbreviationsTest.java +++ b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelMixedAbbreviationsTest.java @@ -61,7 +61,7 @@ void setUpViewModel(@TempDir Path tempFolder) throws Exception { testFile1Entries = createTestFile(tempFolder, "testFile1Entries.csv", "Test Entry;TE" + NEWLINE + ""); testFile3Entries = createTestFile(tempFolder, "testFile3Entries.csv", "Abbreviations;Abb;A" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + ""); testFile4Entries = createTestFile(tempFolder, "testFile4Entries.csv", "Abbreviations;Abb" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "Entry;E" + NEWLINE + ""); - testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv","Abbreviations;Abb" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); + testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv", "Abbreviations;Abb" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); } @Test diff --git a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelNoShortestUniqueAbbreviationsTest.java b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelNoShortestUniqueAbbreviationsTest.java index 7f7fc5ed141..600d78022a2 100644 --- a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelNoShortestUniqueAbbreviationsTest.java +++ b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelNoShortestUniqueAbbreviationsTest.java @@ -61,7 +61,7 @@ void setUpViewModel(@TempDir Path tempFolder) throws Exception { testFile1Entries = createTestFile(tempFolder, "testFile1Entries.csv", "Test Entry;TE" + NEWLINE + ""); testFile3Entries = createTestFile(tempFolder, "testFile3Entries.csv", "Abbreviations;Abb" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME" + NEWLINE + ""); testFile4Entries = createTestFile(tempFolder, "testFile4Entries.csv", "Abbreviations;Abb" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME" + NEWLINE + "Entry;E" + NEWLINE + ""); - testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv","Abbreviations;Abb" + NEWLINE + "Test Entry;TE" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); + testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv", "Abbreviations;Abb" + NEWLINE + "Test Entry;TE" + NEWLINE + "Test Entry;TE" + NEWLINE + "MoreEntries;ME" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); } @Test diff --git a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelWithShortestUniqueAbbreviationsTest.java b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelWithShortestUniqueAbbreviationsTest.java index 1608557a089..c64a3ed233b 100644 --- a/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelWithShortestUniqueAbbreviationsTest.java +++ b/src/test/java/org/jabref/gui/journals/ManageJournalAbbreviationsViewModelWithShortestUniqueAbbreviationsTest.java @@ -61,7 +61,7 @@ void setUpViewModel(@TempDir Path tempFolder) throws Exception { testFile1Entries = createTestFile(tempFolder, "testFile1Entries.csv", "Test Entry;TE;T" + NEWLINE + ""); testFile3Entries = createTestFile(tempFolder, "testFile3Entries.csv", "Abbreviations;Abb;A" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + ""); testFile4Entries = createTestFile(tempFolder, "testFile4Entries.csv", "Abbreviations;Abb;A" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "Entry;En;E" + NEWLINE + ""); - testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv","Abbreviations;Abb;A" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); + testFile5EntriesWithDuplicate = createTestFile(tempFolder, "testFile5Entries.csv", "Abbreviations;Abb;A" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "Test Entry;TE;T" + NEWLINE + "MoreEntries;ME;M" + NEWLINE + "EntryEntry;EE" + NEWLINE + ""); } @Test diff --git a/src/test/java/org/jabref/gui/maintable/MainTableColumnModelTest.java b/src/test/java/org/jabref/gui/maintable/MainTableColumnModelTest.java index 253039bd340..885716d26ef 100644 --- a/src/test/java/org/jabref/gui/maintable/MainTableColumnModelTest.java +++ b/src/test/java/org/jabref/gui/maintable/MainTableColumnModelTest.java @@ -17,7 +17,7 @@ public class MainTableColumnModelTest { public void testMainTableColumnModelParser() { MainTableColumnModel testColumnModel = MainTableColumnModel.parse(testQualifier); - assertEquals(testColumnModel.getType(),testType); + assertEquals(testColumnModel.getType(), testType); assertEquals(testColumnModel.getQualifier(), testQualifier); } @@ -25,7 +25,7 @@ public void testMainTableColumnModelParser() { public void testMainTableColumnModelParserFull() { MainTableColumnModel testColumnModel = MainTableColumnModel.parse(testName); - assertEquals(testColumnModel.getType(),testType); + assertEquals(testColumnModel.getType(), testType); assertEquals(testColumnModel.getQualifier(), testQualifier); } diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java index 19411d8254c..5ebca3902d5 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java @@ -48,10 +48,10 @@ void testSerialization() throws IOException { StringWriter stringWriter = new StringWriter(); BibEntry entry = new BibEntry(StandardEntryType.Article); - //set a required field + // set a required field entry.setField(StandardField.AUTHOR, "Foo Bar"); entry.setField(StandardField.JOURNAL, "International Journal of Something"); - //set an optional field + // set an optional field entry.setField(StandardField.NUMBER, "1"); entry.setField(StandardField.NOTE, "some note"); @@ -81,7 +81,7 @@ void writeOtherTypeTest() throws Exception { entry.setField(StandardField.COMMENT, "testentry"); entry.setCiteKey("test"); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -111,10 +111,10 @@ void writeEntryWithOrField() throws Exception { StringWriter stringWriter = new StringWriter(); BibEntry entry = new BibEntry(StandardEntryType.InBook); - //set an required OR field (author/editor) + // set an required OR field (author/editor) entry.setField(StandardField.EDITOR, "Foo Bar"); entry.setField(StandardField.JOURNAL, "International Journal of Something"); - //set an optional field + // set an optional field entry.setField(StandardField.NUMBER, "1"); entry.setField(StandardField.NOTE, "some note"); @@ -139,11 +139,11 @@ void writeEntryWithOrFieldBothFieldsPresent() throws Exception { StringWriter stringWriter = new StringWriter(); BibEntry entry = new BibEntry(StandardEntryType.InBook); - //set an required OR field with both fields(author/editor) + // set an required OR field with both fields(author/editor) entry.setField(StandardField.AUTHOR, "Foo Thor"); entry.setField(StandardField.EDITOR, "Edi Bar"); entry.setField(StandardField.JOURNAL, "International Journal of Something"); - //set an optional field + // set an optional field entry.setField(StandardField.NUMBER, "1"); entry.setField(StandardField.NOTE, "some note"); @@ -199,7 +199,7 @@ void roundTripTest() throws IOException { Collection entries = result.getDatabase().getEntries(); BibEntry entry = entries.iterator().next(); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -223,7 +223,7 @@ void roundTripWithPrependingNewlines() throws IOException { Collection entries = result.getDatabase().getEntries(); BibEntry entry = entries.iterator().next(); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -286,7 +286,7 @@ void roundTripWithCamelCasingInTheOriginalEntryAndResultInLowerCase() throws IOE // modify entry entry.setField(StandardField.AUTHOR, "BlaBla"); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -323,7 +323,7 @@ void testEntryTypeChange() throws IOException { // modify entry entry.setType(StandardEntryType.InProceedings); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -356,7 +356,7 @@ void roundTripWithAppendedNewlines() throws IOException { Collection entries = result.getDatabase().getEntries(); BibEntry entry = entries.iterator().next(); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -389,7 +389,7 @@ private String testSingleWrite(String bibtexEntry) throws IOException { Collection entries = result.getDatabase().getEntries(); BibEntry entry = entries.iterator().next(); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -418,7 +418,7 @@ void monthFieldSpecialSyntax() throws IOException { assertTrue(fields.contains(StandardField.MONTH)); assertEquals("#mar#", entry.getField(StandardField.MONTH).get()); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -479,7 +479,7 @@ void addFieldWithLongerLength() throws IOException { // modify entry entry.setField(StandardField.HOWPUBLISHED, "asdf"); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -542,7 +542,7 @@ void roundTripWithPrecedingCommentTest() throws IOException { Collection entries = result.getDatabase().getEntries(); BibEntry entry = entries.iterator().next(); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -570,7 +570,7 @@ void roundTripWithPrecedingCommentAndModificationTest() throws IOException { // change the entry entry.setField(StandardField.AUTHOR, "John Doe"); - //write out bibtex string + // write out bibtex string StringWriter stringWriter = new StringWriter(); writer.write(entry, stringWriter, BibDatabaseMode.BIBTEX); String actual = stringWriter.toString(); @@ -592,15 +592,15 @@ void alphabeticSerialization() throws IOException { StringWriter stringWriter = new StringWriter(); BibEntry entry = new BibEntry(StandardEntryType.Article); - //required fields + // required fields entry.setField(StandardField.AUTHOR, "Foo Bar"); entry.setField(StandardField.JOURNALTITLE, "International Journal of Something"); entry.setField(StandardField.TITLE, "Title"); entry.setField(StandardField.DATE, "2019-10-16"); - //optional fields + // optional fields entry.setField(StandardField.NUMBER, "1"); entry.setField(StandardField.NOTE, "some note"); - //unknown fields + // unknown fields entry.setField(StandardField.YEAR, "2019"); entry.setField(StandardField.CHAPTER, "chapter"); diff --git a/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java b/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java index 222aae68292..254a9c50bf0 100644 --- a/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java +++ b/src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyGeneratorTest.java @@ -253,10 +253,10 @@ void testMakeLabelAndCheckLegalKeysAccentGrave() throws ParseException { @Test void testCheckLegalKey() { // not tested/ not in hashmap UNICODE_CHARS: - // Ł ł Ő ő Ű ű Ŀ ŀ Ħ ħ Ð ð Þ þ Œ œ Æ æ Ø ø Å å Ə ə Đ đ Ů ů Ǣ ǣ ǖ ǘ ǚ ǜ - //" Ǣ ǣ ǖ ǘ ǚ ǜ " + - //"Đ đ Ů ů " + - //"Ł ł Ő ő Ű ű Ŀ ŀ Ħ ħ Ð ð Þ þ Œ œ Æ æ Ø ø Å å Ə ə + // Ł ł Ő ő Ű ű Ŀ ŀ Ħ ħ Ð ð Þ þ Œ œ Æ æ Ø ø Å å Ə ə Đ đ Ů ů Ǣ ǣ ǖ ǘ ǚ ǜ + // " Ǣ ǣ ǖ ǘ ǚ ǜ " + + // "Đ đ Ů ů " + + // "Ł ł Ő ő Ű ű Ŀ ŀ Ħ ħ Ð ð Þ þ Œ œ Æ æ Ø ø Å å Ə ə String accents = "ÀàÈèÌìÒòÙù  â Ĉ ĉ Ê ê Ĝ ĝ Ĥ ĥ Î î Ĵ ĵ Ô ô Ŝ ŝ Û û Ŵ ŵ Ŷ ŷ"; String expectedResult = "AaEeIiOoUuAaCcEeGgHhIiJjOoSsUuWwYy"; assertEquals(expectedResult, BibtexKeyGenerator.cleanKey(accents, true)); diff --git a/src/test/java/org/jabref/logic/bst/TestVM.java b/src/test/java/org/jabref/logic/bst/TestVM.java index f468889d55a..c4a9eee8788 100644 --- a/src/test/java/org/jabref/logic/bst/TestVM.java +++ b/src/test/java/org/jabref/logic/bst/TestVM.java @@ -128,9 +128,9 @@ public void testVMExecuteSimple2() throws RecognitionException { @Test public void testVMIfSkipPop() throws RecognitionException { - VM vm = new VM("FUNCTION {not} { { #0 } { #1 } if$ }" - + "FUNCTION {and} { 'skip$ { pop$ #0 } if$ }" - + "FUNCTION {or} { { pop$ #1 } 'skip$ if$ }" + "FUNCTION {test} { " + VM vm = new VM("FUNCTION {not} { { #0 } { #1 } if$ }" + + "FUNCTION {and} { 'skip$ { pop$ #0 } if$ }" + + "FUNCTION {or} { { pop$ #1 } 'skip$ if$ }" + "FUNCTION {test} { " + "#1 #1 and #0 #1 and #1 #0 and #0 #0 and " + "#0 not #1 not " + "#1 #1 or #0 #1 or #1 #0 or #0 #0 or }" + "EXECUTE {test}"); @@ -385,7 +385,7 @@ public void testBuildIn() throws RecognitionException { @Test public void testVariables() throws RecognitionException { VM vm = new VM(" STRINGS { t } " - + " FUNCTION {not} { { #0 } { #1 } if$ } " + + " FUNCTION {not} { { #0 } { #1 } if$ } " + " FUNCTION {n.dashify} { \"HELLO-WORLD\" 't := t empty$ not } " + " EXECUTE {n.dashify} "); @@ -398,33 +398,33 @@ public void testVariables() throws RecognitionException { public void testWhile() throws RecognitionException { VM vm = new VM( "STRINGS { t } " - + "FUNCTION {not} { " + + "FUNCTION {not} { " + " { #0 } { #1 } if$ } " + "FUNCTION {n.dashify} " + "{ \"HELLO-WORLD\" " + " 't := " + " \"\" " - + " { t empty$ not } " - + " { t #1 #1 substring$ \"-\" = " - + " { t #1 #2 substring$ \"--\" = not " - + " { \"--\" * " - + " t #2 global.max$ substring$ 't := " - + " } " - + " { { t #1 #1 substring$ \"-\" = } " - + " { \"-\" * " - + " t #2 global.max$ substring$ 't := " - + " } " - + " while$ " - + " } " - + " if$ " - + " } " - + " { t #1 #1 substring$ * " - + " t #2 global.max$ substring$ 't := " - + " } " - + " if$ " - + " } " - + " while$ " - + " } " + + " { t empty$ not } " + + " { t #1 #1 substring$ \"-\" = " + + " { t #1 #2 substring$ \"--\" = not " + + " { \"--\" * " + + " t #2 global.max$ substring$ 't := " + + " } " + + " { { t #1 #1 substring$ \"-\" = } " + + " { \"-\" * " + + " t #2 global.max$ substring$ 't := " + + " } " + + " while$ " + + " } " + + " if$ " + + " } " + + " { t #1 #1 substring$ * " + + " t #2 global.max$ substring$ 't := " + + " } " + + " if$ " + + " } " + + " while$ " + + " } " + " EXECUTE {n.dashify} "); List v = Collections.emptyList(); @@ -553,37 +553,37 @@ public void testIterate() throws RecognitionException, IOException { @Test public void testWidth() throws RecognitionException, IOException { VM vm = new VM("ENTRY { " + " address " + " author " + " title " + " type " - + "} {} { label } " + // - "STRINGS { longest.label } " + // - "INTEGERS { number.label longest.label.width } " + // - "FUNCTION {initialize.longest.label} " + // - "{ \"\" 'longest.label := " + // - " #1 'number.label := " + // - " #0 'longest.label.width := " + // - "} " + // - " " + // - " FUNCTION {longest.label.pass} " + // - " { number.label int.to.str$ 'label := " + // - " number.label #1 + 'number.label := " + // - " label width$ longest.label.width > " + // - " { label 'longest.label := " + // - " label width$ 'longest.label.width := " + // - " } " + // - " 'skip$ " + // - " if$ " + // - " } " + // - " " + // - " EXECUTE {initialize.longest.label} " + // - " " + // - " ITERATE {longest.label.pass} " + // - "FUNCTION {begin.bib} " + // - "{ preamble$ empty$" + // - " 'skip$" + // - " { preamble$ write$ newline$ }" + // - " if$" + // - " \"\\begin{thebibliography}{\" longest.label * \"}\" *" + // - "}" + // - "EXECUTE {begin.bib}");// + + "} {} { label } " + + "STRINGS { longest.label } " + + "INTEGERS { number.label longest.label.width } " + + "FUNCTION {initialize.longest.label} " + + "{ \"\" 'longest.label := " + + " #1 'number.label := " + + " #0 'longest.label.width := " + + "} " + + " " + + " FUNCTION {longest.label.pass} " + + " { number.label int.to.str$ 'label := " + + " number.label #1 + 'number.label := " + + " label width$ longest.label.width > " + + " { label 'longest.label := " + + " label width$ 'longest.label.width := " + + " } " + + " 'skip$ " + + " if$ " + + " } " + + " " + + " EXECUTE {initialize.longest.label} " + + " " + + " ITERATE {longest.label.pass} " + + "FUNCTION {begin.bib} " + + "{ preamble$ empty$" + + " 'skip$" + + " { preamble$ write$ newline$ }" + + " if$" + + " \"\\begin{thebibliography}{\" longest.label * \"}\" *" + + "}" + + "EXECUTE {begin.bib}"); List v = List.of(t1BibtexEntry()); diff --git a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java index 7cdf6d2dc56..75cb1c30d2a 100644 --- a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java +++ b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java @@ -63,7 +63,7 @@ void setUp(@TempDir Path bibFolder) throws IOException { context.setDatabasePath(bibFolder.resolve("test.bib")); FilePreferences fileDirPrefs = mock(FilePreferences.class, Answers.RETURNS_SMART_NULLS); - //Biblocation as Primary overwrites all other dirs + // Biblocation as Primary overwrites all other dirs when(fileDirPrefs.isBibLocationAsPrimary()).thenReturn(true); worker = new CleanupWorker(context, diff --git a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java index 523dfb5a049..22ef8bd86e7 100644 --- a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java @@ -59,7 +59,7 @@ void setUp(@TempDir Path bibFolder) throws IOException { entry.setField(StandardField.FILE, FileFieldWriter.getStringRepresentation(fileField)); filePreferences = mock(FilePreferences.class); - when(filePreferences.isBibLocationAsPrimary()).thenReturn(false); //Biblocation as Primary overwrites all other dirs, therefore we set it to false here + when(filePreferences.isBibLocationAsPrimary()).thenReturn(false); // Biblocation as Primary overwrites all other dirs, therefore we set it to false here cleanup = new MoveFilesCleanup(databaseContext, filePreferences); } diff --git a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java index d60b82a72c3..89393473737 100644 --- a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java @@ -41,7 +41,7 @@ void setUp(@TempDir Path testFolder) { entry.setCiteKey("Toot"); filePreferences = mock(FilePreferences.class); - when(filePreferences.isBibLocationAsPrimary()).thenReturn(true); //Set Biblocation as Primary Directory, otherwise the tmp folders won't be cleaned up correctly + when(filePreferences.isBibLocationAsPrimary()).thenReturn(true); // Set Biblocation as Primary Directory, otherwise the tmp folders won't be cleaned up correctly cleanup = new RenamePdfCleanup(false, context, filePreferences); } diff --git a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java index 01db13290ae..2571926d578 100644 --- a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java +++ b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java @@ -642,8 +642,8 @@ void writeEntriesInOriginalOrderWhenNoSaveOrderConfigIsSetInMetadata() throws Ex " author = {A}," + OS.NEWLINE + " year = {2000}," + OS.NEWLINE + "}" - + OS.NEWLINE - , stringWriter.toString()); + + OS.NEWLINE, + stringWriter.toString()); } @Test diff --git a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java index 3f14e69d66b..d102c01aa39 100644 --- a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java @@ -46,7 +46,7 @@ public void exportSingleEntry(@TempDir Path testFolder) throws Exception { entry.setField(StandardField.AUTHOR, "Alan Turing"); exporter.export(databaseContext, file, encoding, Collections.singletonList(entry)); - String actual = String.join("\n", Files.readAllLines(file)); //we are using \n to join, so we need it in the expected string as well, \r\n would fail + String actual = String.join("\n", Files.readAllLines(file)); // we are using \n to join, so we need it in the expected string as well, \r\n would fail String expected = " \n" + " \n" + " \n" + @@ -79,7 +79,7 @@ public void writeMultipleEntriesInASingleFile(@TempDir Path testFolder) throws E exporter.export(databaseContext, file, encoding, Arrays.asList(entryTuring, entryArmbrust)); - String actual = String.join("\n", Files.readAllLines(file)); //we are using \n to join, so we need it in the expected string as well, \r\n would fail + String actual = String.join("\n", Files.readAllLines(file)); // we are using \n to join, so we need it in the expected string as well, \r\n would fail String expected = " \n" + " \n" + @@ -135,7 +135,7 @@ public void writeMultipleEntriesInDifferentFiles(@TempDir Path testFolder) throw assertEquals(Collections.emptyList(), lines); Path fileTuring = Paths.get(file.getParent().toString() + "/" + entryTuring.getId() + "_null.xmp"); - String actualTuring = String.join("\n", Files.readAllLines(fileTuring)); //we are using \n to join, so we need it in the expected string as well, \r\n would fail + String actualTuring = String.join("\n", Files.readAllLines(fileTuring)); // we are using \n to join, so we need it in the expected string as well, \r\n would fail String expectedTuring = " \n" + " \n" + @@ -156,7 +156,7 @@ public void writeMultipleEntriesInDifferentFiles(@TempDir Path testFolder) throw assertEquals(expectedTuring, actualTuring); Path fileArmbrust = Paths.get(file.getParent().toString() + "/" + entryArmbrust.getId() + "_Armbrust2010.xmp"); - String actualArmbrust = String.join("\n", Files.readAllLines(fileArmbrust)); //we are using \n to join, so we need it in the expected string as well, \r\n would fail + String actualArmbrust = String.join("\n", Files.readAllLines(fileArmbrust)); // we are using \n to join, so we need it in the expected string as well, \r\n would fail String expectedArmbrust = " \n" + " \n" + diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 4925966752c..deec24863c2 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -159,7 +159,7 @@ public void searchByEntryFindsEntry() throws Exception { @Test public void testPerformSearchByFamaeyMcGaughEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); - fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT));//Remove abstract due to copyright + fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright assertEquals(Optional.of(famaeyMcGaughEntry), fetchedEntry); } @@ -177,7 +177,7 @@ public void testPerformSearchByIdInvalidDoi() throws Exception { @Test public void testPerformSearchBySunWelchEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); - fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT)); //Remove abstract due to copyright + fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright assertEquals(Optional.of(sunWelchEntry), fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java index 8cd70f8e345..0330b46340a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java @@ -58,7 +58,7 @@ public void findSingleEntry() throws FetcherException { @Test public void findSingleEntryUsingComplexOperators() throws FetcherException { - String query = "geiger harrer betsy$ softw.trends"; //-wirtz Negative operators do no longer work, see issue https://github.com/JabRef/jabref/issues/2890 + String query = "geiger harrer betsy$ softw.trends"; // -wirtz Negative operators do no longer work, see issue https://github.com/JabRef/jabref/issues/2890 List result = dblpFetcher.performSearch(query); assertEquals(Collections.singletonList(entry), result); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java b/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java index b2a45b5fa42..c5ac3f885d0 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java @@ -108,8 +108,8 @@ void searchResultHasNoKeywordTerms() throws FetcherException { expected.setField(StandardField.TITLE, "Optimal operation of PV-DG-battery based microgrid with power quality conditioner"); expected.setField(StandardField.VOLUME, "13"); - List fetchedEntries = fetcher.performSearch("8636659"); //article number - fetchedEntries.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); //Remove abstract due to copyright); + List fetchedEntries = fetcher.performSearch("8636659"); // article number + fetchedEntries.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright); assertEquals(Collections.singletonList(expected), fetchedEntries); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java index 7ad94a2bfea..ada1b137b35 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -139,35 +139,35 @@ public void testGetHelpPage() { @Test public void testSearchByIDWijedasa() throws Exception { Optional fetchedEntry = fetcher.performSearchById("27670948"); - fetchedEntry.get().clearField(StandardField.ABSTRACT); //Remove abstract due to copyright + fetchedEntry.get().clearField(StandardField.ABSTRACT); // Remove abstract due to copyright assertEquals(Optional.of(entryWijedasa), fetchedEntry); } @Test public void testSearchByIDEndharti() throws Exception { Optional fetchedEntry = fetcher.performSearchById("27670445"); - fetchedEntry.get().clearField(StandardField.ABSTRACT); //Remove abstract due to copyright + fetchedEntry.get().clearField(StandardField.ABSTRACT); // Remove abstract due to copyright assertEquals(Optional.of(entryEndharti), fetchedEntry); } @Test public void testSearchByIDIchikawa() throws Exception { Optional fetchedEntry = fetcher.performSearchById("26197440"); - fetchedEntry.get().clearField(StandardField.ABSTRACT); //Remove abstract due to copyright + fetchedEntry.get().clearField(StandardField.ABSTRACT); // Remove abstract due to copyright assertEquals(Optional.of(bibEntryIchikawa), fetchedEntry); } @Test public void testSearchByIDSari() throws Exception { Optional fetchedEntry = fetcher.performSearchById("26867355"); - fetchedEntry.get().clearField(StandardField.ABSTRACT); //Remove abstract due to copyright + fetchedEntry.get().clearField(StandardField.ABSTRACT); // Remove abstract due to copyright assertEquals(Optional.of(bibEntrySari), fetchedEntry); } @Test public void testMultipleEntries() throws Exception { List entryList = fetcher.performSearch("java"); - entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); //Remove abstract due to copyright); + entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright); assertEquals(50, entryList.size()); assertTrue(entryList.contains(bibEntryIchikawa)); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java index f6d625a49d6..ed083822907 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java @@ -940,9 +940,9 @@ void parseRecognizesMultipleStrings() throws IOException { void parseRecognizesStringAndEntry() throws IOException { ParserResult result = parser.parse( new StringReader("" + "@string{bourdieu = {Bourdieu, Pierre}}" - + "@book{bourdieu-2002-questions-sociologie, " + " Address = {Paris}," + " Author = bourdieu," - + " Isbn = 2707318256," + " Publisher = {Minuit}," + " Title = {Questions de sociologie}," - + " Year = 2002" + "}")); + + "@book{bourdieu-2002-questions-sociologie, " + " Address = {Paris}," + " Author = bourdieu," + + " Isbn = 2707318256," + " Publisher = {Minuit}," + " Title = {Questions de sociologie}," + + " Year = 2002" + "}")); BibtexString parsedString = result.getDatabase().getStringValues().iterator().next(); Collection parsedEntries = result.getDatabase().getEntries(); @@ -1720,7 +1720,7 @@ void parseEntryUsingStringConstantsForTwoAuthorsWithEtAsStringConstant() throws .parseEntries("@String { kopp = \"Kopp, Oliver\" }" + "@String { kubovy = \"Kubovy, Jan\" }" + "@String { et = \" and \" }" + - "@Misc{m1, author = kopp # et # kubovy }" ); + "@Misc{m1, author = kopp # et # kubovy }"); BibEntry expectedEntry = new BibEntry(StandardEntryType.Misc) .withCiteKey("m1") @@ -1736,7 +1736,7 @@ void parseStringConstantsForTwoAuthorsHasCorrectBibTeXEntry() throws ParseExcept .parseEntries("@String { kopp = \"Kopp, Oliver\" }" + "@String { kubovy = \"Kubovy, Jan\" }" + "@String { et = \" and \" }" + - "@Misc{m2, author = kopp # \" and \" # kubovy }" ); + "@Misc{m2, author = kopp # \" and \" # kubovy }"); BibEntry expectedEntry = new BibEntry(StandardEntryType.Misc) .withCiteKey("m2") @@ -1752,42 +1752,42 @@ void parseStringConstantsForTwoAuthors() throws ParseException { .parseEntries("@String { kopp = \"Kopp, Oliver\" }" + "@String { kubovy = \"Kubovy, Jan\" }" + "@String { et = \" and \" }" + - "@Misc{m2, author = kopp # \" and \" # kubovy }" ); + "@Misc{m2, author = kopp # \" and \" # kubovy }"); assertEquals("#kopp# and #kubovy#", parsed.iterator().next().getField(StandardField.AUTHOR).get()); } @Test void textAprilIsParsedAsMonthApril() throws ParseException { - Optional result = parser.parseSingleEntry("@Misc{m, month = \"apr\" }" ); + Optional result = parser.parseSingleEntry("@Misc{m, month = \"apr\" }"); assertEquals(Month.APRIL, result.get().getMonth().get()); } @Test void textAprilIsDisplayedAsConstant() throws ParseException { - Optional result = parser.parseSingleEntry("@Misc{m, month = \"apr\" }" ); + Optional result = parser.parseSingleEntry("@Misc{m, month = \"apr\" }"); assertEquals("apr", result.get().getField(StandardField.MONTH).get()); } @Test void bibTeXConstantAprilIsParsedAsMonthApril() throws ParseException { - Optional result = parser.parseSingleEntry("@Misc{m, month = apr }" ); + Optional result = parser.parseSingleEntry("@Misc{m, month = apr }"); assertEquals(Month.APRIL, result.get().getMonth().get()); } @Test void bibTeXConstantAprilIsDisplayedAsConstant() throws ParseException { - Optional result = parser.parseSingleEntry("@Misc{m, month = apr }" ); + Optional result = parser.parseSingleEntry("@Misc{m, month = apr }"); assertEquals("#apr#", result.get().getField(StandardField.MONTH).get()); } @Test void bibTeXConstantAprilIsParsedAsStringMonthAprilWhenReadingTheField() throws ParseException { - Optional result = parser.parseSingleEntry("@Misc{m, month = apr }" ); + Optional result = parser.parseSingleEntry("@Misc{m, month = apr }"); assertEquals(Optional.of("#apr#"), result.get().getField(StandardField.MONTH)); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java index 23cc0b39912..529d770234e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java @@ -54,7 +54,7 @@ public void equalsWithSameReference() { @Test public void equalsIsBasedOnName() { - //noinspection AssertEqualsBetweenInconvertibleTypes + // noinspection AssertEqualsBetweenInconvertibleTypes assertEquals(new CopacImporter(), importer); } diff --git a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java b/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java index 9b18f96b970..07ca10e2234 100644 --- a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java @@ -71,7 +71,7 @@ void testImportSubGroups() throws Exception { List orderedData = Arrays.asList("0 AllEntriesGroup:", "1 ExplicitGroup:1;0;", "2 ExplicitGroup:2;0;", "0 ExplicitGroup:3;0;"); - //Create group hierarchy: + // Create group hierarchy: // Level 0 Name: All entries // Level 1 Name: 1 // Level 2 Name: 2 diff --git a/src/test/java/org/jabref/logic/l10n/LanguageTest.java b/src/test/java/org/jabref/logic/l10n/LanguageTest.java index 8b583357db9..d821d892548 100644 --- a/src/test/java/org/jabref/logic/l10n/LanguageTest.java +++ b/src/test/java/org/jabref/logic/l10n/LanguageTest.java @@ -17,7 +17,7 @@ void convertKnownLanguageOnly() { @Test void convertKnownLanguageAndCountryCorrect() { - //Language and country code have to be separated see: https://stackoverflow.com/a/3318598 + // Language and country code have to be separated see: https://stackoverflow.com/a/3318598 assertEquals(Optional.of(new Locale("pt", "BR")), Language.convertToSupportedLocale(Language.BRAZILIAN_PORTUGUESE)); } diff --git a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java b/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java index 68c50e17384..558fbfa3adf 100644 --- a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java @@ -87,8 +87,8 @@ void testComplicated5() { @Test void testComplicated6() { - assertEquals("Pchn\\u261a\\u263c w t\\u281e \\u322l\\u243od\\u378z je\\u380za lub o\\u347sm skrzy\\u324n fig" - , formatter.format("Pchnąć w tę łódź jeża lub ośm skrzyń fig")); + assertEquals("Pchn\\u261a\\u263c w t\\u281e \\u322l\\u243od\\u378z je\\u380za lub o\\u347sm skrzy\\u324n fig", + formatter.format("Pchnąć w tę łódź jeża lub ośm skrzyń fig")); } @Test diff --git a/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java b/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java index ef9b22ca158..ccbe19b005c 100644 --- a/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java +++ b/src/test/java/org/jabref/logic/net/MimeTypeDetectorTest.java @@ -1,21 +1,21 @@ package org.jabref.logic.net; /* -import com.github.tomakehurst.wiremock.WireMockServer; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.any; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.head; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class MimeTypeDetectorTest { + import com.github.tomakehurst.wiremock.WireMockServer; + import org.junit.jupiter.api.AfterEach; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + + import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; + import static com.github.tomakehurst.wiremock.client.WireMock.any; + import static com.github.tomakehurst.wiremock.client.WireMock.get; + import static com.github.tomakehurst.wiremock.client.WireMock.head; + import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; + import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; + import static org.junit.jupiter.api.Assertions.assertFalse; + import static org.junit.jupiter.api.Assertions.assertTrue; + + class MimeTypeDetectorTest { private WireMockServer wireMockServer = new WireMockServer(); @@ -105,5 +105,5 @@ void beAbleToUseGetRequest() throws IOException { assertTrue(new URLDownload(mimeTypeVariation).isMimeType("application/pdf")); } -} + } */ diff --git a/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java b/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java index 5ac0ec152a9..e83ace4d707 100644 --- a/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java +++ b/src/test/java/org/jabref/logic/openoffice/StyleLoaderTest.java @@ -135,7 +135,7 @@ public void testInitalizeWithOneExternalFileRemoveStyleUpdatesPreferences() thro for (OOBibStyle style : toremove) { assertTrue(loader.removeStyle(style)); } - //As the prefs are mocked away, the getExternalStyles still returns the initial one + // As the prefs are mocked away, the getExternalStyles still returns the initial one assertFalse(preferences.getExternalStyles().isEmpty()); } diff --git a/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java b/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java index 9230dcc16a7..4f2754d9359 100644 --- a/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java +++ b/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java @@ -33,14 +33,14 @@ public void setUp() { @Test public void readEntryExampleThesis() { - //given + // given entry.setField(StandardField.FILE, ":thesis-example.pdf:PDF"); EntryAnnotationImporter entryAnnotationImporter = new EntryAnnotationImporter(entry); - //when + // when Map> annotations = entryAnnotationImporter.importAnnotationsFromFiles(databaseContext, mock(FilePreferences.class)); - //then + // then int fileCounter = 0; int annotationCounter = 0; for (List annotationsOfFile : annotations.values()) { diff --git a/src/test/java/org/jabref/logic/search/SearchQueryTest.java b/src/test/java/org/jabref/logic/search/SearchQueryTest.java index e8630135ed7..2be23fd98f4 100644 --- a/src/test/java/org/jabref/logic/search/SearchQueryTest.java +++ b/src/test/java/org/jabref/logic/search/SearchQueryTest.java @@ -200,7 +200,7 @@ public void testGetPattern() { String query = "progress"; SearchQuery result = new SearchQuery(query, false, false); Pattern pattern = Pattern.compile("(\\Qprogress\\E)"); - //We can't directly compare the pattern objects + // We can't directly compare the pattern objects assertEquals(Optional.of(pattern.toString()), result.getPatternForWords().map(Pattern::toString)); } @@ -222,7 +222,7 @@ public void testGetRegexpJavascriptPattern() { @Test public void testEscapingInPattern() { - //first word contain all java special regex characters + // first word contain all java special regex characters String queryText = "<([{\\\\^-=$!|]})?*+.> word1 word2."; SearchQuery textQueryWithSpecialChars = new SearchQuery(queryText, false, false); String pattern = "(\\Q<([{\\^-=$!|]})?*+.>\\E)|(\\Qword1\\E)|(\\Qword2.\\E)"; @@ -231,7 +231,7 @@ public void testEscapingInPattern() { @Test public void testEscapingInJavascriptPattern() { - //first word contain all javascript special regex characters that should be escaped individually in text based search + // first word contain all javascript special regex characters that should be escaped individually in text based search String queryText = "([{\\\\^$|]})?*+./ word1 word2."; SearchQuery textQueryWithSpecialChars = new SearchQuery(queryText, false, false); String pattern = "(\\(\\[\\{\\\\\\^\\$\\|\\]\\}\\)\\?\\*\\+\\.\\/)|(word1)|(word2\\.)"; diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java index fe7c59b4263..653f0a11f3e 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java @@ -190,7 +190,7 @@ void testUpdateNewerEntry() { dbmsProcessor.insertEntry(bibEntry); - //simulate older version + // simulate older version bibEntry.getSharedBibEntryData().setVersion(0); bibEntry.setField(StandardField.YEAR, "1993"); @@ -202,7 +202,7 @@ void testUpdateEqualEntry() throws OfflineLockException, SQLException { BibEntry expectedBibEntry = getBibEntryExample(); dbmsProcessor.insertEntry(expectedBibEntry); - //simulate older version + // simulate older version expectedBibEntry.getSharedBibEntryData().setVersion(0); dbmsProcessor.updateEntry(expectedBibEntry); diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java b/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java index 934b8762ed8..dac5e0f92d5 100644 --- a/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java +++ b/src/test/java/org/jabref/logic/shared/SynchronizationTestSimulator.java @@ -69,11 +69,11 @@ public void clear() throws SQLException { @Test public void simulateEntryInsertionAndManualPull() throws Exception { - //client A inserts an entry + // client A inserts an entry clientContextA.getDatabase().insertEntry(getBibEntryExample(1)); - //client A inserts another entry + // client A inserts another entry clientContextA.getDatabase().insertEntry(getBibEntryExample(2)); - //client B pulls the changes + // client B pulls the changes clientContextB.getDBMSSynchronizer().pullChanges(); assertEquals(clientContextA.getDatabase().getEntries(), clientContextB.getDatabase().getEntries()); @@ -97,18 +97,18 @@ public void simulateEntryUpdateAndManualPull() throws Exception { @Test public void simulateEntryDelitionAndManualPull() throws Exception { BibEntry bibEntry = getBibEntryExample(1); - //client A inserts an entry + // client A inserts an entry clientContextA.getDatabase().insertEntry(bibEntry); - //client B pulls the entry + // client B pulls the entry clientContextB.getDBMSSynchronizer().pullChanges(); assertFalse(clientContextA.getDatabase().getEntries().isEmpty()); assertFalse(clientContextB.getDatabase().getEntries().isEmpty()); assertEquals(clientContextA.getDatabase().getEntries(), clientContextB.getDatabase().getEntries()); - //client A removes the entry + // client A removes the entry clientContextA.getDatabase().removeEntry(bibEntry); - //client B pulls the change + // client B pulls the change clientContextB.getDBMSSynchronizer().pullChanges(); assertTrue(clientContextA.getDatabase().getEntries().isEmpty()); @@ -118,21 +118,21 @@ public void simulateEntryDelitionAndManualPull() throws Exception { @Test public void simulateUpdateOnNoLongerExistingEntry() throws Exception { BibEntry bibEntryOfClientA = getBibEntryExample(1); - //client A inserts an entry + // client A inserts an entry clientContextA.getDatabase().insertEntry(bibEntryOfClientA); - //client B pulls the entry + // client B pulls the entry clientContextB.getDBMSSynchronizer().pullChanges(); assertFalse(clientContextA.getDatabase().getEntries().isEmpty()); assertFalse(clientContextB.getDatabase().getEntries().isEmpty()); assertEquals(clientContextA.getDatabase().getEntries(), clientContextB.getDatabase().getEntries()); - //client A removes the entry + // client A removes the entry clientContextA.getDatabase().removeEntry(bibEntryOfClientA); assertFalse(clientContextB.getDatabase().getEntries().isEmpty()); assertNull(eventListenerB.getSharedEntriesNotPresentEvent()); - //client B tries to update the entry + // client B tries to update the entry BibEntry bibEntryOfClientB = clientContextB.getDatabase().getEntries().get(0); bibEntryOfClientB.setField(StandardField.YEAR, "2009"); diff --git a/src/test/java/org/jabref/logic/util/JavaVersionTest.java b/src/test/java/org/jabref/logic/util/JavaVersionTest.java index 443b404f803..662549e4364 100644 --- a/src/test/java/org/jabref/logic/util/JavaVersionTest.java +++ b/src/test/java/org/jabref/logic/util/JavaVersionTest.java @@ -20,12 +20,12 @@ public class JavaVersionTest { java.add("1.6.0_10"); // Oracle java.add("1.6.0_45"); // Oracle java.add("1.7.0_13"); // Oracle - java.add("1.8.0_76-release"); //openjdk - java.add("1.8.0_92"); //Oracle - java.add("1.8.0_111"); //Oracle - java.add("1.8.0_112-release"); //openjdk - java.add("1.8.0_152-release"); //openjdk - java.add("1.8.0_144"); //Oracle + java.add("1.8.0_76-release"); // openjdk + java.add("1.8.0_92"); // Oracle + java.add("1.8.0_111"); // Oracle + java.add("1.8.0_112-release"); // openjdk + java.add("1.8.0_152-release"); // openjdk + java.add("1.8.0_144"); // Oracle // Examples http://openjdk.java.net/jeps/223 // Note that it might be possible that java 9 versions are either 9.1.4+8 or new style 1.9.0_31-b08 diff --git a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java index 8110322183c..b1a2ff97ae7 100644 --- a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java +++ b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTests.java @@ -46,7 +46,7 @@ public void setUp() { @Test public void testFindFiles() throws Exception { - //given + // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInDatabase"); localEntry.setField(StandardField.YEAR, "2001"); @@ -56,33 +56,33 @@ public void testFindFiles() throws Exception { List dirs = Collections.singletonList(Paths.get(FILES_DIRECTORY)); RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("**/[bibtexkey].*\\\\.[extension]", ','); - //when + // when List result = fileFinder.findAssociatedFiles(localEntry, dirs, extensions); - //then + // then assertEquals(Collections.singletonList(Paths.get("src/test/resources/org/jabref/logic/importer/unlinkedFilesTestFolder/pdfInDatabase.pdf")), result); } @Test public void testYearAuthFirspageFindFiles() throws Exception { - //given + // given List extensions = Collections.singletonList("pdf"); List dirs = Collections.singletonList(Paths.get(FILES_DIRECTORY)); RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("**/[year]_[auth]_[firstpage].*\\\\.[extension]", ','); - //when + // when List result = fileFinder.findAssociatedFiles(entry, dirs, extensions); - //then + // then assertEquals(Collections.singletonList(Paths.get("src/test/resources/org/jabref/logic/importer/unlinkedFilesTestFolder/directory/subdirectory/2003_Hippel_209.pdf")), result); } @Test public void testAuthorWithDiacritics() throws Exception { - //given + // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("Grazulis2017"); localEntry.setField(StandardField.YEAR, "2017"); @@ -94,17 +94,17 @@ public void testAuthorWithDiacritics() throws Exception { List dirs = Collections.singletonList(Paths.get(FILES_DIRECTORY)); RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("**/[year]_[auth]_[firstpage]\\\\.[extension]", ','); - //when + // when List result = fileFinder.findAssociatedFiles(localEntry, dirs, extensions); - //then + // then assertEquals(Collections.singletonList(Paths.get("src/test/resources/org/jabref/logic/importer/unlinkedFilesTestFolder/directory/subdirectory/2017_Gražulis_726.pdf")), result); } @Test public void testFindFileInSubdirectory() throws Exception { - //given + // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInSubdirectory"); localEntry.setField(StandardField.YEAR, "2017"); @@ -114,17 +114,17 @@ public void testFindFileInSubdirectory() throws Exception { List dirs = Collections.singletonList(Paths.get(FILES_DIRECTORY)); RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("**/[bibtexkey].*\\\\.[extension]", ','); - //when + // when List result = fileFinder.findAssociatedFiles(localEntry, dirs, extensions); - //then + // then assertEquals(Collections.singletonList(Paths.get("src/test/resources/org/jabref/logic/importer/unlinkedFilesTestFolder/directory/subdirectory/pdfInSubdirectory.pdf")), result); } @Test public void testFindFileNonRecursive() throws Exception { - //given + // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCiteKey("pdfInSubdirectory"); localEntry.setField(StandardField.YEAR, "2017"); @@ -134,10 +134,10 @@ public void testFindFileNonRecursive() throws Exception { List dirs = Collections.singletonList(Paths.get(FILES_DIRECTORY)); RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("*/[bibtexkey].*\\\\.[extension]", ','); - //when + // when List result = fileFinder.findAssociatedFiles(localEntry, dirs, extensions); - //then + // then assertTrue(result.isEmpty()); } diff --git a/src/test/java/org/jabref/model/TreeNodeTestData.java b/src/test/java/org/jabref/model/TreeNodeTestData.java index c4f669ec9a6..0df7c6f3553 100644 --- a/src/test/java/org/jabref/model/TreeNodeTestData.java +++ b/src/test/java/org/jabref/model/TreeNodeTestData.java @@ -61,7 +61,7 @@ public static TreeNodeMock getNodeAsChild(TreeNodeMock root) { } /** - * This is just a dummy class deriving from TreeNode so that we can test the generic class + * This is just a dummy class deriving from TreeNode<T> so that we can test the generic class */ public static class TreeNodeMock extends TreeNode { diff --git a/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java b/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java index 47adb50271d..4947265355b 100644 --- a/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java +++ b/src/test/java/org/jabref/model/entry/AuthorListParameterTest.java @@ -15,8 +15,8 @@ private static Stream data() { Arguments.of("王, 军", new Author("军", "军.", null, "王", null)), Arguments.of("Doe, John", new Author("John", "J.", null, "Doe", null)), Arguments.of("von Berlichingen zu Hornberg, Johann Gottfried", new Author("Johann Gottfried", "J. G.", "von", "Berlichingen zu Hornberg", null)), - //Arguments.of("Robert and Sons, Inc.", new Author(null, null, null, "Robert and Sons, Inc.", null))), - //Arguments.of("al-Ṣāliḥ, Abdallāh", new Author("Abdallāh", "A.", null, "al-Ṣāliḥ", null))), + // Arguments.of("Robert and Sons, Inc.", new Author(null, null, null, "Robert and Sons, Inc.", null))), + // Arguments.of("al-Ṣāliḥ, Abdallāh", new Author("Abdallāh", "A.", null, "al-Ṣāliḥ", null))), Arguments.of("de la Vallée Poussin, Jean Charles Gabriel", new Author("Jean Charles Gabriel", "J. C. G.", "de la", "Vallée Poussin", null)), Arguments.of("de la Vallée Poussin, J. C. G.", new Author("J. C. G.", "J. C. G.", "de la", "Vallée Poussin", null)), Arguments.of("{K}ent-{B}oswell, E. S.", new Author("E. S.", "E. S.", null, "{K}ent-{B}oswell", null)), diff --git a/src/test/java/org/jabref/model/entry/AuthorListTest.java b/src/test/java/org/jabref/model/entry/AuthorListTest.java index 0916af571f0..77bb79b5b7d 100644 --- a/src/test/java/org/jabref/model/entry/AuthorListTest.java +++ b/src/test/java/org/jabref/model/entry/AuthorListTest.java @@ -606,7 +606,7 @@ public void createCorrectInitials() { @Test public void parseNameWithBracesAroundFirstName() throws Exception { - //TODO: Be more intelligent and abbreviate the first name correctly + // TODO: Be more intelligent and abbreviate the first name correctly Author expected = new Author("Tse-tung", "{Tse-tung}.", null, "Mao", null); assertEquals(new AuthorList(expected), AuthorList.parse("{Tse-tung} Mao")); } diff --git a/src/test/java/org/jabref/testutils/TestUtils.java b/src/test/java/org/jabref/testutils/TestUtils.java index 3c03bfa2714..d79fa08bab0 100644 --- a/src/test/java/org/jabref/testutils/TestUtils.java +++ b/src/test/java/org/jabref/testutils/TestUtils.java @@ -22,6 +22,7 @@ public static void initJabRef() { */ public static void closeJabRef() { if (JabRefGUI.getMainFrame() != null) { + // TODO } } } diff --git a/src/test/java/org/jabref/testutils/category/FetcherTest.java b/src/test/java/org/jabref/testutils/category/FetcherTest.java index 5e833e1ca48..3bcbbcc84e9 100644 --- a/src/test/java/org/jabref/testutils/category/FetcherTest.java +++ b/src/test/java/org/jabref/testutils/category/FetcherTest.java @@ -13,5 +13,5 @@ @Inherited @Tag("FetcherTest") public @interface FetcherTest { - //empty + // empty } diff --git a/src/test/java/org/jabref/testutils/category/GUITest.java b/src/test/java/org/jabref/testutils/category/GUITest.java index c166c80a328..8add1b3eda8 100644 --- a/src/test/java/org/jabref/testutils/category/GUITest.java +++ b/src/test/java/org/jabref/testutils/category/GUITest.java @@ -13,5 +13,5 @@ @Inherited @Tag("GUITest") public @interface GUITest { - //empty + // empty }