diff --git a/src/main/java/org/jabref/cli/JabRefCLI.java b/src/main/java/org/jabref/cli/JabRefCLI.java index 524f4f0d2778..c0fd87d72042 100644 --- a/src/main/java/org/jabref/cli/JabRefCLI.java +++ b/src/main/java/org/jabref/cli/JabRefCLI.java @@ -28,7 +28,7 @@ public class JabRefCLI { 100; // Number of characters per line before a line break must be added. private static final String WRAPPED_LINE_PREFIX = ""; // If a line break is added, this prefix will be inserted at the beginning of the - // next line + // next line private static final String STRING_TABLE_DELIMITER = " : "; private final CommandLine cl; diff --git a/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java b/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java index ddf4e33a9950..24d5a504f54d 100644 --- a/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java +++ b/src/main/java/org/jabref/gui/ai/components/aichat/AiChatComponent.java @@ -226,7 +226,7 @@ private List updateNotificationsForEntry(BibEntry entry) { assert ingestionStatus .getException() .isPresent(); // When the state is ERROR, the exception - // must be present. + // must be present. notifications.add( new Notification( diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java index 9b8ab9070f9c..bea283b5d1b8 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java @@ -50,10 +50,8 @@ public final Collection provideSuggestions(ISuggestionRequest request) { Equivalence equivalence = getEquivalence(); return getSource() .filter(candidate -> isMatch(candidate, request)) - .map( - equivalence - ::wrap) // Need to do a bit of acrobatic as there is no - // distinctBy method + .map(equivalence::wrap) // Need to do a bit of acrobatic as there is no + // distinctBy method .distinct() .limit(10) .map(Equivalence.Wrapper::get) @@ -70,10 +68,8 @@ public List getPossibleSuggestions() { Comparator comparator = getComparator().reversed(); Equivalence equivalence = getEquivalence(); return getSource() - .map( - equivalence - ::wrap) // Need to do a bit of acrobatic as there is no distinctBy - // method + .map(equivalence::wrap) // Need to do a bit of acrobatic as there is no distinctBy + // method .distinct() .map(Equivalence.Wrapper::get) .sorted(comparator) diff --git a/src/main/java/org/jabref/gui/desktop/os/Linux.java b/src/main/java/org/jabref/gui/desktop/os/Linux.java index 503683f426d9..976a0dc6a409 100644 --- a/src/main/java/org/jabref/gui/desktop/os/Linux.java +++ b/src/main/java/org/jabref/gui/desktop/os/Linux.java @@ -138,7 +138,7 @@ public void openFolderAndSelectFile(Path filePath) throws IOException { new String[] { "nemo", absoluteFilePath }; // Although nemo is based on nautilus it does not support --select, it - // directly highlights the file + // directly highlights the file } else if (desktopSession.contains("xfce")) { cmd = new String[] {"thunar", absoluteFilePath}; } diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index 4e8771b12d3e..a0e93ad33126 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -159,7 +159,7 @@ private void export( fileDirForDatabase, abbreviationRepository); return null; // can not use BackgroundTask.wrap(Runnable) because - // Runnable.run() can't throw Exceptions + // Runnable.run() can't throw Exceptions }) .onSuccess( save -> { diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java b/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java index aa59e7d83dd8..5000581f608a 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java @@ -47,8 +47,8 @@ default void establishBinding( if (e.getEventType() == KeyEvent .KEY_PRESSED // if not checked, it will be fired twice: - // once for key pressed and once for key - // released + // once for key pressed and once for key + // released && e.isShortcutDown()) { if (keyBindingRepository.matches(e, KeyBinding.UNDO)) { undoAction.execute(); diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index a775b34edc50..909890d0ab3e 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -220,7 +220,7 @@ private Node createFileDisplay(LinkedFileViewModel linkedFile) { HBox.setHgrow(info, Priority.ALWAYS); info.setStyle( "-fx-padding: 0.5em 0 0.5em 0;"); // To align with buttons below which also have - // 0.5em padding + // 0.5em padding info.getChildren().setAll(label, progressIndicator); Button acceptAutoLinkedFile = IconTheme.JabRefIcons.AUTO_LINKED_FILE.asButton(); diff --git a/src/main/java/org/jabref/gui/frame/JabRefFrame.java b/src/main/java/org/jabref/gui/frame/JabRefFrame.java index 97ee79081a75..e049620ee421 100644 --- a/src/main/java/org/jabref/gui/frame/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/frame/JabRefFrame.java @@ -381,7 +381,7 @@ private void initKeyBindings() { break; case PASTE: if (OS.OS_X) { // Workaround for a jdk issue that executes paste - // twice when using cmd+v in a TextField + // twice when using cmd+v in a TextField // Extra workaround for CodeArea, which does not inherit from // TextInputControl if (!(stateManager.getFocusOwner().isPresent() @@ -492,7 +492,7 @@ private void initBindings() { libraryTab.textProperty().getValue() + " – " + FRAME_TITLE, // not a minus, but codepoint - // 2013 + // 2013 libraryTab.textProperty()); mainStage.titleProperty().bind(windowTitle); }); diff --git a/src/main/java/org/jabref/gui/frame/MainMenu.java b/src/main/java/org/jabref/gui/frame/MainMenu.java index f9cee5a14c63..c2b623b70c3e 100644 --- a/src/main/java/org/jabref/gui/frame/MainMenu.java +++ b/src/main/java/org/jabref/gui/frame/MainMenu.java @@ -641,7 +641,7 @@ StandardActions.PARSE_LATEX, new ParseLatexAction(stateManager)), stateManager, (UiTaskExecutor) taskExecutor)), // we know at this point that this - // is a UITaskExecutor + // is a UITaskExecutor new SeparatorMenuItem(), createSendSubMenu(factory, dialogService, stateManager, preferences), pushToApplicationMenuItem, diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java index 6552b4493f71..72bf5d7db089 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java @@ -924,9 +924,8 @@ public void guiActionUpdateDocument(List databases, OOStyle style) syncOptions .setUpdateBibliography(true) .setAlwaysAddCitedOnPages( - this - .alwaysAddCitedOnPages); // TODO: Provide option to - // user: this is always false + this.alwaysAddCitedOnPages); // TODO: Provide option to + // user: this is always false unresolvedKeys = Update.synchronizeDocument( diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java index 2f2b50d8e4ba..958a1e169671 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java @@ -212,10 +212,9 @@ private void initialize() { availableListView.setOnMouseClicked( event -> { if (event.getClickCount() == 2) { - viewModel - .handleCslStyleSelection(); // Only CSL styles can be selected with - // a double click, JStyles show a style - // description instead + viewModel.handleCslStyleSelection(); // Only CSL styles can be selected with + // a double click, JStyles show a style + // description instead this.setResult(viewModel.getSelectedStyle()); this.close(); } diff --git a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java index 88107f7e7b97..70a00213cf5a 100644 --- a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java @@ -70,7 +70,7 @@ public class AiTabViewModel implements PreferenceTabViewModel { private final BooleanProperty disableApiBaseUrl = new SimpleBooleanProperty( true); // {@link HuggingFaceChatModel} and {@link GoogleAiGeminiChatModel} - // doesn't support setting API base URL + // doesn't support setting API base URL private final StringProperty openAiApiBaseUrl = new SimpleStringProperty(); private final StringProperty mistralAiApiBaseUrl = new SimpleStringProperty(); diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 9c8bb91f4519..6ddda201dd78 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -28,10 +28,10 @@ public abstract class AbstractPushToApplication implements PushToApplication { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPushToApplication.class); protected boolean couldNotCall; // Set to true in case the command could not be executed, e.g., if the - // file is not found + // file is not found protected boolean couldNotPush; // Set to true in case the tunnel to the program (if one is used) does not - // operate + // operate protected boolean notDefined; // Set to true if the corresponding path is not defined in the preferences diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index 6549b76c9a3a..7fc48817dfdc 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -83,10 +83,8 @@ public void pushEntries( if (!commandPath.endsWith(".in")) { commandPath = commandPath + ".in"; } - File lp = - new File( - commandPath); // this needs to fixed because it gives "asdf" when going - // prefs.get("lyxpipe") + File lp = new File(commandPath); // this needs to fixed because it gives "asdf" when going + // prefs.get("lyxpipe") if (!lp.exists() || !lp.canWrite()) { // See if it helps to append ".in": lp = new File(commandPath + ".in"); diff --git a/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java b/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java index db3d94005a82..caaec8776ca4 100644 --- a/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java +++ b/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java @@ -130,7 +130,7 @@ protected void crawl() { () -> { crawler.performCrawl(); return 0; // Return any value to make this a callable instead of a - // runnable. This allows throwing exceptions. + // runnable. This allows throwing exceptions. }) .onFailure( e -> { diff --git a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java index cdd9d2012ca5..5c8e503ba31c 100644 --- a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java +++ b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java @@ -70,7 +70,7 @@ 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 + // deleted in the meantime initialDirectory = null; } else { // Dir must be a folder, not a file if (!Files.isDirectory(directory)) { diff --git a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java index 8afef1ca75e6..3721697a109e 100644 --- a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java +++ b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java @@ -129,10 +129,8 @@ private String formatAndResolveStrings(String content, Field field) if (pos2 == -1) { if (neverFailOnHashes) { - pos1 = - content - .length(); // just write out the rest of the text, and throw no - // exception + pos1 = content.length(); // just write out the rest of the text, and throw no + // exception } else { LOGGER.error( "The character {} is not allowed in BibTeX strings unless escaped as in '\\{}'. " diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java index 33eff05d057b..6fc39941ec3c 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java +++ b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java @@ -158,9 +158,8 @@ public Document getDOMrepresentation() { row, getField( e, - StandardField - .AUTHOR)); // new AuthorLastFirst().format(getField(e, - // StandardField.AUTHOR_FIELD))); + 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)); @@ -171,9 +170,8 @@ public Document getDOMrepresentation() { row, getField( e, - StandardField - .EDITOR)); // new AuthorLastFirst().format(getField(e, - // StandardField.EDITOR_FIELD))); + 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)); diff --git a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java index d2a6e932651e..40942fa71694 100644 --- a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java +++ b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java @@ -230,7 +230,7 @@ public void export( if (entries .isEmpty()) { // Do not export if no entries to export -- avoids exports with only - // template text + // template text return; } 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 0d138841bd5f..e5e0f3579ed7 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java @@ -58,7 +58,7 @@ public String format(String oldString) { .matcher(newValue) .replaceAll( "\\$$1"); // Move numbers, possibly with operators +, -, or /, left - // of $ into the equation + // of $ into the equation newValue = MOVE_NUMBERS_RIGHT_INTO_EQUATION .matcher(newValue) @@ -72,9 +72,8 @@ public String format(String oldString) { newValue = ESCAPE_PERCENT_SIGN_ONCE .matcher(newValue) - .replaceAll( - "$1\\\\%"); // escape %, but do not escapee \% again, used for - // comments in TeX + .replaceAll("$1\\\\%"); // escape %, but do not escapee \% again, used for + // comments in TeX return newValue; } 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 fae2f36dc82a..239c53bd3bdc 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java @@ -230,7 +230,7 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS lineIndex = 0; // to prevent array index out of bounds exception on second run we need to reset - // i to zero + // i to zero proceedToNextNonEmptyLine(); if (lineIndex >= lines.length) { @@ -385,9 +385,8 @@ Optional getEntryFromPDFContent(String firstpageContents, String lineS if (posWithEditor > curString.length()) { curString = curString.substring( - posWithEditor - - 2); // we don't have any spaces after Eds so we - // substract the 2 + 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/net/ssl/TrustStoreManager.java b/src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java index c19711480da3..c0993a6cf055 100644 --- a/src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java +++ b/src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java @@ -215,9 +215,8 @@ private static X509TrustManager findDefaultTrustManager(KeyStore keyStore) throws NoSuchAlgorithmException, KeyStoreException { TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init( - keyStore); // If keyStore is null, tmf will be initialized with the default trust - // store + tmf.init(keyStore); // If keyStore is null, tmf will be initialized with the default trust + // store for (TrustManager tm : tmf.getTrustManagers()) { if (tm instanceof X509TrustManager manager) { diff --git a/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java b/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java index 0d14f577c8f0..378eb661bcf1 100644 --- a/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java +++ b/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java @@ -64,11 +64,8 @@ private List parseFileField(BibEntry entry) { Objects.requireNonNull(entry); return entry.getFiles().stream() - .filter( - file -> - !file - .isOnlineLink()) // Do not query external file links (huge - // performance leak) + .filter(file -> !file.isOnlineLink()) // Do not query external file links (huge + // performance leak) .map(file -> file.findIn(possibleFilePaths)) .filter(Optional::isPresent) .map(Optional::get) diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java index f616c4414872..663916e08fc2 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java @@ -33,7 +33,7 @@ public XmpUtilReader() { System.setProperty( "sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); // To get higher rendering speed on java - // 8 oder 9 for images + // 8 oder 9 for images } /** diff --git a/src/main/java/org/jabref/model/ChainNode.java b/src/main/java/org/jabref/model/ChainNode.java index 9fce9b8c9f37..ffcaf9669d4e 100644 --- a/src/main/java/org/jabref/model/ChainNode.java +++ b/src/main/java/org/jabref/model/ChainNode.java @@ -23,7 +23,7 @@ */ @SuppressWarnings( "unchecked") // We use some explicit casts of the form "(T) this". The constructor ensures - // that this cast is valid. +// that this cast is valid. public abstract class ChainNode> { /** diff --git a/src/main/java/org/jabref/model/entry/Date.java b/src/main/java/org/jabref/model/entry/Date.java index 726afeb6e898..41ffe94f0d81 100644 --- a/src/main/java/org/jabref/model/entry/Date.java +++ b/src/main/java/org/jabref/model/entry/Date.java @@ -87,7 +87,7 @@ public class Date { + // covers YYYY.MM.DD, YYYY.M.DD, YYYY.MM.D, YYYY.M.D "(January|February|March|April|May|June|July|August|September|" + "October|November|December) \\d{1,2}, \\d{4}"; // covers Month DD, YYYY & - // Month D, YYYY + // Month D, YYYY } private final TemporalAccessor date; @@ -197,7 +197,7 @@ public static Optional parse(String dateString) { "\\d{1,4}-\\d{1,2} BC/\\d{1,4}-\\d{1,2} BC|" + // 5 AD/10 AD and 0005 AD/0010 AD "\\d{1,4}-\\d{1,2} AD/\\d{1,4}-\\d{1,2} AD" // 5 AD/10 AD and 0005 AD/0010 - // AD + // AD )) { try { String[] strDates = dateString.split("/"); @@ -220,7 +220,7 @@ public static Optional parse(String dateString) { "\\d{1,4}-\\d{1,2} BC / \\d{1,4}-\\d{1,2} BC|" + // 5 AD/10 AD and 0005 AD/0010 AD "\\d{1,4}-\\d{1,2} AD / \\d{1,4}-\\d{1,2} AD" // 5 AD/10 AD and 0005 AD/0010 - // AD + // AD )) { try { String[] strDates = dateString.split(" / "); 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 1f04c8d5a851..06c95a281a99 100644 --- a/src/main/java/org/jabref/model/entry/identifier/DOI.java +++ b/src/main/java/org/jabref/model/entry/identifier/DOI.java @@ -50,32 +50,30 @@ public class DOI implements Identifier { + "(?:\\.[0-9]+)+" // registrant codes + "[/:]" // divider + "(?:[^\\s,]+[^,;(\\.\\s)])" // suffix alphanumeric without " "/"," and not - // ending on "."/","/";" + // ending on "."/","/";" + ")"; // end group \1 // Regex (Short DOI) private static final String SHORT_DOI_SHORTCUT = - "" - + "^\\s*(?:https?://)?(?:www\\.)?(?:doi\\.org/)([a-z0-9]{4,10})\\s*$"; // eg - // https://doi.org/bfrhmx + "" + "^\\s*(?:https?://)?(?:www\\.)?(?:doi\\.org/)([a-z0-9]{4,10})\\s*$"; // eg + // https://doi.org/bfrhmx private static final String IN_TEXT_SHORT_DOI_SHORTCUT = - "" - + "(?:https?://)?(?:www\\.)?(?:doi\\.org/)([a-z0-9]{4,10})"; // eg - // https://doi.org/bfrhmx somewhere in the text + "" + "(?:https?://)?(?:www\\.)?(?:doi\\.org/)([a-z0-9]{4,10})"; // eg + // https://doi.org/bfrhmx somewhere in the text private static final String SHORT_DOI_EXP_PREFIX = "" + "^(?:" // can begin with... + "\\s*(?:https?://)?(?:www\\.)?" // optional url parts "http(s)://"+"www." + "[a-zA-Z\\.]*doi[a-zA-Z\\.]*" // eg "dx.doi." or "doi.acm." or "doi." if with - // url, must include "doi", otherwise too - // ambiguous + // url, must include "doi", otherwise too + // ambiguous + "\\.[a-zA-Z]{2,10}/)?"; // ".org" or ".de" or ".academy" private static final String SHORT_DOI_EXP = "" + "(?:" // begin "any one of these" + "(?:[\\s/]?(?:(?:urn:)|(?:doi:)|(?:urn:doi:)))" // "doi:10/12ab" or " - // urn:10/12ab" or - // "/urn:doi:/10/12ab" ... + // urn:10/12ab" or + // "/urn:doi:/10/12ab" ... + "|(?:\\s?/?)" // or "/10/12ab" or " /10/12ab" or "10/12ab" or " 10/12ab" + ")" // end "any one of these" + "(" // begin group \1 @@ -90,10 +88,10 @@ public class DOI implements Identifier { + "(?:(?:www\\.)?doi\\.org/)" // either doi.org + "|" // or any of the following with doi.org or not... + "(?:(?:doi.org/)?(?:(?:urn:)|(?:doi:)|(?:urn:doi:)))" // "doi:10/12ab" or " - // urn:10/12ab" or - // "/urn:doi:/10/12ab" - // or - // "doi.org/doi:10/12ab"... + // urn:10/12ab" or + // "/urn:doi:/10/12ab" + // or + // "doi.org/doi:10/12ab"... + ")" // end "any one of these" + "(" // begin group \1 + "10" // directory indicator diff --git a/src/main/java/org/jabref/model/strings/StringUtil.java b/src/main/java/org/jabref/model/strings/StringUtil.java index 559b64311906..626946c592cc 100644 --- a/src/main/java/org/jabref/model/strings/StringUtil.java +++ b/src/main/java/org/jabref/model/strings/StringUtil.java @@ -540,10 +540,8 @@ public static String stripNonValidXMLCharacters(String in) { char current; // Used to reference the current character. for (int i = 0; i < in.length(); i++) { - current = - in.charAt( - i); // NOTE: No IndexOutOfBoundsException caught here; it should not - // happen. + current = in.charAt(i); // NOTE: No IndexOutOfBoundsException caught here; it should not + // happen. if ((current == 0x9) || (current == 0xA) || (current == 0xD) diff --git a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java index b7cd0749392e..4e5e63a0184e 100644 --- a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java @@ -64,31 +64,31 @@ void setUp() { "findString={0}, replaceString={1}, fieldString={2}, selectOnly={3}, allFieldReplace={4}, expectedResult={5}") @CsvSource({ "randomText, replaceText, author, TRUE, FALSE, 0", // does not replace when findString does - // not exist in the selected field + // not exist in the selected field "Informatics, replaceText, randomField, TRUE, FALSE, 0", // does not replace if the BibEntry - // does not have selected field + // does not have selected field "Informatics, replaceText, journaltitle, TRUE, FALSE, 1", // replace "Informatics" in the - // JOURNALTITLE field to - // "replaceText" in the BibEntry + // JOURNALTITLE field to + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, TRUE, TRUE, 1", // replace "Informatics" in the - // JOURNALTITLE field to - // "replaceText" in the BibEntry + // JOURNALTITLE field to + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, FALSE, FALSE, 1", // replace "Informatics" in the - // JOURNALTITLE field to - // "replaceText" in the BibEntry + // JOURNALTITLE field to + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, FALSE, TRUE, 1", // replace "Informatics" in the - // JOURNALTITLE field to - // "replaceText" in the BibEntry + // JOURNALTITLE field to + // "replaceText" in the BibEntry "2020, 2021, date, TRUE, FALSE, 1", // only replace "2020" in the DATE field to "2021" in - // the BibEntry + // the BibEntry "2020, 2021, date, FALSE, TRUE, 2", // replace all the "2020"s in the entries "2020, 2021, date, FALSE, FALSE, 1", // only replace "2020" in the DATE field to "2021" in - // the BibEntry + // the BibEntry "2020, 2021, date, TRUE, TRUE, 2", // replace all the "2020"s in the entries "System, replaceText, title, FALSE, TRUE, 1", // replace "System" in all entries is - // case-sensitive + // case-sensitive "and, '', author, TRUE, FALSE, 2", // replace two "and"s with empty string in the same - // AUTHOR field + // AUTHOR field "' ', ',', date, TRUE, FALSE, 1" // replace space with comma in DATE field }) void replace( diff --git a/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java b/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java index 3dbfa1a8958b..55b2541cbf9e 100644 --- a/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java @@ -226,7 +226,7 @@ void handleDuplicatesKeepBothTest() { .getEntries() .contains( duplicateEntry)); // Assert that the duplicate entry is still in the - // database + // database assertEquals(testEntry, result); // Assert that the original entry is returned } @@ -283,9 +283,8 @@ void handleDuplicatesKeepMergeTest() { assertFalse( bibDatabase .getEntries() - .contains( - duplicateEntry)); // Assert that the duplicate entry was removed - // from the database + .contains(duplicateEntry)); // Assert that the duplicate entry was removed + // from the database assertEquals(mergedEntry, result); // Assert that the merged entry is returned } } diff --git a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java index a01c3ff91480..653d51dba392 100644 --- a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java @@ -65,7 +65,7 @@ void setUp(@TempDir Path bibFolder) throws IOException { when(filePreferences.shouldStoreFilesRelativeToBibFile()) .thenReturn( false); // Biblocation as Primary overwrites all other dirs, therefore we - // set it to false here + // 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 004c49043b8f..52b439b0f4e1 100644 --- a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java @@ -48,7 +48,7 @@ void setUp(@TempDir Path testFolder) { when(filePreferences.shouldStoreFilesRelativeToBibFile()) .thenReturn( true); // Set Biblocation as Primary Directory, otherwise the tmp folders - // won't be cleaned up correctly + // won't be cleaned up correctly cleanup = new RenamePdfCleanup(false, context, filePreferences); } diff --git a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java index 0c7e20cef71f..db7272185542 100644 --- a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java @@ -45,7 +45,7 @@ void exportSingleEntry(@TempDir Path testFolder) throws Exception { "\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 as well, \r\n would fail String expected = """ @@ -87,7 +87,7 @@ void writeMultipleEntriesInASingleFile(@TempDir Path testFolder) throws Exceptio "\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 as well, \r\n would fail String expected = """ diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java index a9a45d4e7c91..4bda6577bcd5 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java @@ -40,25 +40,25 @@ void formatExample() { "{U}pp{e}r, {U}pp{e}r", // single word correct with {} "{U}PP{E}R, {U}pp{E}r", // single word upper case with {} "upper each {NOT} first, Upper Each {NOT} First", // multiple words lower case with - // {} + // {} "Upper {E}ach {NOT} First, Upper {E}ach {NOT} First", // multiple words correct with - // {} + // {} "UPPER {E}ACH {NOT} FIRST, Upper {E}ach {NOT} First", // multiple words upper case - // with {} + // with {} "upper each first {NOT} {this}, Upper Each First {NOT} {this}", // multiple words in - // lower and upper - // case with {} + // lower and upper + // case with {} "upper each first {N}OT {t}his, Upper Each First {N}ot {t}his", // multiple words in - // lower and upper - // case with {} part - // 2 + // lower and upper + // case with {} part + // 2 "upper-each-first, Upper-Each-First", // multiple words lower case with - "Upper-Each-First, Upper-Each-First", // multiple words correct with - "Upper-each-First, Upper-Each-First", // multiple words in lower and upper case with - // - + // - "UPPER-EACH-FIRST, Upper-Each-First", // multiple words upper case with - "{u}pper-each-{f}irst, {u}pper-Each-{f}irst", // multiple words lower case with {} - // and - + // and - "-upper, -Upper", // single word with - "-{u}pper, -{u}pper", // single word with {} and - }) 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 5d48e9728ec7..8377fba87acc 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java @@ -72,8 +72,8 @@ void findSingleEntry() throws FetcherException { 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 + // see issue + // https://github.com/JabRef/jabref/issues/2890 List result = dblpFetcher.performSearch(query); assertEquals(Collections.singletonList(entry), result);