diff --git a/src/jmh/java/org/jabref/benchmarks/Benchmarks.java b/src/jmh/java/org/jabref/benchmarks/Benchmarks.java index aece8161760..35cee5a10f3 100644 --- a/src/jmh/java/org/jabref/benchmarks/Benchmarks.java +++ b/src/jmh/java/org/jabref/benchmarks/Benchmarks.java @@ -1,13 +1,5 @@ package org.jabref.benchmarks; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import java.util.stream.Collectors; - import org.jabref.gui.Globals; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; @@ -35,7 +27,6 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.preferences.JabRefPreferences; - import org.openjdk.jmh.Main; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Scope; @@ -43,6 +34,14 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.runner.RunnerException; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; + import static org.mockito.Mockito.mock; @State(Scope.Thread) diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index 31d01ccd901..fcdf14fc1f1 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -1,42 +1,14 @@ package org.jabref.cli; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; -import java.util.prefs.BackingStoreException; - +import com.google.common.base.Throwables; import org.jabref.gui.Globals; import org.jabref.gui.externalfiles.AutoSetFileLinksUtil; import org.jabref.gui.undo.NamedCompound; import org.jabref.logic.JabRefException; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.citationkeypattern.CitationKeyGenerator; -import org.jabref.logic.exporter.AtomicFileWriter; -import org.jabref.logic.exporter.BibDatabaseWriter; -import org.jabref.logic.exporter.BibWriter; -import org.jabref.logic.exporter.BibtexDatabaseWriter; -import org.jabref.logic.exporter.EmbeddedBibFilePdfExporter; -import org.jabref.logic.exporter.Exporter; -import org.jabref.logic.exporter.ExporterFactory; -import org.jabref.logic.exporter.SelfContainedSaveConfiguration; -import org.jabref.logic.exporter.XmpPdfExporter; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportException; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ImportFormatReader; -import org.jabref.logic.importer.OpenDatabase; -import org.jabref.logic.importer.OutputPrinter; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.importer.SearchBasedFetcher; -import org.jabref.logic.importer.WebFetchers; +import org.jabref.logic.exporter.*; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; @@ -58,11 +30,16 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SearchPreferences; - -import com.google.common.base.Throwables; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.prefs.BackingStoreException; + public class ArgumentProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(ArgumentProcessor.class); diff --git a/src/main/java/org/jabref/cli/AuxCommandLine.java b/src/main/java/org/jabref/cli/AuxCommandLine.java index 61f4c133008..fe8d9c02e9e 100644 --- a/src/main/java/org/jabref/cli/AuxCommandLine.java +++ b/src/main/java/org/jabref/cli/AuxCommandLine.java @@ -1,7 +1,5 @@ package org.jabref.cli; -import java.nio.file.Path; - import org.jabref.gui.auximport.AuxParserResultViewModel; import org.jabref.logic.auxparser.AuxParser; import org.jabref.logic.auxparser.AuxParserResult; @@ -9,6 +7,8 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.strings.StringUtil; +import java.nio.file.Path; + public class AuxCommandLine { private final String auxFile; private final BibDatabase database; diff --git a/src/main/java/org/jabref/cli/JabRefCLI.java b/src/main/java/org/jabref/cli/JabRefCLI.java index 449f9df981c..808cf753f55 100644 --- a/src/main/java/org/jabref/cli/JabRefCLI.java +++ b/src/main/java/org/jabref/cli/JabRefCLI.java @@ -1,10 +1,7 @@ package org.jabref.cli; -import java.util.List; -import java.util.Objects; - import javafx.util.Pair; - +import org.apache.commons.cli.*; import org.jabref.gui.Globals; import org.jabref.logic.exporter.ExporterFactory; import org.jabref.logic.importer.ImportFormatReader; @@ -14,12 +11,8 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.PreferencesService; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; +import java.util.List; +import java.util.Objects; public class JabRefCLI { private static final int WIDTH = 100; // Number of characters per line before a line break must be added. diff --git a/src/main/java/org/jabref/cli/JournalListMvGenerator.java b/src/main/java/org/jabref/cli/JournalListMvGenerator.java index 97dc740cb96..1a529c0f3e9 100644 --- a/src/main/java/org/jabref/cli/JournalListMvGenerator.java +++ b/src/main/java/org/jabref/cli/JournalListMvGenerator.java @@ -1,5 +1,11 @@ package org.jabref.cli; +import org.h2.mvstore.MVMap; +import org.h2.mvstore.MVStore; +import org.jabref.logic.journals.Abbreviation; +import org.jabref.logic.journals.JournalAbbreviationLoader; +import org.jooq.lambda.Unchecked; + import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; @@ -9,13 +15,6 @@ import java.util.Set; import java.util.stream.Collectors; -import org.jabref.logic.journals.Abbreviation; -import org.jabref.logic.journals.JournalAbbreviationLoader; - -import org.h2.mvstore.MVMap; -import org.h2.mvstore.MVStore; -import org.jooq.lambda.Unchecked; - public class JournalListMvGenerator { public static void main(String[] args) throws IOException { diff --git a/src/main/java/org/jabref/cli/Launcher.java b/src/main/java/org/jabref/cli/Launcher.java index b0454018840..5ae86e8c636 100644 --- a/src/main/java/org/jabref/cli/Launcher.java +++ b/src/main/java/org/jabref/cli/Launcher.java @@ -1,14 +1,6 @@ package org.jabref.cli; -import java.io.File; -import java.io.IOException; -import java.net.Authenticator; -import java.nio.file.DirectoryStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Comparator; -import java.util.Map; - +import org.apache.commons.cli.ParseException; import org.jabref.gui.Globals; import org.jabref.gui.MainApplication; import org.jabref.logic.journals.JournalAbbreviationLoader; @@ -27,13 +19,20 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.PreferencesService; - -import org.apache.commons.cli.ParseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.bridge.SLF4JBridgeHandler; import org.tinylog.configuration.Configuration; +import java.io.File; +import java.io.IOException; +import java.net.Authenticator; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Comparator; +import java.util.Map; + /** * The main entry point for the JabRef application. *

diff --git a/src/main/java/org/jabref/gui/ClipBoardManager.java b/src/main/java/org/jabref/gui/ClipBoardManager.java index ed35818427b..273a45f7660 100644 --- a/src/main/java/org/jabref/gui/ClipBoardManager.java +++ b/src/main/java/org/jabref/gui/ClipBoardManager.java @@ -1,20 +1,11 @@ package org.jabref.gui; -import java.awt.Toolkit; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.StringSelection; -import java.awt.datatransfer.Transferable; -import java.awt.datatransfer.UnsupportedFlavorException; -import java.io.IOException; -import java.util.List; - import javafx.application.Platform; import javafx.scene.control.TextInputControl; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; import javafx.scene.input.DataFormat; import javafx.scene.input.MouseButton; - import org.jabref.architecture.AllowedToUseAwt; import org.jabref.logic.bibtex.BibEntryWriter; import org.jabref.logic.bibtex.FieldWriter; @@ -22,10 +13,17 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; +import java.util.List; + @AllowedToUseAwt("Requires ava.awt.datatransfer.Clipboard") public class ClipBoardManager { diff --git a/src/main/java/org/jabref/gui/DefaultInjector.java b/src/main/java/org/jabref/gui/DefaultInjector.java index b74e0efb8ff..e741189c296 100644 --- a/src/main/java/org/jabref/gui/DefaultInjector.java +++ b/src/main/java/org/jabref/gui/DefaultInjector.java @@ -1,9 +1,7 @@ package org.jabref.gui; -import java.util.function.Function; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.injection.Injector; +import com.airhacks.afterburner.injection.PresenterFactory; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.theme.ThemeManager; import org.jabref.gui.util.TaskExecutor; @@ -12,12 +10,12 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.airhacks.afterburner.injection.Injector; -import com.airhacks.afterburner.injection.PresenterFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.function.Function; + public class DefaultInjector implements PresenterFactory { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultInjector.class); diff --git a/src/main/java/org/jabref/gui/DialogService.java b/src/main/java/org/jabref/gui/DialogService.java index b03363a5a22..aa7d8ca0ac4 100644 --- a/src/main/java/org/jabref/gui/DialogService.java +++ b/src/main/java/org/jabref/gui/DialogService.java @@ -1,27 +1,21 @@ package org.jabref.gui; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.function.Consumer; - import javafx.concurrent.Task; import javafx.print.PrinterJob; -import javafx.scene.control.Alert; -import javafx.scene.control.ButtonType; -import javafx.scene.control.ChoiceDialog; -import javafx.scene.control.DialogPane; -import javafx.scene.control.TextInputDialog; - +import javafx.scene.control.*; +import org.controlsfx.control.textfield.CustomPasswordField; +import org.controlsfx.dialog.ProgressDialog; import org.jabref.gui.util.BaseDialog; import org.jabref.gui.util.DirectoryDialogConfiguration; import org.jabref.gui.util.FileDialogConfiguration; import org.jabref.logic.l10n.Localization; -import org.controlsfx.control.textfield.CustomPasswordField; -import org.controlsfx.dialog.ProgressDialog; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; /** * This interface provides methods to create dialogs and show them to the user. diff --git a/src/main/java/org/jabref/gui/DragAndDropDataFormats.java b/src/main/java/org/jabref/gui/DragAndDropDataFormats.java index deec9300e41..6ce01ab724e 100644 --- a/src/main/java/org/jabref/gui/DragAndDropDataFormats.java +++ b/src/main/java/org/jabref/gui/DragAndDropDataFormats.java @@ -1,11 +1,10 @@ package org.jabref.gui; -import java.util.List; - import javafx.scene.input.DataFormat; - import org.jabref.logic.preview.PreviewLayout; +import java.util.List; + /** * Contains all the different {@link DataFormat}s that may occur in JabRef. */ diff --git a/src/main/java/org/jabref/gui/DragAndDropHelper.java b/src/main/java/org/jabref/gui/DragAndDropHelper.java index 3702af568d5..bbe19ab57fa 100644 --- a/src/main/java/org/jabref/gui/DragAndDropHelper.java +++ b/src/main/java/org/jabref/gui/DragAndDropHelper.java @@ -1,15 +1,14 @@ package org.jabref.gui; +import javafx.scene.input.Dragboard; +import org.jabref.logic.util.io.FileUtil; + import java.io.File; import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javafx.scene.input.Dragboard; - -import org.jabref.logic.util.io.FileUtil; - public class DragAndDropHelper { public static boolean hasBibFiles(Dragboard dragboard) { diff --git a/src/main/java/org/jabref/gui/EntryType.fxml b/src/main/java/org/jabref/gui/EntryType.fxml index cfd81fc6dce..1e3bd27c987 100644 --- a/src/main/java/org/jabref/gui/EntryType.fxml +++ b/src/main/java/org/jabref/gui/EntryType.fxml @@ -1,17 +1,8 @@ - - - - - - - - - - - + + diff --git a/src/main/java/org/jabref/gui/SendAsStandardEmailAction.java b/src/main/java/org/jabref/gui/SendAsStandardEmailAction.java index c6637fa94ae..4a676a6062e 100644 --- a/src/main/java/org/jabref/gui/SendAsStandardEmailAction.java +++ b/src/main/java/org/jabref/gui/SendAsStandardEmailAction.java @@ -1,9 +1,5 @@ package org.jabref.gui; -import java.io.IOException; -import java.io.StringWriter; -import java.util.List; - import org.jabref.gui.actions.ActionHelper; import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.bibtex.BibEntryWriter; @@ -14,10 +10,13 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringWriter; +import java.util.List; + /** * Sends the selected entries to any specifiable email * by populating the email body diff --git a/src/main/java/org/jabref/gui/StateManager.java b/src/main/java/org/jabref/gui/StateManager.java index 2c0694b8f21..4a152b285b4 100644 --- a/src/main/java/org/jabref/gui/StateManager.java +++ b/src/main/java/org/jabref/gui/StateManager.java @@ -1,26 +1,16 @@ package org.jabref.gui; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.EasyBinding; import javafx.beans.Observable; import javafx.beans.binding.Bindings; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyListProperty; -import javafx.beans.property.ReadOnlyListWrapper; -import javafx.beans.property.SimpleIntegerProperty; -import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.ObservableMap; import javafx.concurrent.Task; import javafx.scene.Node; import javafx.util.Pair; - import org.jabref.gui.edit.automaticfiededitor.LastAutomaticFieldEditorEdit; import org.jabref.gui.sidepane.SidePaneType; import org.jabref.gui.util.BackgroundTask; @@ -32,12 +22,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.util.OptionalUtil; - -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.EasyBinding; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + /** * This class manages the GUI-state of JabRef, including: * diff --git a/src/main/java/org/jabref/gui/Telemetry.java b/src/main/java/org/jabref/gui/Telemetry.java index 94bbc27c02d..827f408d125 100644 --- a/src/main/java/org/jabref/gui/Telemetry.java +++ b/src/main/java/org/jabref/gui/Telemetry.java @@ -1,10 +1,10 @@ package org.jabref.gui; -import java.util.Optional; - import org.jabref.logic.util.BuildInfo; import org.jabref.preferences.TelemetryPreferences; +import java.util.Optional; + public class Telemetry { private Telemetry() {} diff --git a/src/main/java/org/jabref/gui/UpdateTimestampListener.java b/src/main/java/org/jabref/gui/UpdateTimestampListener.java index fa06315d0dd..23b60f91aad 100644 --- a/src/main/java/org/jabref/gui/UpdateTimestampListener.java +++ b/src/main/java/org/jabref/gui/UpdateTimestampListener.java @@ -1,12 +1,11 @@ package org.jabref.gui; +import com.google.common.eventbus.Subscribe; import org.jabref.model.entry.event.EntriesEventSource; import org.jabref.model.entry.event.EntryChangedEvent; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; -import com.google.common.eventbus.Subscribe; - /** * Updates the timestamp of changed entries if the feature is enabled */ diff --git a/src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java b/src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java index c8cd7a9e863..feb156e2775 100644 --- a/src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java +++ b/src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java @@ -1,11 +1,10 @@ package org.jabref.gui; -import java.util.List; - import javafx.concurrent.Task; - import org.jabref.logic.l10n.Localization; +import java.util.List; + /** * Dialog shown when closing of application needs to wait for a save operation to finish. */ diff --git a/src/main/java/org/jabref/gui/actions/Action.java b/src/main/java/org/jabref/gui/actions/Action.java index e6ccfe487b2..d6ee0ebf967 100644 --- a/src/main/java/org/jabref/gui/actions/Action.java +++ b/src/main/java/org/jabref/gui/actions/Action.java @@ -1,10 +1,10 @@ package org.jabref.gui.actions; -import java.util.Optional; - import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.keyboard.KeyBinding; +import java.util.Optional; + public interface Action { default Optional getIcon() { return Optional.empty(); diff --git a/src/main/java/org/jabref/gui/actions/ActionFactory.java b/src/main/java/org/jabref/gui/actions/ActionFactory.java index e270b0d346c..8c718227f3c 100644 --- a/src/main/java/org/jabref/gui/actions/ActionFactory.java +++ b/src/main/java/org/jabref/gui/actions/ActionFactory.java @@ -1,29 +1,21 @@ package org.jabref.gui.actions; -import java.lang.reflect.InaccessibleObjectException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Objects; - -import javafx.beans.binding.BooleanExpression; -import javafx.scene.control.Button; -import javafx.scene.control.ButtonBase; -import javafx.scene.control.CheckMenuItem; -import javafx.scene.control.Label; -import javafx.scene.control.Menu; -import javafx.scene.control.MenuItem; -import javafx.scene.control.Tooltip; - -import org.jabref.gui.keyboard.KeyBindingRepository; -import org.jabref.model.strings.StringUtil; - import com.sun.javafx.scene.control.ContextMenuContent; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.commands.Command; +import javafx.beans.binding.BooleanExpression; +import javafx.scene.control.*; import org.controlsfx.control.action.ActionUtils; +import org.jabref.gui.keyboard.KeyBindingRepository; +import org.jabref.model.strings.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.InaccessibleObjectException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Objects; + /** * Helper class to create and style controls according to an {@link Action}. */ diff --git a/src/main/java/org/jabref/gui/actions/ActionHelper.java b/src/main/java/org/jabref/gui/actions/ActionHelper.java index dd4fe511705..cc49d9a8a95 100644 --- a/src/main/java/org/jabref/gui/actions/ActionHelper.java +++ b/src/main/java/org/jabref/gui/actions/ActionHelper.java @@ -1,16 +1,12 @@ package org.jabref.gui.actions; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.EasyBinding; import javafx.beans.binding.Binding; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanExpression; import javafx.collections.ObservableList; import javafx.scene.control.TabPane; - import org.jabref.gui.StateManager; import org.jabref.logic.shared.DatabaseLocation; import org.jabref.logic.util.io.FileUtil; @@ -20,8 +16,10 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.EasyBinding; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; public class ActionHelper { diff --git a/src/main/java/org/jabref/gui/actions/JabRefAction.java b/src/main/java/org/jabref/gui/actions/JabRefAction.java index df3cde5ee10..79fd04c5827 100644 --- a/src/main/java/org/jabref/gui/actions/JabRefAction.java +++ b/src/main/java/org/jabref/gui/actions/JabRefAction.java @@ -1,13 +1,11 @@ package org.jabref.gui.actions; -import java.util.Map; - +import de.saxsys.mvvmfx.utils.commands.Command; import javafx.beans.binding.Bindings; - import org.jabref.gui.Telemetry; import org.jabref.gui.keyboard.KeyBindingRepository; -import de.saxsys.mvvmfx.utils.commands.Command; +import java.util.Map; /** * Wrapper around one of our actions from {@link Action} to convert them to controlsfx {@link org.controlsfx.control.action.Action}. diff --git a/src/main/java/org/jabref/gui/actions/SimpleCommand.java b/src/main/java/org/jabref/gui/actions/SimpleCommand.java index 39e3b7ae1ad..4385291edb3 100644 --- a/src/main/java/org/jabref/gui/actions/SimpleCommand.java +++ b/src/main/java/org/jabref/gui/actions/SimpleCommand.java @@ -1,13 +1,11 @@ package org.jabref.gui.actions; +import de.saxsys.mvvmfx.utils.commands.CommandBase; import javafx.beans.property.ReadOnlyDoubleProperty; import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.ReadOnlyStringWrapper; - import org.jabref.gui.util.BindingsHelper; -import de.saxsys.mvvmfx.utils.commands.CommandBase; - /** * A simple command that does not track progress of the action. */ diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index cd2bdaf53c0..914d0615bfd 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -1,12 +1,12 @@ package org.jabref.gui.actions; -import java.util.Optional; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.logic.l10n.Localization; +import java.util.Optional; + public enum StandardActions implements Action { COPY_MORE(Localization.lang("Copy") + "..."), COPY_TITLE(Localization.lang("Copy title"), KeyBinding.COPY_TITLE), diff --git a/src/main/java/org/jabref/gui/autocompleter/AutoCompletePreferences.java b/src/main/java/org/jabref/gui/autocompleter/AutoCompletePreferences.java index ee6dea8fdea..b6080c2b648 100644 --- a/src/main/java/org/jabref/gui/autocompleter/AutoCompletePreferences.java +++ b/src/main/java/org/jabref/gui/autocompleter/AutoCompletePreferences.java @@ -1,17 +1,16 @@ package org.jabref.gui.autocompleter; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableSet; - import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; +import java.util.Set; + public class AutoCompletePreferences { public enum NameFormat { diff --git a/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java b/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java index eb62c26bf3c..544c81f2b0b 100644 --- a/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java +++ b/src/main/java/org/jabref/gui/autocompleter/AutoCompletionTextInputBinding.java @@ -26,16 +26,14 @@ */ package org.jabref.gui.autocompleter; -import java.util.Collection; - import javafx.beans.value.ChangeListener; import javafx.scene.control.TextInputControl; import javafx.util.Callback; import javafx.util.StringConverter; - +import org.controlsfx.control.textfield.AutoCompletionBinding; import org.jabref.gui.util.DefaultTaskExecutor; -import org.controlsfx.control.textfield.AutoCompletionBinding; +import java.util.Collection; /** * Represents a binding between a text input control and an auto-completion popup diff --git a/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java index 633f9fd0fce..1a2a55e9448 100644 --- a/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java @@ -1,16 +1,15 @@ package org.jabref.gui.autocompleter; -import java.util.Comparator; -import java.util.stream.Stream; - +import com.google.common.base.Equivalence; +import org.controlsfx.control.textfield.AutoCompletionBinding; import org.jabref.logic.bibtex.comparator.EntryComparator; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.strings.StringUtil; -import com.google.common.base.Equivalence; -import org.controlsfx.control.textfield.AutoCompletionBinding; +import java.util.Comparator; +import java.util.stream.Stream; /** * Delivers possible completions as a list of {@link BibEntry} based on their citation key. diff --git a/src/main/java/org/jabref/gui/autocompleter/EmptySuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/EmptySuggestionProvider.java index ab7df191fb5..26f9f44761c 100644 --- a/src/main/java/org/jabref/gui/autocompleter/EmptySuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/EmptySuggestionProvider.java @@ -1,11 +1,11 @@ package org.jabref.gui.autocompleter; -import java.util.Comparator; -import java.util.stream.Stream; - import com.google.common.base.Equivalence; import org.controlsfx.control.textfield.AutoCompletionBinding; +import java.util.Comparator; +import java.util.stream.Stream; + public class EmptySuggestionProvider extends SuggestionProvider { @Override protected Equivalence getEquivalence() { diff --git a/src/main/java/org/jabref/gui/autocompleter/FieldValueSuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/FieldValueSuggestionProvider.java index 1fae672e250..ea3cee84c7c 100644 --- a/src/main/java/org/jabref/gui/autocompleter/FieldValueSuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/FieldValueSuggestionProvider.java @@ -1,11 +1,11 @@ package org.jabref.gui.autocompleter; -import java.util.Objects; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; +import java.util.Objects; +import java.util.stream.Stream; + /** * Stores the full content of one field. */ diff --git a/src/main/java/org/jabref/gui/autocompleter/JournalsSuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/JournalsSuggestionProvider.java index c0ece685519..eba4e4ae238 100644 --- a/src/main/java/org/jabref/gui/autocompleter/JournalsSuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/JournalsSuggestionProvider.java @@ -1,12 +1,11 @@ package org.jabref.gui.autocompleter; -import java.util.stream.Stream; - +import com.google.common.collect.Streams; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; -import com.google.common.collect.Streams; +import java.util.stream.Stream; public class JournalsSuggestionProvider extends FieldValueSuggestionProvider { diff --git a/src/main/java/org/jabref/gui/autocompleter/PersonNameStringConverter.java b/src/main/java/org/jabref/gui/autocompleter/PersonNameStringConverter.java index 8e2ae19fbc0..0ef37a60b61 100644 --- a/src/main/java/org/jabref/gui/autocompleter/PersonNameStringConverter.java +++ b/src/main/java/org/jabref/gui/autocompleter/PersonNameStringConverter.java @@ -1,7 +1,6 @@ package org.jabref.gui.autocompleter; import javafx.util.StringConverter; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; diff --git a/src/main/java/org/jabref/gui/autocompleter/PersonNameSuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/PersonNameSuggestionProvider.java index ef39faa0ebb..adde2f47a11 100644 --- a/src/main/java/org/jabref/gui/autocompleter/PersonNameSuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/PersonNameSuggestionProvider.java @@ -1,12 +1,7 @@ package org.jabref.gui.autocompleter; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Stream; - +import com.google.common.base.Equivalence; +import org.controlsfx.control.textfield.AutoCompletionBinding; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; @@ -14,8 +9,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; -import com.google.common.base.Equivalence; -import org.controlsfx.control.textfield.AutoCompletionBinding; +import java.util.*; +import java.util.stream.Stream; /** * Delivers possible completions as a list of {@link Author}s. diff --git a/src/main/java/org/jabref/gui/autocompleter/StringSuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/StringSuggestionProvider.java index 01ba19ef39e..01486fdab6a 100644 --- a/src/main/java/org/jabref/gui/autocompleter/StringSuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/StringSuggestionProvider.java @@ -1,12 +1,11 @@ package org.jabref.gui.autocompleter; -import java.util.Comparator; -import java.util.stream.Stream; - -import org.jabref.model.strings.StringUtil; - import com.google.common.base.Equivalence; import org.controlsfx.control.textfield.AutoCompletionBinding; +import org.jabref.model.strings.StringUtil; + +import java.util.Comparator; +import java.util.stream.Stream; abstract class StringSuggestionProvider extends SuggestionProvider { diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java index d54268685d0..945d67e368d 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java @@ -26,15 +26,15 @@ */ package org.jabref.gui.autocompleter; +import com.google.common.base.Equivalence; +import org.controlsfx.control.textfield.AutoCompletionBinding.ISuggestionRequest; + import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.google.common.base.Equivalence; -import org.controlsfx.control.textfield.AutoCompletionBinding.ISuggestionRequest; - /** * This is a simple implementation of a generic suggestion provider callback. * diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java index 4f71c6b0dda..a985d1e4579 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProviders.java @@ -1,13 +1,13 @@ package org.jabref.gui.autocompleter; -import java.util.Set; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; import org.jabref.model.entry.field.StandardField; +import java.util.Set; + public class SuggestionProviders { private final boolean isEmpty; diff --git a/src/main/java/org/jabref/gui/autocompleter/WordSuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/WordSuggestionProvider.java index d6715dcd961..d2a6601e006 100644 --- a/src/main/java/org/jabref/gui/autocompleter/WordSuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/WordSuggestionProvider.java @@ -1,11 +1,11 @@ package org.jabref.gui.autocompleter; -import java.util.Objects; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; +import java.util.Objects; +import java.util.stream.Stream; + /** * Stores all words in the given field. */ diff --git a/src/main/java/org/jabref/gui/autosaveandbackup/AutosaveManager.java b/src/main/java/org/jabref/gui/autosaveandbackup/AutosaveManager.java index 4b82b83d32c..0f42c797623 100644 --- a/src/main/java/org/jabref/gui/autosaveandbackup/AutosaveManager.java +++ b/src/main/java/org/jabref/gui/autosaveandbackup/AutosaveManager.java @@ -1,20 +1,19 @@ package org.jabref.gui.autosaveandbackup; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; import org.jabref.logic.util.CoarseChangeFilter; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.event.AutosaveEvent; import org.jabref.model.database.event.BibDatabaseContextChangedEvent; - -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + /** * Saves the given {@link BibDatabaseContext} on every {@link BibDatabaseContextChangedEvent} by posting a new {@link AutosaveEvent}. * An intelligent {@link ScheduledThreadPoolExecutor} prevents a high load while saving and rejects all redundant save tasks. diff --git a/src/main/java/org/jabref/gui/autosaveandbackup/BackupManager.java b/src/main/java/org/jabref/gui/autosaveandbackup/BackupManager.java index 7c0b0e1d7d3..5294c9795f5 100644 --- a/src/main/java/org/jabref/gui/autosaveandbackup/BackupManager.java +++ b/src/main/java/org/jabref/gui/autosaveandbackup/BackupManager.java @@ -1,26 +1,7 @@ package org.jabref.gui.autosaveandbackup; -import java.io.IOException; -import java.io.Writer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.FileTime; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - +import com.google.common.eventbus.Subscribe; import javafx.scene.control.TableColumn; - import org.jabref.gui.LibraryTab; import org.jabref.gui.maintable.BibEntryTableViewModel; import org.jabref.gui.maintable.columns.MainTableColumn; @@ -38,11 +19,20 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.model.metadata.SelfContainedSaveOrder; import org.jabref.preferences.PreferencesService; - -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.Writer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.FileTime; +import java.util.*; +import java.util.concurrent.*; + /** * Backups the given bib database file from {@link BibDatabaseContext} on every {@link BibDatabaseContextChangedEvent}. * An intelligent {@link ExecutorService} with a {@link BlockingQueue} prevents a high load while making backups and diff --git a/src/main/java/org/jabref/gui/auximport/AuxParserResultViewModel.java b/src/main/java/org/jabref/gui/auximport/AuxParserResultViewModel.java index 05222c44a37..8ed9a00c9d4 100644 --- a/src/main/java/org/jabref/gui/auximport/AuxParserResultViewModel.java +++ b/src/main/java/org/jabref/gui/auximport/AuxParserResultViewModel.java @@ -1,10 +1,10 @@ package org.jabref.gui.auximport; -import java.util.stream.Collectors; - import org.jabref.logic.auxparser.AuxParserResult; import org.jabref.logic.l10n.Localization; +import java.util.stream.Collectors; + public class AuxParserResultViewModel { private AuxParserResult auxParserResult; diff --git a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.fxml b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.fxml index 5f1bca0c9ec..ff8d0d958b8 100644 --- a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.fxml +++ b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.fxml @@ -1,16 +1,7 @@ - - - - - - - - - - - + + - - - + - - - - - - - - - + + { private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseChangesResolverDialog.class); /** diff --git a/src/main/java/org/jabref/gui/collab/ExternalChangesResolverViewModel.java b/src/main/java/org/jabref/gui/collab/ExternalChangesResolverViewModel.java index 56c7e9c2305..7a522a3160d 100644 --- a/src/main/java/org/jabref/gui/collab/ExternalChangesResolverViewModel.java +++ b/src/main/java/org/jabref/gui/collab/ExternalChangesResolverViewModel.java @@ -1,25 +1,22 @@ package org.jabref.gui.collab; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.undo.NamedCompound; import org.jabref.logic.l10n.Localization; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class ExternalChangesResolverViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ExternalChangesResolverViewModel.class); diff --git a/src/main/java/org/jabref/gui/collab/entrychange/EntryChange.java b/src/main/java/org/jabref/gui/collab/entrychange/EntryChange.java index 150ecdd558f..ca9c8a282b3 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/EntryChange.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/EntryChange.java @@ -1,7 +1,5 @@ package org.jabref.gui.collab.entrychange; -import javax.swing.undo.CompoundEdit; - import org.jabref.gui.collab.DatabaseChange; import org.jabref.gui.collab.DatabaseChangeResolverFactory; import org.jabref.gui.undo.NamedCompound; @@ -11,6 +9,8 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; +import javax.swing.undo.CompoundEdit; + public final class EntryChange extends DatabaseChange { private final BibEntry oldEntry; private final BibEntry newEntry; diff --git a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java index 224a06e7e3c..e472c213c14 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeDetailsView.java @@ -1,5 +1,6 @@ package org.jabref.gui.collab.entrychange; +import com.tobiasdiez.easybind.EasyBind; import javafx.event.Event; import javafx.geometry.Orientation; import javafx.scene.control.Label; @@ -8,7 +9,6 @@ import javafx.scene.input.MouseEvent; import javafx.scene.layout.VBox; import javafx.scene.web.WebView; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.collab.DatabaseChangeDetailsView; @@ -21,8 +21,6 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; - public final class EntryChangeDetailsView extends DatabaseChangeDetailsView { private final PreviewWithSourceTab oldPreviewWithSourcesTab = new PreviewWithSourceTab(); private final PreviewWithSourceTab newPreviewWithSourcesTab = new PreviewWithSourceTab(); diff --git a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeResolver.java b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeResolver.java index befabd2ec4a..95eff1eb301 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeResolver.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/EntryChangeResolver.java @@ -1,7 +1,5 @@ package org.jabref.gui.collab.entrychange; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.collab.DatabaseChange; import org.jabref.gui.collab.DatabaseChangeResolver; @@ -14,6 +12,8 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.PreferencesService; +import java.util.Optional; + public final class EntryChangeResolver extends DatabaseChangeResolver { private final EntryChange entryChange; private final BibDatabaseContext databaseContext; diff --git a/src/main/java/org/jabref/gui/collab/entrychange/EntryWithPreviewAndSourceDetailsView.java b/src/main/java/org/jabref/gui/collab/entrychange/EntryWithPreviewAndSourceDetailsView.java index 0265a76424f..3db55407409 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/EntryWithPreviewAndSourceDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/EntryWithPreviewAndSourceDetailsView.java @@ -1,7 +1,6 @@ package org.jabref.gui.collab.entrychange; import javafx.scene.control.TabPane; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.gui.preview.PreviewViewer; import org.jabref.model.database.BibDatabaseContext; diff --git a/src/main/java/org/jabref/gui/collab/entrychange/PreviewWithSourceTab.java b/src/main/java/org/jabref/gui/collab/entrychange/PreviewWithSourceTab.java index 0f03b8c3e3f..30bc0cf7d11 100644 --- a/src/main/java/org/jabref/gui/collab/entrychange/PreviewWithSourceTab.java +++ b/src/main/java/org/jabref/gui/collab/entrychange/PreviewWithSourceTab.java @@ -1,11 +1,8 @@ package org.jabref.gui.collab.entrychange; -import java.io.IOException; -import java.io.StringWriter; - import javafx.scene.control.Tab; import javafx.scene.control.TabPane; - +import org.fxmisc.richtext.CodeArea; import org.jabref.gui.preview.PreviewViewer; import org.jabref.logic.bibtex.BibEntryWriter; import org.jabref.logic.bibtex.FieldPreferences; @@ -19,11 +16,12 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; - -import org.fxmisc.richtext.CodeArea; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringWriter; + public class PreviewWithSourceTab { private static final Logger LOGGER = LoggerFactory.getLogger(PreviewWithSourceTab.class); diff --git a/src/main/java/org/jabref/gui/collab/groupchange/GroupChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/groupchange/GroupChangeDetailsView.java index b1ca6fcc569..a739cb57096 100644 --- a/src/main/java/org/jabref/gui/collab/groupchange/GroupChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/groupchange/GroupChangeDetailsView.java @@ -1,7 +1,6 @@ package org.jabref.gui.collab.groupchange; import javafx.scene.control.Label; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java index 19e14ee1f18..df17932594b 100644 --- a/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java @@ -3,7 +3,6 @@ import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.layout.VBox; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.bibtex.comparator.MetaDataDiff; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChange.java b/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChange.java index d0d326c8db4..e4780b58cfc 100644 --- a/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChange.java +++ b/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChange.java @@ -7,7 +7,6 @@ import org.jabref.logic.bibtex.comparator.PreambleDiff; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChangeDetailsView.java index 3800f4b26b0..fca6fb60af2 100644 --- a/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/preamblechange/PreambleChangeDetailsView.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.bibtex.comparator.PreambleDiff; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAdd.java b/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAdd.java index c408486a3db..3108edb601c 100644 --- a/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAdd.java +++ b/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAdd.java @@ -8,7 +8,6 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.KeyCollisionException; import org.jabref.model.entry.BibtexString; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAddDetailsView.java b/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAddDetailsView.java index 16ef1a1dcc8..dbac0bc1426 100644 --- a/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAddDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/stringadd/BibTexStringAddDetailsView.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChange.java b/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChange.java index 6ac77b42ab5..cd895962236 100644 --- a/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChange.java +++ b/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChange.java @@ -7,7 +7,6 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibtexString; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChangeDetailsView.java index a7db2c9af2f..c47e51f312b 100644 --- a/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/stringchange/BibTexStringChangeDetailsView.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDelete.java b/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDelete.java index 348e5fbda91..37d5f1eb9db 100644 --- a/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDelete.java +++ b/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDelete.java @@ -7,7 +7,6 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibtexString; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDeleteDetailsView.java b/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDeleteDetailsView.java index 85b5e5bf995..f1480b15929 100644 --- a/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDeleteDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/stringdelete/BibTexStringDeleteDetailsView.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; - import org.jabref.gui.collab.DatabaseChangeDetailsView; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRename.java b/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRename.java index e2207902f15..0ab2938fc1f 100644 --- a/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRename.java +++ b/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRename.java @@ -7,7 +7,6 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibtexString; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRenameDetailsView.java b/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRenameDetailsView.java index 0baa3219ebb..d529bf38904 100644 --- a/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRenameDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/stringrename/BibTexStringRenameDetailsView.java @@ -1,7 +1,6 @@ package org.jabref.gui.collab.stringrename; import javafx.scene.control.Label; - import org.jabref.gui.collab.DatabaseChangeDetailsView; public final class BibTexStringRenameDetailsView extends DatabaseChangeDetailsView { diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.fxml b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.fxml index f729b938ca6..4f16b2c7f71 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.fxml +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.fxml @@ -1,7 +1,6 @@ - - + { diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelItemModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelItemModel.java index 61b7ce6a61c..a4845182dad 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelItemModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelItemModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.commonfxcontrols; -import java.util.Objects; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.model.entry.types.EntryType; +import java.util.Objects; + public class CitationKeyPatternPanelItemModel { private final ObjectProperty entryType = new SimpleObjectProperty<>(); private final StringProperty pattern = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java index 5f836cec83c..2f3d570bb43 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java @@ -1,20 +1,19 @@ package org.jabref.gui.commonfxcontrols; -import java.util.Collection; -import java.util.Comparator; - import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; - import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.types.EntryType; +import java.util.Collection; +import java.util.Comparator; + public class CitationKeyPatternPanelViewModel { public static final String ENTRY_TYPE_DEFAULT_NAME = "default"; diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanel.fxml b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanel.fxml index 86f4feb287a..5fd823ac0ba 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanel.fxml +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanel.fxml @@ -1,14 +1,8 @@ - - - - - - - - + + - - - - - - - + + - - - + { @FXML diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesDialogViewModel.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesDialogViewModel.java index 7b235943ae5..763f9caa951 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesDialogViewModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.AbstractViewModel; public class CopyFilesDialogViewModel extends AbstractViewModel { diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultItemViewModel.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultItemViewModel.java index e48f0685112..3350bf703a4 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultItemViewModel.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesResultItemViewModel.java @@ -1,15 +1,14 @@ package org.jabref.gui.copyfiles; -import java.nio.file.Path; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; +import java.nio.file.Path; + public class CopyFilesResultItemViewModel { private final StringProperty file = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java index b4c92181bf2..5d9e7e26b8c 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java @@ -1,19 +1,6 @@ package org.jabref.gui.copyfiles; -import java.io.BufferedWriter; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.function.BiFunction; - import javafx.concurrent.Task; - import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.OS; import org.jabref.logic.util.io.FileUtil; @@ -22,10 +9,21 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.BiFunction; + public class CopyFilesTask extends Task> { private static final Logger LOGGER = LoggerFactory.getLogger(CopyFilesAction.class); diff --git a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java index e5ef547b7bd..73149a5389b 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java @@ -1,11 +1,6 @@ package org.jabref.gui.copyfiles; -import java.nio.file.Path; -import java.util.Optional; -import java.util.function.BiFunction; - import javafx.beans.binding.Bindings; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.util.DirectoryDialogConfiguration; @@ -16,6 +11,10 @@ import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.FilePreferences; +import java.nio.file.Path; +import java.util.Optional; +import java.util.function.BiFunction; + public class CopySingleFileAction extends SimpleCommand { private final LinkedFile linkedFile; diff --git a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java index bd0bf13fdc9..dbd292c965f 100644 --- a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java @@ -1,15 +1,5 @@ package org.jabref.gui.desktop; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.desktop.os.NativeDesktop; @@ -28,10 +18,19 @@ import org.jabref.preferences.ExternalApplicationsPreferences; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Pattern; + /** * See http://stackoverflow.com/questions/18004150/desktop-api-is-not-supported-on-the-current-platform for more implementation hints. * http://docs.oracle.com/javase/7/docs/api/java/awt/Desktop.html cannot be used as we don't want to rely on AWT diff --git a/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java b/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java index 7ab380efcb7..520758f9905 100644 --- a/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/os/DefaultDesktop.java @@ -1,17 +1,16 @@ package org.jabref.gui.desktop.os; -import java.awt.Desktop; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; - import org.jabref.architecture.AllowedToUseAwt; import org.jabref.cli.Launcher; import org.jabref.gui.DialogService; import org.jabref.preferences.FilePreferences; - import org.slf4j.LoggerFactory; +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + /** * This class contains some default implementations (if OS is neither linux, windows or osx) file directories and file/application open handling methods
* We cannot use a static logger instance here in this class as the Logger first needs to be configured in the {@link Launcher#addLogToDisk} 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 5d21d487370..15d44c5da44 100644 --- a/src/main/java/org/jabref/gui/desktop/os/Linux.java +++ b/src/main/java/org/jabref/gui/desktop/os/Linux.java @@ -1,17 +1,5 @@ package org.jabref.gui.desktop.os; -import java.awt.Desktop; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Locale; -import java.util.Optional; - import org.jabref.architecture.AllowedToUseAwt; import org.jabref.cli.Launcher; import org.jabref.gui.DialogService; @@ -21,9 +9,20 @@ import org.jabref.gui.util.StreamGobbler; import org.jabref.logic.l10n.Localization; import org.jabref.preferences.FilePreferences; - import org.slf4j.LoggerFactory; +import java.awt.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Locale; +import java.util.Optional; + /** * This class contains Linux specific implementations for file directories and file/application open handling methods
* We cannot use a static logger instance here in this class as the Logger first needs to be configured in the {@link Launcher#addLogToDisk} diff --git a/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java b/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java index 57ff7cd2b24..4b4bbe47515 100644 --- a/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/os/NativeDesktop.java @@ -1,12 +1,6 @@ package org.jabref.gui.desktop.os; -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.nio.file.Files; -import java.nio.file.Path; - +import net.harawata.appdirs.AppDirsFactory; import org.jabref.cli.Launcher; import org.jabref.gui.DialogService; import org.jabref.logic.util.BuildInfo; @@ -14,10 +8,15 @@ import org.jabref.model.pdf.search.SearchFieldConstants; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.FilePreferences; - -import net.harawata.appdirs.AppDirsFactory; import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.nio.file.Files; +import java.nio.file.Path; + /** * This class contains bundles OS specific implementations for file directories and file/application open handling methods. * In case the default does not work, subclasses provide the correct behavior. diff --git a/src/main/java/org/jabref/gui/desktop/os/OSX.java b/src/main/java/org/jabref/gui/desktop/os/OSX.java index 6d5c9d00dff..680c381a153 100644 --- a/src/main/java/org/jabref/gui/desktop/os/OSX.java +++ b/src/main/java/org/jabref/gui/desktop/os/OSX.java @@ -1,9 +1,5 @@ package org.jabref.gui.desktop.os; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Optional; - import org.jabref.architecture.AllowedToUseAwt; import org.jabref.cli.Launcher; import org.jabref.gui.DialogService; @@ -11,6 +7,10 @@ import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.preferences.FilePreferences; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Optional; + /** * This class contains macOS (OSX) specific implementations for file directories and file/application open handling methods
* We cannot use a static logger instance here in this class as the Logger first needs to be configured in the {@link Launcher#addLogToDisk} diff --git a/src/main/java/org/jabref/gui/desktop/os/Windows.java b/src/main/java/org/jabref/gui/desktop/os/Windows.java index bacf32f6406..97b6169d78d 100644 --- a/src/main/java/org/jabref/gui/desktop/os/Windows.java +++ b/src/main/java/org/jabref/gui/desktop/os/Windows.java @@ -1,23 +1,22 @@ package org.jabref.gui.desktop.os; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Optional; - +import com.sun.jna.platform.win32.KnownFolders; +import com.sun.jna.platform.win32.Shell32Util; +import com.sun.jna.platform.win32.ShlObj; +import com.sun.jna.platform.win32.Win32Exception; import org.jabref.cli.Launcher; import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.preferences.FilePreferences; - -import com.sun.jna.platform.win32.KnownFolders; -import com.sun.jna.platform.win32.Shell32Util; -import com.sun.jna.platform.win32.ShlObj; -import com.sun.jna.platform.win32.Win32Exception; import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + /** * This class contains Windows specific implementations for file directories and file/application open handling methods
* We cannot use a static logger instance here in this class as the Logger first needs to be configured in the {@link Launcher#addLogToDisk} diff --git a/src/main/java/org/jabref/gui/dialogs/AutosaveUiManager.java b/src/main/java/org/jabref/gui/dialogs/AutosaveUiManager.java index 5063ef07206..db4c9714fb5 100644 --- a/src/main/java/org/jabref/gui/dialogs/AutosaveUiManager.java +++ b/src/main/java/org/jabref/gui/dialogs/AutosaveUiManager.java @@ -1,13 +1,12 @@ package org.jabref.gui.dialogs; +import com.google.common.eventbus.Subscribe; import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.exporter.SaveDatabaseAction; import org.jabref.model.database.event.AutosaveEvent; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; - -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/dialogs/BackupUIManager.java b/src/main/java/org/jabref/gui/dialogs/BackupUIManager.java index b67f213f221..79d6e3983c1 100644 --- a/src/main/java/org/jabref/gui/dialogs/BackupUIManager.java +++ b/src/main/java/org/jabref/gui/dialogs/BackupUIManager.java @@ -1,12 +1,6 @@ package org.jabref.gui.dialogs; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import javafx.scene.control.ButtonType; - import org.jabref.gui.DialogService; import org.jabref.gui.autosaveandbackup.BackupManager; import org.jabref.gui.backup.BackupResolverDialog; @@ -25,10 +19,14 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.ExternalApplicationsPreferences; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + /** * Stores all user dialogs related to {@link BackupManager}. */ diff --git a/src/main/java/org/jabref/gui/documentviewer/DocumentViewer.fxml b/src/main/java/org/jabref/gui/documentviewer/DocumentViewer.fxml index 50bdc2e9454..97a007b05eb 100644 --- a/src/main/java/org/jabref/gui/documentviewer/DocumentViewer.fxml +++ b/src/main/java/org/jabref/gui/documentviewer/DocumentViewer.fxml @@ -1,18 +1,8 @@ - - - - - - - - - - - - - + + + { @FXML diff --git a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java index 74c9140a8ce..421fd97d9b4 100644 --- a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java +++ b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerViewModel.java @@ -1,35 +1,26 @@ package org.jabref.gui.documentviewer; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; - +import com.tobiasdiez.easybind.EasyBind; import javafx.application.Platform; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleIntegerProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; - +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; import org.jabref.gui.AbstractViewModel; import org.jabref.gui.StateManager; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.apache.pdfbox.Loader; -import org.apache.pdfbox.pdmodel.PDDocument; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; + public class DocumentViewerViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(DocumentViewerViewModel.class); diff --git a/src/main/java/org/jabref/gui/documentviewer/PdfDocumentPageViewModel.java b/src/main/java/org/jabref/gui/documentviewer/PdfDocumentPageViewModel.java index 607709742b1..30a6125b91d 100644 --- a/src/main/java/org/jabref/gui/documentviewer/PdfDocumentPageViewModel.java +++ b/src/main/java/org/jabref/gui/documentviewer/PdfDocumentPageViewModel.java @@ -1,21 +1,19 @@ package org.jabref.gui.documentviewer; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.Objects; - import javafx.scene.image.Image; import javafx.scene.image.PixelWriter; import javafx.scene.image.WritableImage; - -import org.jabref.architecture.AllowedToUseAwt; - import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.common.PDRectangle; import org.apache.pdfbox.rendering.ImageType; import org.apache.pdfbox.rendering.PDFRenderer; +import org.jabref.architecture.AllowedToUseAwt; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.Objects; /** * Represents the view model of a pdf page backed by a {@link PDPage}. diff --git a/src/main/java/org/jabref/gui/documentviewer/PdfDocumentViewModel.java b/src/main/java/org/jabref/gui/documentviewer/PdfDocumentViewModel.java index 7e5ae9a5969..52a1482dfea 100644 --- a/src/main/java/org/jabref/gui/documentviewer/PdfDocumentViewModel.java +++ b/src/main/java/org/jabref/gui/documentviewer/PdfDocumentViewModel.java @@ -1,15 +1,14 @@ package org.jabref.gui.documentviewer; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPageTree; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + public class PdfDocumentViewModel extends DocumentViewModel { private final PDDocument document; diff --git a/src/main/java/org/jabref/gui/documentviewer/ShowDocumentViewerAction.java b/src/main/java/org/jabref/gui/documentviewer/ShowDocumentViewerAction.java index e44903f3718..de5373aea13 100644 --- a/src/main/java/org/jabref/gui/documentviewer/ShowDocumentViewerAction.java +++ b/src/main/java/org/jabref/gui/documentviewer/ShowDocumentViewerAction.java @@ -1,13 +1,12 @@ package org.jabref.gui.documentviewer; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; import org.jabref.gui.actions.SimpleCommand; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.injection.Injector; - import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; public class ShowDocumentViewerAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateResolverDialog.java b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateResolverDialog.java index bc95445aaa9..690e7dae0a0 100644 --- a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateResolverDialog.java +++ b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateResolverDialog.java @@ -5,7 +5,6 @@ import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import javafx.scene.layout.BorderPane; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionFactory; diff --git a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java index cab92e631b7..c03d3bff7e8 100644 --- a/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java +++ b/src/main/java/org/jabref/gui/duplicationFinder/DuplicateSearch.java @@ -1,25 +1,9 @@ package org.jabref.gui.duplicationFinder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleStringProperty; - -import org.jabref.gui.DialogService; -import org.jabref.gui.JabRefExecutorService; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverResult; import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverType; @@ -37,6 +21,13 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; +import java.util.*; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class DuplicateSearch extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/edit/CopyDoiUrlAction.java b/src/main/java/org/jabref/gui/edit/CopyDoiUrlAction.java index 3ef0e61bd90..69b692d6f3f 100644 --- a/src/main/java/org/jabref/gui/edit/CopyDoiUrlAction.java +++ b/src/main/java/org/jabref/gui/edit/CopyDoiUrlAction.java @@ -1,9 +1,6 @@ package org.jabref.gui.edit; -import java.util.Optional; - import javafx.scene.control.TextArea; - import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.actions.SimpleCommand; @@ -11,6 +8,8 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.DOI; +import java.util.Optional; + /** * Copies the doi url to the clipboard */ diff --git a/src/main/java/org/jabref/gui/edit/CopyMoreAction.java b/src/main/java/org/jabref/gui/edit/CopyMoreAction.java index 0cca19e5f2a..d87ab839940 100644 --- a/src/main/java/org/jabref/gui/edit/CopyMoreAction.java +++ b/src/main/java/org/jabref/gui/edit/CopyMoreAction.java @@ -1,11 +1,5 @@ package org.jabref.gui.edit; -import java.io.IOException; -import java.io.StringReader; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefDialogService; @@ -21,10 +15,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringReader; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class CopyMoreAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(CopyMoreAction.class); diff --git a/src/main/java/org/jabref/gui/edit/EditAction.java b/src/main/java/org/jabref/gui/edit/EditAction.java index d6a564e5ec3..e3a66144149 100644 --- a/src/main/java/org/jabref/gui/edit/EditAction.java +++ b/src/main/java/org/jabref/gui/edit/EditAction.java @@ -2,14 +2,12 @@ import javafx.scene.control.TextInputControl; import javafx.scene.web.WebView; - +import org.fxmisc.richtext.CodeArea; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; - -import org.fxmisc.richtext.CodeArea; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/edit/ManageKeywordsAction.java b/src/main/java/org/jabref/gui/edit/ManageKeywordsAction.java index 9cf2749a5bb..320fade6e79 100644 --- a/src/main/java/org/jabref/gui/edit/ManageKeywordsAction.java +++ b/src/main/java/org/jabref/gui/edit/ManageKeywordsAction.java @@ -1,13 +1,12 @@ package org.jabref.gui.edit; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.util.BindingsHelper; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.injection.Injector; - import static org.jabref.gui.actions.ActionHelper.needsDatabase; import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; diff --git a/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.fxml b/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.fxml index bbb394518b7..c4a9d101d5b 100644 --- a/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.fxml +++ b/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.fxml @@ -1,11 +1,6 @@ - - - - - - + { private final List entries; diff --git a/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java b/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java index 6604c096012..3893f54c4f5 100644 --- a/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java +++ b/src/main/java/org/jabref/gui/edit/ManageKeywordsViewModel.java @@ -1,13 +1,10 @@ package org.jabref.gui.edit; -import java.util.List; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableFieldChange; import org.jabref.logic.l10n.Localization; @@ -17,7 +14,8 @@ import org.jabref.model.entry.KeywordList; import org.jabref.preferences.BibEntryPreferences; -import com.tobiasdiez.easybind.EasyBind; +import java.util.List; +import java.util.Optional; public class ManageKeywordsViewModel { diff --git a/src/main/java/org/jabref/gui/edit/ReplaceString.fxml b/src/main/java/org/jabref/gui/edit/ReplaceString.fxml index f725d5b9a58..6c8841526bd 100644 --- a/src/main/java/org/jabref/gui/edit/ReplaceString.fxml +++ b/src/main/java/org/jabref/gui/edit/ReplaceString.fxml @@ -1,16 +1,7 @@ - - - - - - - - - - - + + { @FXML diff --git a/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java b/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java index 04db4bf9147..f49020d6835 100644 --- a/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java +++ b/src/main/java/org/jabref/gui/edit/ReplaceStringViewModel.java @@ -1,13 +1,9 @@ package org.jabref.gui.edit; -import java.util.Objects; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.LibraryTab; import org.jabref.gui.undo.NamedCompound; @@ -17,6 +13,9 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; +import java.util.Objects; +import java.util.Set; + public class ReplaceStringViewModel extends AbstractViewModel { private boolean allFieldReplace; private String findString; diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AbstractAutomaticFieldEditorTabViewModel.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AbstractAutomaticFieldEditorTabViewModel.java index fe6e60fee01..ddbd4981cf8 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AbstractAutomaticFieldEditorTabViewModel.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AbstractAutomaticFieldEditorTabViewModel.java @@ -1,24 +1,17 @@ package org.jabref.gui.edit.automaticfiededitor; -import java.util.Collection; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.StateManager; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; + public abstract class AbstractAutomaticFieldEditorTabViewModel extends AbstractViewModel { public static final Logger LOGGER = LoggerFactory.getLogger(AbstractAutomaticFieldEditorTabViewModel.class); diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorDialog.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorDialog.java index b60ebd4ab0c..f2676a2809e 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorDialog.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorDialog.java @@ -1,28 +1,25 @@ package org.jabref.gui.edit.automaticfiededitor; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.undo.CannotUndoException; -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; import javafx.fxml.FXML; import javafx.scene.control.ButtonBar; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; - import org.jabref.gui.Globals; import org.jabref.gui.StateManager; import org.jabref.gui.util.BaseDialog; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; - -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.UndoManager; +import java.util.ArrayList; +import java.util.List; + public class AutomaticFieldEditorDialog extends BaseDialog { private static final Logger LOGGER = LoggerFactory.getLogger(AutomaticFieldEditorDialog.class); diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorViewModel.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorViewModel.java index c6f1fafbf91..370eb7196a8 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorViewModel.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorViewModel.java @@ -1,12 +1,7 @@ package org.jabref.gui.edit.automaticfiededitor; -import java.util.List; - -import javax.swing.undo.UndoManager; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.StateManager; import org.jabref.gui.edit.automaticfiededitor.copyormovecontent.CopyOrMoveFieldContentTabView; @@ -16,6 +11,9 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; +import javax.swing.undo.UndoManager; +import java.util.List; + public class AutomaticFieldEditorViewModel extends AbstractViewModel { public static final String NAMED_COMPOUND_EDITS = "EDIT_FIELDS"; private final ObservableList fieldEditorTabs = FXCollections.observableArrayList(); diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/LastAutomaticFieldEditorEdit.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/LastAutomaticFieldEditorEdit.java index a1263576608..25bc3f399a8 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/LastAutomaticFieldEditorEdit.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/LastAutomaticFieldEditorEdit.java @@ -1,11 +1,11 @@ package org.jabref.gui.edit.automaticfiededitor; +import org.jabref.gui.undo.NamedCompound; + import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; -import org.jabref.gui.undo.NamedCompound; - public class LastAutomaticFieldEditorEdit extends AbstractUndoableEdit { private final Integer affectedEntries; private final NamedCompound edit; diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java index 411dd0edfdc..6f616cfdb46 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/MoveFieldValueAction.java @@ -1,7 +1,5 @@ package org.jabref.gui.edit.automaticfiededitor; -import java.util.List; - import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableFieldChange; @@ -9,6 +7,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; +import java.util.List; + public class MoveFieldValueAction extends SimpleCommand { private final Field fromField; private final Field toField; diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/NotificationPaneAdapter.java b/src/main/java/org/jabref/gui/edit/automaticfiededitor/NotificationPaneAdapter.java index 4fc8b9d8b63..8376eb4b2ed 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/NotificationPaneAdapter.java +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/NotificationPaneAdapter.java @@ -1,13 +1,12 @@ package org.jabref.gui.edit.automaticfiededitor; -import java.util.Collections; - import javafx.scene.Node; import javafx.util.Duration; - import org.jabref.gui.LibraryTab; import org.jabref.gui.icon.IconTheme; +import java.util.Collections; + public class NotificationPaneAdapter extends LibraryTab.DatabaseNotification { public NotificationPaneAdapter(Node content) { diff --git a/src/main/java/org/jabref/gui/edit/automaticfiededitor/copyormovecontent/CopyOrMoveFieldContentTab.fxml b/src/main/java/org/jabref/gui/edit/automaticfiededitor/copyormovecontent/CopyOrMoveFieldContentTab.fxml index a0eece76ce5..699688e8383 100644 --- a/src/main/java/org/jabref/gui/edit/automaticfiededitor/copyormovecontent/CopyOrMoveFieldContentTab.fxml +++ b/src/main/java/org/jabref/gui/edit/automaticfiededitor/copyormovecontent/CopyOrMoveFieldContentTab.fxml @@ -1,15 +1,8 @@ - - - - - - - - - + + - - - - - - - - - - - + + - - - - - + - - - - - - + - - - - + + fields; diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsCache.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsCache.java index 3f2f9f53b7b..c5d9d6a077e 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsCache.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsCache.java @@ -1,13 +1,13 @@ package org.jabref.gui.entryeditor.citationrelationtab; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.identifier.DOI; + import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.identifier.DOI; - public class BibEntryRelationsCache { private static final Map> CITATIONS_MAP = new HashMap<>(); private static final Map> REFERENCES_MAP = new HashMap<>(); diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsRepository.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsRepository.java index d042c41df50..1b50e8636bd 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsRepository.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryRelationsRepository.java @@ -1,11 +1,11 @@ package org.jabref.gui.entryeditor.citationrelationtab; -import java.util.List; - import org.jabref.gui.entryeditor.citationrelationtab.semanticscholar.SemanticScholarFetcher; import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; +import java.util.List; + public class BibEntryRelationsRepository { private final SemanticScholarFetcher fetcher; private final BibEntryRelationsCache cache; diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryView.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryView.java index d6939efabc6..2b014c584e9 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryView.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/BibEntryView.java @@ -1,13 +1,10 @@ package org.jabref.gui.entryeditor.citationrelationtab; -import java.util.EnumSet; - import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Text; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.util.TextFlowLimited; import org.jabref.model.entry.BibEntry; @@ -15,6 +12,8 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.util.EnumSet; + /** * Class to unify the display method of BibEntries in ListViews. */ diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java index feaed655eb7..174fa945ced 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/CitationRelationsTab.java @@ -1,11 +1,6 @@ package org.jabref.gui.entryeditor.citationrelationtab; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.collections.FXCollections; @@ -13,17 +8,12 @@ import javafx.css.PseudoClass; import javafx.geometry.Pos; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.control.ProgressIndicator; -import javafx.scene.control.SplitPane; -import javafx.scene.control.ToggleButton; -import javafx.scene.control.Tooltip; +import javafx.scene.control.*; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; - +import org.controlsfx.control.CheckListView; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.LibraryTab; @@ -42,12 +32,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.controlsfx.control.CheckListView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + /** * GUI for tab displaying an articles citation relations in two lists based on the currently selected BibEntry */ diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/CitationFetcher.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/CitationFetcher.java index 4b10cadce4f..3fd419d0939 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/CitationFetcher.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/CitationFetcher.java @@ -1,10 +1,10 @@ package org.jabref.gui.entryeditor.citationrelationtab.semanticscholar; -import java.util.List; - import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; +import java.util.List; + /** * Searches web resources for citing related articles based on a {@link BibEntry}. */ diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/PaperDetails.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/PaperDetails.java index 8047f510a21..009e940e4ca 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/PaperDetails.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/PaperDetails.java @@ -1,11 +1,11 @@ package org.jabref.gui.entryeditor.citationrelationtab.semanticscholar; -import java.util.List; -import java.util.stream.Collectors; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; +import java.util.List; +import java.util.stream.Collectors; + public class PaperDetails { private String paperId; private String title; diff --git a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/SemanticScholarFetcher.java b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/SemanticScholarFetcher.java index e5072eb7c4f..bdbf6950d49 100644 --- a/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/SemanticScholarFetcher.java +++ b/src/main/java/org/jabref/gui/entryeditor/citationrelationtab/semanticscholar/SemanticScholarFetcher.java @@ -1,17 +1,16 @@ package org.jabref.gui.entryeditor.citationrelationtab.semanticscholar; +import com.google.gson.Gson; +import org.jabref.logic.importer.FetcherException; +import org.jabref.logic.net.URLDownload; +import org.jabref.model.entry.BibEntry; + import java.io.IOException; import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.List; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.net.URLDownload; -import org.jabref.model.entry.BibEntry; - -import com.google.gson.Gson; - public class SemanticScholarFetcher implements CitationFetcher { private static final String SEMANTIC_SCHOLAR_API = "https://api.semanticscholar.org/graph/v1/"; diff --git a/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTab.fxml b/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTab.fxml index c1829bfa10d..4dd4aea4d30 100644 --- a/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTab.fxml +++ b/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTab.fxml @@ -1,18 +1,9 @@ - - - - - - - - - - - - + + + - - - - + { private ErrorConsoleViewModel viewModel; diff --git a/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleViewModel.java b/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleViewModel.java index 8972200fd63..c2d92422bda 100644 --- a/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleViewModel.java +++ b/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleViewModel.java @@ -1,15 +1,10 @@ package org.jabref.gui.errorconsole; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.ListProperty; import javafx.beans.property.ReadOnlyListWrapper; import javafx.collections.ObservableList; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.gui.AbstractViewModel; import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; @@ -20,12 +15,15 @@ import org.jabref.logic.util.BuildInfo; import org.jabref.logic.util.OS; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.apache.http.client.utils.URIBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + public class ErrorConsoleViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ErrorConsoleViewModel.class); diff --git a/src/main/java/org/jabref/gui/errorconsole/LogEventViewModel.java b/src/main/java/org/jabref/gui/errorconsole/LogEventViewModel.java index 46eda97b973..a8c9533cefd 100644 --- a/src/main/java/org/jabref/gui/errorconsole/LogEventViewModel.java +++ b/src/main/java/org/jabref/gui/errorconsole/LogEventViewModel.java @@ -1,15 +1,14 @@ package org.jabref.gui.errorconsole; -import java.util.Objects; -import java.util.Optional; - +import com.google.common.base.Throwables; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; import org.jabref.logic.util.OS; - -import com.google.common.base.Throwables; import org.tinylog.core.LogEntry; +import java.util.Objects; +import java.util.Optional; + public class LogEventViewModel { private final LogEntry logEvent; diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml index 3b4c3447f97..68cbf2729de 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialog.fxml @@ -1,15 +1,8 @@ - - - - - - - - - + + { private final ExporterViewModel exporter; diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java index d537763d760..a31e0cb0f97 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogViewModel.java @@ -1,10 +1,7 @@ package org.jabref.gui.exporter; -import java.nio.file.Path; - import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.util.FileDialogConfiguration; @@ -12,10 +9,11 @@ import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Path; + /** * This view model can be used both for "add exporter" and "modify exporter" functionalities. * It takes an optional exporter which is empty for "add exporter," and takes the selected exporter diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index e2368c64e29..a3c47678fe0 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -1,15 +1,8 @@ package org.jabref.gui.exporter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - import javafx.stage.FileChooser; import javafx.util.Duration; - +import org.controlsfx.control.action.Action; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.LibraryTab; @@ -31,11 +24,16 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.PreferencesService; - -import org.controlsfx.control.action.Action; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + /** * Performs an export action */ @@ -140,7 +138,7 @@ private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilt fileDirForDatabase, abbreviationRepository); return null; // can not use BackgroundTask.wrap(Runnable) because Runnable.run() can't throw - // Exceptions + // Exceptions }) .onSuccess(save -> { LibraryTab.DatabaseNotification notificationPane = diff --git a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java index e75f4832755..019b0e89248 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java +++ b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java @@ -1,17 +1,6 @@ package org.jabref.gui.exporter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - import javafx.scene.input.ClipboardContent; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; @@ -27,10 +16,15 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + public class ExportToClipboardAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(ExportToClipboardAction.class); diff --git a/src/main/java/org/jabref/gui/exporter/ExporterViewModel.java b/src/main/java/org/jabref/gui/exporter/ExporterViewModel.java index 40b875addac..8707ee21f4d 100644 --- a/src/main/java/org/jabref/gui/exporter/ExporterViewModel.java +++ b/src/main/java/org/jabref/gui/exporter/ExporterViewModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.logic.exporter.TemplateExporter; /** diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index 97fbf975060..6edcb5b11ed 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -1,23 +1,11 @@ package org.jabref.gui.exporter; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.charset.UnsupportedCharsetException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; import javafx.scene.control.DialogPane; import javafx.scene.control.TableColumn; import javafx.scene.layout.VBox; import javafx.scene.text.Text; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.autosaveandbackup.AutosaveManager; @@ -26,12 +14,7 @@ import org.jabref.gui.maintable.columns.MainTableColumn; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.FileDialogConfiguration; -import org.jabref.logic.exporter.AtomicFileWriter; -import org.jabref.logic.exporter.BibDatabaseWriter; -import org.jabref.logic.exporter.BibWriter; -import org.jabref.logic.exporter.BibtexDatabaseWriter; -import org.jabref.logic.exporter.SaveException; -import org.jabref.logic.exporter.SelfContainedSaveConfiguration; +import org.jabref.logic.exporter.*; import org.jabref.logic.l10n.Encodings; import org.jabref.logic.l10n.Localization; import org.jabref.logic.shared.DatabaseLocation; @@ -43,10 +26,20 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.model.metadata.SelfContainedSaveOrder; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + /** * Action for the "Save" and "Save as" operations called from BasePanel. This class is also used for save operations * when closing a database or quitting the applications. diff --git a/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java b/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java index 6bfeea9f35e..ab57fc30fe6 100644 --- a/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java +++ b/src/main/java/org/jabref/gui/exporter/WriteMetadataToLinkedPdfsAction.java @@ -1,11 +1,5 @@ package org.jabref.gui.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; @@ -21,10 +15,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; /** diff --git a/src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java b/src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java index b2e486af726..e0148edca73 100644 --- a/src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java @@ -1,11 +1,6 @@ package org.jabref.gui.externalfiles; -import java.util.List; - -import javax.swing.undo.UndoManager; - import javafx.concurrent.Task; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; @@ -17,6 +12,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.List; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; diff --git a/src/main/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtil.java b/src/main/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtil.java index 940e72b0eeb..782280337a5 100644 --- a/src/main/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtil.java +++ b/src/main/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtil.java @@ -1,13 +1,5 @@ package org.jabref.gui.externalfiles; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.externalfiletype.UnknownExternalFileType; @@ -24,10 +16,17 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class AutoSetFileLinksUtil { public static class LinkFilesResult { diff --git a/src/main/java/org/jabref/gui/externalfiles/ChainedFilters.java b/src/main/java/org/jabref/gui/externalfiles/ChainedFilters.java index 4162c9c674f..03e40185074 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ChainedFilters.java +++ b/src/main/java/org/jabref/gui/externalfiles/ChainedFilters.java @@ -1,13 +1,13 @@ package org.jabref.gui.externalfiles; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Path; import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Chains the given filters - if ALL of them accept, the result is also accepted */ diff --git a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java index 80934048eff..4d93a8d7c11 100644 --- a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java @@ -1,13 +1,6 @@ package org.jabref.gui.externalfiles; -import java.net.URL; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; - import javafx.concurrent.Task; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -20,10 +13,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.URL; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + /** * Try to download fulltext PDF for selected entry(ies) by following URL or DOI link. */ diff --git a/src/main/java/org/jabref/gui/externalfiles/ExternalFilesEntryLinker.java b/src/main/java/org/jabref/gui/externalfiles/ExternalFilesEntryLinker.java index 59b170d2bc0..f97e0bd367d 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ExternalFilesEntryLinker.java +++ b/src/main/java/org/jabref/gui/externalfiles/ExternalFilesEntryLinker.java @@ -1,13 +1,5 @@ package org.jabref.gui.externalfiles; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; @@ -23,10 +15,17 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + public class ExternalFilesEntryLinker { private static final Logger LOGGER = LoggerFactory.getLogger(ExternalFilesEntryLinker.class); diff --git a/src/main/java/org/jabref/gui/externalfiles/FileDownloadTask.java b/src/main/java/org/jabref/gui/externalfiles/FileDownloadTask.java index cb49f8f7f11..fa99676dc66 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FileDownloadTask.java +++ b/src/main/java/org/jabref/gui/externalfiles/FileDownloadTask.java @@ -1,15 +1,14 @@ package org.jabref.gui.externalfiles; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; - +import com.tobiasdiez.easybind.EasyBind; import org.jabref.gui.util.BackgroundTask; import org.jabref.logic.net.ProgressInputStream; import org.jabref.logic.net.URLDownload; -import com.tobiasdiez.easybind.EasyBind; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; public class FileDownloadTask extends BackgroundTask { diff --git a/src/main/java/org/jabref/gui/externalfiles/FileExtensionViewModel.java b/src/main/java/org/jabref/gui/externalfiles/FileExtensionViewModel.java index eb389e0ede4..12d708250ee 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FileExtensionViewModel.java +++ b/src/main/java/org/jabref/gui/externalfiles/FileExtensionViewModel.java @@ -1,10 +1,5 @@ package org.jabref.gui.externalfiles; -import java.nio.file.DirectoryStream.Filter; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Collectors; - import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.icon.JabRefIcon; @@ -13,6 +8,11 @@ import org.jabref.logic.util.FileType; import org.jabref.preferences.FilePreferences; +import java.nio.file.DirectoryStream.Filter; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Collectors; + public class FileExtensionViewModel { private final String description; diff --git a/src/main/java/org/jabref/gui/externalfiles/FileFilterUtils.java b/src/main/java/org/jabref/gui/externalfiles/FileFilterUtils.java index c33e1803fae..ea50f91366e 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FileFilterUtils.java +++ b/src/main/java/org/jabref/gui/externalfiles/FileFilterUtils.java @@ -1,5 +1,8 @@ package org.jabref.gui.externalfiles; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -10,9 +13,6 @@ import java.util.List; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FileFilterUtils { private static final Logger LOGGER = LoggerFactory.getLogger(FileFilterUtils.class); diff --git a/src/main/java/org/jabref/gui/externalfiles/GitIgnoreFileFilter.java b/src/main/java/org/jabref/gui/externalfiles/GitIgnoreFileFilter.java index e21ac55d960..4ff847e30ea 100644 --- a/src/main/java/org/jabref/gui/externalfiles/GitIgnoreFileFilter.java +++ b/src/main/java/org/jabref/gui/externalfiles/GitIgnoreFileFilter.java @@ -1,18 +1,14 @@ package org.jabref.gui.externalfiles; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; -import java.nio.file.DirectoryStream; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.PathMatcher; +import java.nio.file.*; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import static java.util.function.Predicate.not; public class GitIgnoreFileFilter implements DirectoryStream.Filter { diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportFilesResultItemViewModel.java b/src/main/java/org/jabref/gui/externalfiles/ImportFilesResultItemViewModel.java index 3677107b427..e79fa86f047 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportFilesResultItemViewModel.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportFilesResultItemViewModel.java @@ -1,16 +1,15 @@ package org.jabref.gui.externalfiles; -import java.nio.file.Path; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.scene.paint.Color; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; +import java.nio.file.Path; + public class ImportFilesResultItemViewModel { private final StringProperty file = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java index b3b7d0a67f9..2e9d0003b30 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java @@ -1,18 +1,6 @@ package org.jabref.gui.externalfiles; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.CompoundEdit; -import javax.swing.undo.UndoManager; - +import com.google.common.annotations.VisibleForTesting; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.StateManager; @@ -25,12 +13,8 @@ import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.database.DuplicateCheck; import org.jabref.logic.externalfiles.ExternalFilesContentImporter; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportCleanup; -import org.jabref.logic.importer.ImportException; -import org.jabref.logic.importer.ImportFormatReader; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.ImportFormatReader.UnknownFormatImport; -import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.fetcher.ArXivFetcher; import org.jabref.logic.importer.fetcher.DoiFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.IsbnFetcher; @@ -51,11 +35,17 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.PreferencesService; - -import com.google.common.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.CompoundEdit; +import javax.swing.undo.UndoManager; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.*; + public class ImportHandler { private static final Logger LOGGER = LoggerFactory.getLogger(ImportHandler.class); diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawler.java b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawler.java index 1ee7ab018b6..c10afe32d41 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawler.java +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawler.java @@ -1,5 +1,14 @@ package org.jabref.gui.externalfiles; +import javafx.scene.control.CheckBoxTreeItem; +import org.jabref.gui.util.BackgroundTask; +import org.jabref.gui.util.FileNodeViewModel; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.preferences.FilePreferences; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; import java.io.IOException; import java.nio.file.DirectoryStream.Filter; @@ -12,17 +21,6 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; -import javafx.scene.control.CheckBoxTreeItem; - -import org.jabref.gui.util.BackgroundTask; -import org.jabref.gui.util.FileNodeViewModel; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.preferences.FilePreferences; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Util class for searching files on the file system which are not linked to a provided {@link BibDatabase}. */ diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialog.fxml b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialog.fxml index 0c913b32db8..4dae0cdfacc 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialog.fxml +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialog.fxml @@ -1,27 +1,9 @@ - - - - - - - - - - - - - - - - - - - - - + + + { diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java index 6ea2a7f47bc..82bf22ed52c 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java @@ -1,52 +1,37 @@ package org.jabref.gui.externalfiles; -import java.io.BufferedWriter; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.DirectoryStream.Filter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import javax.swing.undo.UndoManager; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.DoubleProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleDoubleProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.control.ProgressIndicator; import javafx.scene.control.TreeItem; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; -import org.jabref.gui.util.BackgroundTask; -import org.jabref.gui.util.DirectoryDialogConfiguration; -import org.jabref.gui.util.FileDialogConfiguration; -import org.jabref.gui.util.FileNodeViewModel; -import org.jabref.gui.util.TaskExecutor; +import org.jabref.gui.util.*; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.DirectoryStream.Filter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + public class UnlinkedFilesDialogViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(UnlinkedFilesDialogViewModel.class); diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedPDFFileFilter.java b/src/main/java/org/jabref/gui/externalfiles/UnlinkedPDFFileFilter.java index 395d9870931..22b5603a9c8 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedPDFFileFilter.java +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedPDFFileFilter.java @@ -1,5 +1,11 @@ package org.jabref.gui.externalfiles; +import org.jabref.logic.util.io.DatabaseFileLookup; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.jabref.preferences.FilePreferences; + import java.io.FileFilter; import java.io.IOException; import java.nio.file.DirectoryStream; @@ -7,12 +13,6 @@ import java.nio.file.Files; import java.nio.file.Path; -import org.jabref.logic.util.io.DatabaseFileLookup; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.preferences.FilePreferences; - /** * {@link FileFilter} implementation, that allows only files which are not linked in any of the {@link BibEntry}s of the * specified {@link BibDatabase}. diff --git a/src/main/java/org/jabref/gui/externalfiletype/CustomExternalFileType.java b/src/main/java/org/jabref/gui/externalfiletype/CustomExternalFileType.java index d76a0532b5b..d54ee4be568 100644 --- a/src/main/java/org/jabref/gui/externalfiletype/CustomExternalFileType.java +++ b/src/main/java/org/jabref/gui/externalfiletype/CustomExternalFileType.java @@ -1,10 +1,10 @@ package org.jabref.gui.externalfiletype; -import java.util.Objects; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; +import java.util.Objects; + /** * This class defines a type of external files that can be linked to from JabRef. * The class contains enough information to provide an icon, a standard extension diff --git a/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java b/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java index db0f12b5bc7..d2bc101e0a0 100644 --- a/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java +++ b/src/main/java/org/jabref/gui/externalfiletype/ExternalFileTypes.java @@ -1,21 +1,14 @@ package org.jabref.gui.externalfiletype; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.entry.LinkedFile; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.FilePreferences; +import java.nio.file.Path; +import java.util.*; + // Do not make this class final, as it otherwise can't be mocked for tests public class ExternalFileTypes { diff --git a/src/main/java/org/jabref/gui/fieldeditors/AbstractEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/AbstractEditorViewModel.java index 5996c3c79d8..da7606392e0 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/AbstractEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/AbstractEditorViewModel.java @@ -1,12 +1,13 @@ package org.jabref.gui.fieldeditors; -import java.util.Collection; - -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyObservableValue; +import de.saxsys.mvvmfx.utils.validation.CompositeValidator; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.Validator; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - +import org.controlsfx.control.textfield.AutoCompletionBinding; import org.jabref.gui.AbstractViewModel; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.undo.UndoableFieldChange; @@ -16,12 +17,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; -import com.tobiasdiez.easybind.EasyObservableValue; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.Validator; -import org.controlsfx.control.textfield.AutoCompletionBinding; +import javax.swing.undo.UndoManager; +import java.util.Collection; public class AbstractEditorViewModel extends AbstractViewModel { protected final Field field; diff --git a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.java b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.java index 8cf61af2ae7..ace4cbb22ee 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.java @@ -1,14 +1,11 @@ package org.jabref.gui.fieldeditors; -import java.util.Collections; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.layout.HBox; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.StandardActions; @@ -19,8 +16,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; +import java.util.Collections; public class CitationKeyEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditorViewModel.java index b58033eb77e..519c440319d 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditorViewModel.java @@ -1,7 +1,6 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import de.saxsys.mvvmfx.utils.commands.Command; import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.citationkeypattern.GenerateCitationKeySingleAction; @@ -10,7 +9,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.commands.Command; +import javax.swing.undo.UndoManager; public class CitationKeyEditorViewModel extends AbstractEditorViewModel { private final PreferencesService preferencesService; diff --git a/src/main/java/org/jabref/gui/fieldeditors/ContextMenuAddable.java b/src/main/java/org/jabref/gui/fieldeditors/ContextMenuAddable.java index 708ca1c785b..81c74819303 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ContextMenuAddable.java +++ b/src/main/java/org/jabref/gui/fieldeditors/ContextMenuAddable.java @@ -1,10 +1,10 @@ package org.jabref.gui.fieldeditors; +import javafx.scene.control.MenuItem; + import java.util.List; import java.util.function.Supplier; -import javafx.scene.control.MenuItem; - public interface ContextMenuAddable { /** * Adds the given list of menu items to the context menu. The usage of {@link Supplier} prevents that the menus need diff --git a/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java b/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java index cf268e393ce..201b507c3d3 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java @@ -1,13 +1,10 @@ package org.jabref.gui.fieldeditors; -import java.time.format.DateTimeFormatter; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.layout.HBox; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.util.component.TemporalAccessorPicker; import org.jabref.logic.integrity.FieldCheckers; @@ -15,8 +12,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; +import java.time.format.DateTimeFormatter; public class DateEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/DateEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/DateEditorViewModel.java index fb5a8e1f52e..ea573a8ca65 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/DateEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/DateEditorViewModel.java @@ -1,23 +1,20 @@ package org.jabref.gui.fieldeditors; -import java.time.DateTimeException; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; -import java.time.temporal.TemporalAccessor; - -import javax.swing.undo.UndoManager; - import javafx.util.StringConverter; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.Date; import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.time.DateTimeException; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.time.temporal.TemporalAccessor; + public class DateEditorViewModel extends AbstractEditorViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(DateEditorViewModel.class); diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java b/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java index d57148409be..5c4633da407 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java @@ -1,19 +1,18 @@ package org.jabref.gui.fieldeditors; -import java.net.URL; -import java.util.List; -import java.util.Objects; -import java.util.ResourceBundle; -import java.util.function.Supplier; - import javafx.fxml.Initializable; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.Globals; import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; +import java.net.URL; +import java.util.List; +import java.util.Objects; +import java.util.ResourceBundle; +import java.util.function.Supplier; + public class EditorTextArea extends javafx.scene.control.TextArea implements Initializable, ContextMenuAddable { private final ContextMenu contextMenu = new ContextMenu(); diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java b/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java index c5e8642e23e..2b594759d7e 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java @@ -1,20 +1,19 @@ package org.jabref.gui.fieldeditors; -import java.net.URL; -import java.util.List; -import java.util.ResourceBundle; -import java.util.function.Supplier; - import javafx.fxml.Initializable; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.Globals; import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; +import java.net.URL; +import java.util.List; +import java.util.ResourceBundle; +import java.util.function.Supplier; + public class EditorTextField extends javafx.scene.control.TextField implements Initializable, ContextMenuAddable { private final ContextMenu contextMenu = new ContextMenu(); diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorTypeEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/EditorTypeEditorViewModel.java index 46871352893..56ba7db9aca 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorTypeEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorTypeEditorViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class EditorTypeEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorValidator.java b/src/main/java/org/jabref/gui/fieldeditors/EditorValidator.java index 6396e4711ac..01811f4ee53 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorValidator.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorValidator.java @@ -1,13 +1,11 @@ package org.jabref.gui.fieldeditors; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; import javafx.scene.control.TextInputControl; - import org.jabref.gui.util.IconValidationDecorator; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; - public class EditorValidator { private final PreferencesService preferences; diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java b/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java index 14521918eeb..8e82be02a59 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java @@ -1,7 +1,6 @@ package org.jabref.gui.fieldeditors; import javafx.scene.Parent; - import org.jabref.gui.util.ControlHelper; import org.jabref.model.entry.BibEntry; diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java index 1d13f83c46f..a7032b2b069 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java @@ -1,11 +1,5 @@ package org.jabref.gui.fieldeditors; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Set; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.ContentSelectorSuggestionProvider; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -16,19 +10,19 @@ import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; -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.field.*; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Set; + @SuppressWarnings("unchecked") public class FieldEditors { diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java b/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java index 377b5919521..b0448afa0f4 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java @@ -5,7 +5,6 @@ import javafx.scene.control.Label; import javafx.scene.control.Tooltip; import javafx.stage.Screen; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.InternalField; diff --git a/src/main/java/org/jabref/gui/fieldeditors/GenderEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/GenderEditorViewModel.java index 5fa273b87da..9efcfef6a5d 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/GenderEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/GenderEditorViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class GenderEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/GroupEditor.java b/src/main/java/org/jabref/gui/fieldeditors/GroupEditor.java index 43a85137792..dae9b6eff4e 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/GroupEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/GroupEditor.java @@ -1,12 +1,6 @@ package org.jabref.gui.fieldeditors; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import javafx.scene.input.TransferMode; - import org.jabref.gui.DragAndDropDataFormats; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; @@ -15,6 +9,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.Optional; + public class GroupEditor extends SimpleEditor { private Optional bibEntry; diff --git a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java index 9d6c3b24e5d..d6291ec3633 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditor.java @@ -1,14 +1,11 @@ package org.jabref.gui.fieldeditors; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.layout.HBox; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -19,8 +16,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; +import java.util.Optional; public class ISSNEditor extends HBox implements FieldEditorFX { @FXML diff --git a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java index 897ddc308cd..7cc7323bc54 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/ISSNEditorViewModel.java @@ -1,9 +1,6 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import javafx.scene.control.Button; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -16,6 +13,8 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class ISSNEditorViewModel extends AbstractEditorViewModel { private final TaskExecutor taskExecutor; private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/fieldeditors/JournalEditor.java b/src/main/java/org/jabref/gui/fieldeditors/JournalEditor.java index 857d643a0a6..d616bd9da7e 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/JournalEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/JournalEditor.java @@ -1,12 +1,11 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.layout.HBox; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.AutoCompletionTextInputBinding; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -18,8 +17,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; public class JournalEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java index 580803cb28b..ad2951bb0f1 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/JournalEditorViewModel.java @@ -1,9 +1,6 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import javafx.scene.control.Button; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.util.TaskExecutor; @@ -12,6 +9,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; +import javax.swing.undo.UndoManager; + public class JournalEditorViewModel extends AbstractEditorViewModel { private final JournalAbbreviationRepository journalAbbreviationRepository; private final TaskExecutor taskExecutor; diff --git a/src/main/java/org/jabref/gui/fieldeditors/KeywordsEditor.java b/src/main/java/org/jabref/gui/fieldeditors/KeywordsEditor.java index 350fa701f5f..a0faecb949b 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/KeywordsEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/KeywordsEditor.java @@ -1,12 +1,12 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class KeywordsEditor extends SimpleEditor implements FieldEditorFX { public KeywordsEditor( diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditor.fxml b/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditor.fxml index 793f7291d0e..16919196030 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditor.fxml +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedEntriesEditor.fxml @@ -1,7 +1,7 @@ - + - - - - - - - + + { private BibDatabaseMode databaseMode; diff --git a/src/main/java/org/jabref/gui/fieldeditors/OptionEditor.java b/src/main/java/org/jabref/gui/fieldeditors/OptionEditor.java index 2ce1c578859..64efab0ac6a 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/OptionEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/OptionEditor.java @@ -1,18 +1,16 @@ package org.jabref.gui.fieldeditors; +import com.airhacks.afterburner.views.ViewLoader; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.ComboBox; import javafx.scene.control.ContextMenu; import javafx.scene.layout.HBox; - import org.jabref.gui.Globals; import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; import org.jabref.gui.util.ViewModelListCellFactory; import org.jabref.model.entry.BibEntry; -import com.airhacks.afterburner.views.ViewLoader; - /** * Field editor that provides various pre-defined options as a drop-down combobox. */ diff --git a/src/main/java/org/jabref/gui/fieldeditors/OptionEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/OptionEditorViewModel.java index 3ad32a78dc4..213c5382c13 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/OptionEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/OptionEditorViewModel.java @@ -1,15 +1,13 @@ package org.jabref.gui.fieldeditors; -import java.util.List; - -import javax.swing.undo.UndoManager; - import javafx.util.StringConverter; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.field.Field; +import javax.swing.undo.UndoManager; +import java.util.List; + public abstract class OptionEditorViewModel extends AbstractEditorViewModel { public OptionEditorViewModel( diff --git a/src/main/java/org/jabref/gui/fieldeditors/OwnerEditor.java b/src/main/java/org/jabref/gui/fieldeditors/OwnerEditor.java index b8f35d5a3d8..161bc3ee2f0 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/OwnerEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/OwnerEditor.java @@ -1,11 +1,10 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.layout.HBox; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.fieldeditors.contextmenu.EditorMenus; import org.jabref.logic.integrity.FieldCheckers; @@ -13,8 +12,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; public class OwnerEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/OwnerEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/OwnerEditorViewModel.java index 6605919b59a..0f27c05bcdb 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/OwnerEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/OwnerEditorViewModel.java @@ -1,12 +1,12 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class OwnerEditorViewModel extends AbstractEditorViewModel { private final PreferencesService preferences; diff --git a/src/main/java/org/jabref/gui/fieldeditors/PaginationEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/PaginationEditorViewModel.java index 0be4b4c5156..f04894a8ad8 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PaginationEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PaginationEditorViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class PaginationEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/PatentTypeEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/PatentTypeEditorViewModel.java index 2b1b813a363..48053a62974 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PatentTypeEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PatentTypeEditorViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class PatentTypeEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java index 9c5ffbdad69..bb4c21bb8bf 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditor.java @@ -1,11 +1,8 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import javafx.scene.Parent; import javafx.scene.control.TextInputControl; import javafx.scene.layout.HBox; - import org.jabref.gui.autocompleter.AutoCompletionTextInputBinding; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.fieldeditors.contextmenu.EditorMenus; @@ -15,6 +12,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class PersonsEditor extends HBox implements FieldEditorFX { private final PersonsEditorViewModel viewModel; diff --git a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditorViewModel.java index c8ef71fd47d..759a358fbe6 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PersonsEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PersonsEditorViewModel.java @@ -1,21 +1,14 @@ package org.jabref.gui.fieldeditors; -import java.util.Collection; - -import javax.swing.undo.UndoManager; - import javafx.util.StringConverter; - -import org.jabref.gui.autocompleter.AppendPersonNamesStrategy; -import org.jabref.gui.autocompleter.AutoCompletePreferences; -import org.jabref.gui.autocompleter.AutoCompletionStrategy; -import org.jabref.gui.autocompleter.PersonNameStringConverter; -import org.jabref.gui.autocompleter.SuggestionProvider; +import org.controlsfx.control.textfield.AutoCompletionBinding; +import org.jabref.gui.autocompleter.*; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.Author; import org.jabref.model.entry.field.Field; -import org.controlsfx.control.textfield.AutoCompletionBinding; +import javax.swing.undo.UndoManager; +import java.util.Collection; public class PersonsEditorViewModel extends AbstractEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/PopOverUtil.java b/src/main/java/org/jabref/gui/fieldeditors/PopOverUtil.java index 3ec21a636db..3a443ae9a07 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/PopOverUtil.java +++ b/src/main/java/org/jabref/gui/fieldeditors/PopOverUtil.java @@ -1,10 +1,8 @@ package org.jabref.gui.fieldeditors; -import java.util.Optional; - import javafx.scene.control.Button; import javafx.scene.control.ProgressIndicator; - +import org.controlsfx.control.PopOver; import org.jabref.gui.DialogService; import org.jabref.gui.fieldeditors.journalinfo.JournalInfoView; import org.jabref.gui.util.BackgroundTask; @@ -13,7 +11,7 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.controlsfx.control.PopOver; +import java.util.Optional; public class PopOverUtil { diff --git a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java index df9bf1c1370..c930803ec66 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java @@ -1,12 +1,9 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import javafx.scene.Parent; import javafx.scene.control.TextInputControl; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; - import org.jabref.gui.autocompleter.AutoCompletionTextInputBinding; import org.jabref.gui.autocompleter.ContentSelectorSuggestionProvider; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -16,6 +13,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class SimpleEditor extends HBox implements FieldEditorFX { private final SimpleEditorViewModel viewModel; diff --git a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditorViewModel.java index 4305ce69d58..b93395e94b9 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditorViewModel.java @@ -1,13 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - import org.jabref.gui.autocompleter.AppendWordsStrategy; import org.jabref.gui.autocompleter.AutoCompletionStrategy; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.field.Field; +import javax.swing.undo.UndoManager; + public class SimpleEditorViewModel extends AbstractEditorViewModel { public SimpleEditorViewModel( diff --git a/src/main/java/org/jabref/gui/fieldeditors/TextInputControlBehavior.java b/src/main/java/org/jabref/gui/fieldeditors/TextInputControlBehavior.java index bbd05eec4b4..31e39301ed1 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/TextInputControlBehavior.java +++ b/src/main/java/org/jabref/gui/fieldeditors/TextInputControlBehavior.java @@ -1,5 +1,6 @@ package org.jabref.gui.fieldeditors; +import com.sun.javafx.scene.control.Properties; import javafx.geometry.Point2D; import javafx.geometry.Rectangle2D; import javafx.scene.Scene; @@ -12,8 +13,6 @@ import javafx.stage.Screen; import javafx.stage.Window; -import com.sun.javafx.scene.control.Properties; - /** * This class contains some code taken from {@link com.sun.javafx.scene.control.behavior.TextInputControlBehavior}, * witch is not accessible and thus we have no other choice. diff --git a/src/main/java/org/jabref/gui/fieldeditors/TypeEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/TypeEditorViewModel.java index a48b573e3f7..a6351e2ef22 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/TypeEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/TypeEditorViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class TypeEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java index 050e184858f..08d04b69083 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java +++ b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java @@ -1,5 +1,8 @@ package org.jabref.gui.fieldeditors; +import org.jabref.gui.externalfiletype.ExternalFileTypes; +import org.jabref.preferences.FilePreferences; + import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; @@ -7,9 +10,6 @@ import java.util.Objects; import java.util.Optional; -import org.jabref.gui.externalfiletype.ExternalFileTypes; -import org.jabref.preferences.FilePreferences; - public class URLUtil { private static final String URL_EXP = "^(https?|ftp)://.+"; diff --git a/src/main/java/org/jabref/gui/fieldeditors/UrlEditor.java b/src/main/java/org/jabref/gui/fieldeditors/UrlEditor.java index 215b14cdfa7..2eac078e97b 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/UrlEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/UrlEditor.java @@ -1,16 +1,12 @@ package org.jabref.gui.fieldeditors; -import java.util.List; -import java.util.function.Supplier; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.MenuItem; import javafx.scene.layout.HBox; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.fieldeditors.contextmenu.EditorMenus; @@ -21,8 +17,9 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.function.Supplier; public class UrlEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/UrlEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/UrlEditorViewModel.java index 17905f1a2ea..0272291ff55 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/UrlEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/UrlEditorViewModel.java @@ -1,12 +1,8 @@ package org.jabref.gui.fieldeditors; -import java.io.IOException; - -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.desktop.JabRefDesktop; @@ -16,7 +12,8 @@ import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import javax.swing.undo.UndoManager; +import java.io.IOException; public class UrlEditorViewModel extends AbstractEditorViewModel { private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/fieldeditors/WriteMetadataToSinglePdfAction.java b/src/main/java/org/jabref/gui/fieldeditors/WriteMetadataToSinglePdfAction.java index 1fa47a5e711..396efa39402 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/WriteMetadataToSinglePdfAction.java +++ b/src/main/java/org/jabref/gui/fieldeditors/WriteMetadataToSinglePdfAction.java @@ -1,11 +1,5 @@ package org.jabref.gui.fieldeditors; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Optional; - -import javax.xml.transform.TransformerException; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.util.BackgroundTask; @@ -21,10 +15,14 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.transform.TransformerException; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Optional; + /** * Writes XMP metadata to the selected file according to the linking entry */ diff --git a/src/main/java/org/jabref/gui/fieldeditors/YesNoEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/YesNoEditorViewModel.java index 4e164ac9a4d..45f5b2ca8dd 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/YesNoEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/YesNoEditorViewModel.java @@ -1,13 +1,12 @@ package org.jabref.gui.fieldeditors; -import javax.swing.undo.UndoManager; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.logic.integrity.FieldCheckers; import org.jabref.model.entry.field.Field; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import javax.swing.undo.UndoManager; public class YesNoEditorViewModel extends MapBasedEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/DefaultMenu.java b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/DefaultMenu.java index 34bda0b4535..a00db0ae450 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/DefaultMenu.java +++ b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/DefaultMenu.java @@ -1,20 +1,18 @@ package org.jabref.gui.fieldeditors.contextmenu; -import java.util.List; -import java.util.Objects; -import java.util.function.Supplier; - +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.control.TextInputControl; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.formatter.Formatters; import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; -import com.tobiasdiez.easybind.EasyBind; +import java.util.List; +import java.util.Objects; +import java.util.function.Supplier; public class DefaultMenu implements Supplier> { diff --git a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java index 73cb9770ac7..bb59a73a3a7 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java +++ b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java @@ -1,7 +1,6 @@ package org.jabref.gui.fieldeditors.contextmenu; -import java.util.List; - +import com.sun.javafx.scene.control.Properties; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.BooleanProperty; @@ -9,7 +8,6 @@ import javafx.scene.control.PasswordField; import javafx.scene.control.TextInputControl; import javafx.scene.input.Clipboard; - import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; @@ -17,7 +15,7 @@ import org.jabref.gui.util.BindingsHelper; import org.jabref.logic.util.OS; -import com.sun.javafx.scene.control.Properties; +import java.util.List; public class EditorContextAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorMenus.java b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorMenus.java index 9b2d56cff2a..39d66c8b6e1 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorMenus.java +++ b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorMenus.java @@ -1,14 +1,10 @@ package org.jabref.gui.fieldeditors.contextmenu; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Supplier; - +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.control.TextArea; import javafx.scene.control.TextInputControl; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.StandardActions; @@ -19,7 +15,9 @@ import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; /** * Provides context menus for the text fields of the entry editor. Note that we use {@link Supplier} to prevent an early diff --git a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/ProtectedTermsMenu.java b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/ProtectedTermsMenu.java index fe35594ccf7..36f38e102d3 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/contextmenu/ProtectedTermsMenu.java +++ b/src/main/java/org/jabref/gui/fieldeditors/contextmenu/ProtectedTermsMenu.java @@ -1,13 +1,9 @@ package org.jabref.gui.fieldeditors.contextmenu; -import java.util.Objects; -import java.util.Optional; - import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.control.TextInputControl; - import org.jabref.gui.Globals; import org.jabref.gui.actions.Action; import org.jabref.gui.actions.ActionFactory; @@ -20,6 +16,9 @@ import org.jabref.logic.l10n.Localization; import org.jabref.logic.protectedterms.ProtectedTermsList; +import java.util.Objects; +import java.util.Optional; + class ProtectedTermsMenu extends Menu { private static final Formatter FORMATTER = new ProtectTermsFormatter(Globals.protectedTermsLoader); diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/BaseIdentifierEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/BaseIdentifierEditorViewModel.java index 3ad14477461..4a527cdbe6a 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/BaseIdentifierEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/BaseIdentifierEditorViewModel.java @@ -1,15 +1,10 @@ package org.jabref.gui.fieldeditors.identifier; -import java.io.IOException; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.desktop.JabRefDesktop; @@ -25,11 +20,13 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.identifier.Identifier; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.IOException; +import java.util.Optional; + public abstract class BaseIdentifierEditorViewModel extends AbstractEditorViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(BaseIdentifierEditorViewModel.class); protected BooleanProperty isInvalidIdentifier = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/DoiIdentifierEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/DoiIdentifierEditorViewModel.java index a3745e6091c..73ffa587011 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/DoiIdentifierEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/DoiIdentifierEditorViewModel.java @@ -1,7 +1,5 @@ package org.jabref.gui.fieldeditors.identifier; -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -16,10 +14,11 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; + public class DoiIdentifierEditorViewModel extends BaseIdentifierEditorViewModel { public static final Logger LOGGER = LoggerFactory.getLogger(DoiIdentifierEditorViewModel.class); diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/EprintIdentifierEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/EprintIdentifierEditorViewModel.java index cc2c61ab8d9..fe4db731a1c 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/EprintIdentifierEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/EprintIdentifierEditorViewModel.java @@ -1,10 +1,8 @@ package org.jabref.gui.fieldeditors.identifier; -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyBind; import javafx.collections.MapChangeListener; import javafx.collections.WeakMapChangeListener; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.SuggestionProvider; import org.jabref.gui.util.TaskExecutor; @@ -17,7 +15,7 @@ import org.jabref.model.entry.identifier.EprintIdentifier; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import javax.swing.undo.UndoManager; public class EprintIdentifierEditorViewModel extends BaseIdentifierEditorViewModel { diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/ISBNIdentifierEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/ISBNIdentifierEditorViewModel.java index 11b6f41ca9b..0c5957d2ccc 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/ISBNIdentifierEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/ISBNIdentifierEditorViewModel.java @@ -1,7 +1,5 @@ package org.jabref.gui.fieldeditors.identifier; -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -14,6 +12,8 @@ import org.jabref.model.entry.identifier.ISBN; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class ISBNIdentifierEditorViewModel extends BaseIdentifierEditorViewModel { private final UndoManager undoManager; private final StateManager stateManager; diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.fxml b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.fxml index 084f1ab75e1..5511dbc3b0d 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.fxml +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.fxml @@ -1,8 +1,6 @@ - - - + diff --git a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java index 567f6c45047..39ea4edc812 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java @@ -1,15 +1,13 @@ package org.jabref.gui.fieldeditors.identifier; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.injection.Injector; +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProvider; @@ -25,13 +23,10 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.injection.Injector; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; +import java.util.Optional; -import static org.jabref.model.entry.field.StandardField.DOI; -import static org.jabref.model.entry.field.StandardField.EPRINT; -import static org.jabref.model.entry.field.StandardField.ISBN; +import static org.jabref.model.entry.field.StandardField.*; public class IdentifierEditor extends HBox implements FieldEditorFX { diff --git a/src/main/java/org/jabref/gui/fieldeditors/journalinfo/JournalInfo.fxml b/src/main/java/org/jabref/gui/fieldeditors/journalinfo/JournalInfo.fxml index a6f2a1c94e9..dc05513ffe7 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/journalinfo/JournalInfo.fxml +++ b/src/main/java/org/jabref/gui/fieldeditors/journalinfo/JournalInfo.fxml @@ -1,15 +1,9 @@ - - - - - - - - - - + + + + - - - - - - - - - - - - - - + + { // Basic Settings diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 9b66e9bdfaf..803259c9dd8 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -1,28 +1,11 @@ package org.jabref.gui.groups; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.*; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.event.Event; import javafx.scene.control.ButtonType; import javafx.scene.paint.Color; - import org.jabref.gui.DialogService; import org.jabref.gui.help.HelpAction; import org.jabref.gui.icon.IconTheme; @@ -36,17 +19,7 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.Keyword; import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AutomaticGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.MetaData; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; @@ -54,11 +27,15 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; public class GroupDialogViewModel { // Basic Settings diff --git a/src/main/java/org/jabref/gui/groups/GroupModeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupModeViewModel.java index 022941a97d5..305ce359e92 100644 --- a/src/main/java/org/jabref/gui/groups/GroupModeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupModeViewModel.java @@ -2,7 +2,6 @@ import javafx.scene.Node; import javafx.scene.control.Tooltip; - import org.jabref.gui.icon.IconTheme.JabRefIcons; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java index 32efcf56d3c..265becd6c0a 100644 --- a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java @@ -1,10 +1,7 @@ package org.jabref.gui.groups; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.EasyObservableList; import javafx.beans.InvalidationListener; import javafx.beans.WeakInvalidationListener; import javafx.beans.binding.Bindings; @@ -16,39 +13,24 @@ import javafx.collections.ObservableList; import javafx.scene.input.Dragboard; import javafx.scene.paint.Color; - import org.jabref.gui.DragAndDropDataFormats; import org.jabref.gui.StateManager; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; -import org.jabref.gui.util.BackgroundTask; -import org.jabref.gui.util.CustomLocalDragboard; -import org.jabref.gui.util.DefaultTaskExecutor; -import org.jabref.gui.util.DroppingMouseLocation; -import org.jabref.gui.util.TaskExecutor; +import org.jabref.gui.util.*; import org.jabref.logic.groups.DefaultGroupsFactory; import org.jabref.logic.layout.format.LatexToUnicodeFormatter; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.AutomaticGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupEntryChanger; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.KeywordGroup; -import org.jabref.model.groups.LastNameGroup; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; +import org.jabref.model.groups.*; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.EasyObservableList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; public class GroupNodeViewModel { diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeNodeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeNodeViewModel.java index cf3dfa4e732..426179710b7 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeNodeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeNodeViewModel.java @@ -1,26 +1,18 @@ package org.jabref.gui.groups; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Consumer; - -import javax.swing.undo.AbstractUndoableEdit; -import javax.swing.undo.UndoManager; - import org.jabref.gui.undo.CountingUndoManager; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupEntryChanger; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.KeywordGroup; -import org.jabref.model.groups.SearchGroup; - +import org.jabref.model.groups.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.AbstractUndoableEdit; +import javax.swing.undo.UndoManager; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + public class GroupTreeNodeViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(GroupTreeNodeViewModel.class); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 8d4c33733f2..0b91160e453 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -1,74 +1,44 @@ package org.jabref.gui.groups; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.text.DecimalFormat; -import java.time.Duration; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.ObjectProperty; import javafx.css.PseudoClass; import javafx.geometry.Orientation; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ContextMenu; -import javafx.scene.control.Control; -import javafx.scene.control.Menu; -import javafx.scene.control.MenuItem; -import javafx.scene.control.ScrollBar; -import javafx.scene.control.SelectionMode; -import javafx.scene.control.SeparatorMenuItem; -import javafx.scene.control.TextField; -import javafx.scene.control.Tooltip; -import javafx.scene.control.TreeItem; -import javafx.scene.control.TreeTableColumn; -import javafx.scene.control.TreeTableRow; -import javafx.scene.control.TreeTableView; -import javafx.scene.input.ClipboardContent; -import javafx.scene.input.DragEvent; -import javafx.scene.input.Dragboard; -import javafx.scene.input.MouseButton; -import javafx.scene.input.MouseEvent; -import javafx.scene.input.TransferMode; +import javafx.scene.control.*; +import javafx.scene.input.*; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.StackPane; import javafx.scene.text.Text; - +import org.controlsfx.control.textfield.CustomTextField; +import org.controlsfx.control.textfield.TextFields; import org.jabref.gui.DialogService; import org.jabref.gui.DragAndDropDataFormats; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; -import org.jabref.gui.util.BindingsHelper; -import org.jabref.gui.util.ControlHelper; -import org.jabref.gui.util.CustomLocalDragboard; -import org.jabref.gui.util.RecursiveTreeItem; -import org.jabref.gui.util.TaskExecutor; -import org.jabref.gui.util.ViewModelTreeTableCellFactory; -import org.jabref.gui.util.ViewModelTreeTableRowFactory; +import org.jabref.gui.util.*; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.groups.AllEntriesGroup; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.controlsfx.control.textfield.CustomTextField; -import org.controlsfx.control.textfield.TextFields; import org.reactfx.util.FxTimer; import org.reactfx.util.Timer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.text.DecimalFormat; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; + public class GroupTreeView extends BorderPane { private static final Logger LOGGER = LoggerFactory.getLogger(GroupTreeView.class); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 55eb5afe188..d98d983173a 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -1,26 +1,12 @@ package org.jabref.gui.groups; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import com.tobiasdiez.easybind.EasyBind; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.control.Alert; import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; @@ -29,19 +15,13 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; public class GroupTreeViewModel extends AbstractViewModel { diff --git a/src/main/java/org/jabref/gui/groups/GroupsPreferences.java b/src/main/java/org/jabref/gui/groups/GroupsPreferences.java index b8fb5531d63..6f7d823b8ba 100644 --- a/src/main/java/org/jabref/gui/groups/GroupsPreferences.java +++ b/src/main/java/org/jabref/gui/groups/GroupsPreferences.java @@ -4,7 +4,6 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; - import org.jabref.model.groups.GroupHierarchyType; public class GroupsPreferences { diff --git a/src/main/java/org/jabref/gui/groups/UndoableAddOrRemoveGroup.java b/src/main/java/org/jabref/gui/groups/UndoableAddOrRemoveGroup.java index 5e743312420..715da9639f8 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableAddOrRemoveGroup.java +++ b/src/main/java/org/jabref/gui/groups/UndoableAddOrRemoveGroup.java @@ -1,11 +1,11 @@ package org.jabref.gui.groups; -import java.util.List; - import org.jabref.gui.undo.AbstractUndoableJabRefEdit; import org.jabref.logic.l10n.Localization; import org.jabref.model.groups.GroupTreeNode; +import java.util.List; + public class UndoableAddOrRemoveGroup extends AbstractUndoableJabRefEdit { /** diff --git a/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java b/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java index 0922b0bbfed..115f93ebcfa 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java +++ b/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java @@ -1,14 +1,13 @@ package org.jabref.gui.groups; -import java.util.List; - -import javax.swing.undo.AbstractUndoableEdit; - import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableFieldChange; import org.jabref.logic.l10n.Localization; import org.jabref.model.FieldChange; +import javax.swing.undo.AbstractUndoableEdit; +import java.util.List; + public class UndoableChangeEntriesOfGroup { private UndoableChangeEntriesOfGroup() {} diff --git a/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java b/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java index f8f5e175b8e..95f99094704 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java +++ b/src/main/java/org/jabref/gui/groups/UndoableModifySubtree.java @@ -1,11 +1,11 @@ package org.jabref.gui.groups; -import java.util.ArrayList; -import java.util.List; - import org.jabref.gui.undo.AbstractUndoableJabRefEdit; import org.jabref.model.groups.GroupTreeNode; +import java.util.ArrayList; +import java.util.List; + public class UndoableModifySubtree extends AbstractUndoableJabRefEdit { /** diff --git a/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java b/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java index c4f367d31f7..1dd3e999743 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java +++ b/src/main/java/org/jabref/gui/groups/UndoableMoveGroup.java @@ -1,12 +1,12 @@ package org.jabref.gui.groups; -import java.util.List; -import java.util.Objects; - import org.jabref.gui.undo.AbstractUndoableJabRefEdit; import org.jabref.logic.l10n.Localization; import org.jabref.model.groups.GroupTreeNode; +import java.util.List; +import java.util.Objects; + class UndoableMoveGroup extends AbstractUndoableJabRefEdit { private final GroupTreeNodeViewModel root; diff --git a/src/main/java/org/jabref/gui/help/AboutAction.java b/src/main/java/org/jabref/gui/help/AboutAction.java index 9cc3a5447ee..d4355aa51a8 100644 --- a/src/main/java/org/jabref/gui/help/AboutAction.java +++ b/src/main/java/org/jabref/gui/help/AboutAction.java @@ -1,10 +1,9 @@ package org.jabref.gui.help; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; -import com.airhacks.afterburner.injection.Injector; - public class AboutAction extends SimpleCommand { private final AboutDialogView aboutDialogView; diff --git a/src/main/java/org/jabref/gui/help/AboutDialog.fxml b/src/main/java/org/jabref/gui/help/AboutDialog.fxml index f07afc81a2e..383d38ee57b 100644 --- a/src/main/java/org/jabref/gui/help/AboutDialog.fxml +++ b/src/main/java/org/jabref/gui/help/AboutDialog.fxml @@ -1,20 +1,10 @@ - - - - - - + - - - - - - - + + { @FXML diff --git a/src/main/java/org/jabref/gui/help/AboutDialogViewModel.java b/src/main/java/org/jabref/gui/help/AboutDialogViewModel.java index ac90799bc9f..a5c7dd4da2e 100644 --- a/src/main/java/org/jabref/gui/help/AboutDialogViewModel.java +++ b/src/main/java/org/jabref/gui/help/AboutDialogViewModel.java @@ -1,15 +1,10 @@ package org.jabref.gui.help; -import java.io.IOException; -import java.util.Locale; -import java.util.Objects; -import java.util.stream.Collectors; - +import com.google.common.collect.Lists; import javafx.beans.property.ReadOnlyBooleanProperty; import javafx.beans.property.ReadOnlyBooleanWrapper; import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.ReadOnlyStringWrapper; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; @@ -17,11 +12,14 @@ import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.BuildInfo; import org.jabref.preferences.PreferencesService; - -import com.google.common.collect.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.Locale; +import java.util.Objects; +import java.util.stream.Collectors; + public class AboutDialogViewModel extends AbstractViewModel { private static final String HOMEPAGE_URL = "https://www.jabref.org"; diff --git a/src/main/java/org/jabref/gui/help/ErrorConsoleAction.java b/src/main/java/org/jabref/gui/help/ErrorConsoleAction.java index a27ffacee40..cd0e1f4dc51 100644 --- a/src/main/java/org/jabref/gui/help/ErrorConsoleAction.java +++ b/src/main/java/org/jabref/gui/help/ErrorConsoleAction.java @@ -1,11 +1,10 @@ package org.jabref.gui.help; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.errorconsole.ErrorConsoleView; -import com.airhacks.afterburner.injection.Injector; - /** * Such an error console can be * useful in getting complete bug reports, especially from Windows users, diff --git a/src/main/java/org/jabref/gui/help/NewVersionDialog.java b/src/main/java/org/jabref/gui/help/NewVersionDialog.java index 4f5f4518c8c..65a8df5e194 100644 --- a/src/main/java/org/jabref/gui/help/NewVersionDialog.java +++ b/src/main/java/org/jabref/gui/help/NewVersionDialog.java @@ -1,12 +1,7 @@ package org.jabref.gui.help; -import javafx.scene.control.Button; -import javafx.scene.control.ButtonBar; -import javafx.scene.control.ButtonType; -import javafx.scene.control.Hyperlink; -import javafx.scene.control.Label; +import javafx.scene.control.*; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.util.BaseDialog; diff --git a/src/main/java/org/jabref/gui/help/VersionWorker.java b/src/main/java/org/jabref/gui/help/VersionWorker.java index 581c597c1f1..037bb0e5c32 100644 --- a/src/main/java/org/jabref/gui/help/VersionWorker.java +++ b/src/main/java/org/jabref/gui/help/VersionWorker.java @@ -1,11 +1,5 @@ package org.jabref.gui.help; -import java.io.IOException; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - import org.jabref.gui.DialogService; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.TaskExecutor; @@ -14,10 +8,15 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.InternalPreferences; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + /** * This worker checks if there is a new version of JabRef available. If there is it will display a dialog to the user * offering him multiple options to proceed (see changelog, go to the download page, ignore this version, and remind diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 5b8fc9697dc..d0aa43d1f0d 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -1,53 +1,23 @@ package org.jabref.gui.icon; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.ServiceLoader; -import java.util.Set; - import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.ToggleButton; import javafx.scene.image.Image; import javafx.scene.paint.Color; - import org.kordamp.ikonli.Ikon; import org.kordamp.ikonli.IkonProvider; -import org.kordamp.ikonli.materialdesign2.MaterialDesignA; -import org.kordamp.ikonli.materialdesign2.MaterialDesignB; -import org.kordamp.ikonli.materialdesign2.MaterialDesignC; -import org.kordamp.ikonli.materialdesign2.MaterialDesignD; -import org.kordamp.ikonli.materialdesign2.MaterialDesignE; -import org.kordamp.ikonli.materialdesign2.MaterialDesignF; -import org.kordamp.ikonli.materialdesign2.MaterialDesignG; -import org.kordamp.ikonli.materialdesign2.MaterialDesignH; -import org.kordamp.ikonli.materialdesign2.MaterialDesignI; -import org.kordamp.ikonli.materialdesign2.MaterialDesignK; -import org.kordamp.ikonli.materialdesign2.MaterialDesignL; -import org.kordamp.ikonli.materialdesign2.MaterialDesignM; -import org.kordamp.ikonli.materialdesign2.MaterialDesignN; -import org.kordamp.ikonli.materialdesign2.MaterialDesignO; -import org.kordamp.ikonli.materialdesign2.MaterialDesignP; -import org.kordamp.ikonli.materialdesign2.MaterialDesignR; -import org.kordamp.ikonli.materialdesign2.MaterialDesignS; -import org.kordamp.ikonli.materialdesign2.MaterialDesignT; -import org.kordamp.ikonli.materialdesign2.MaterialDesignU; -import org.kordamp.ikonli.materialdesign2.MaterialDesignV; -import org.kordamp.ikonli.materialdesign2.MaterialDesignW; +import org.kordamp.ikonli.materialdesign2.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.*; + import static java.util.EnumSet.allOf; public class IconTheme { diff --git a/src/main/java/org/jabref/gui/icon/InternalMaterialDesignIcon.java b/src/main/java/org/jabref/gui/icon/InternalMaterialDesignIcon.java index 0f654078ceb..e4043bda259 100644 --- a/src/main/java/org/jabref/gui/icon/InternalMaterialDesignIcon.java +++ b/src/main/java/org/jabref/gui/icon/InternalMaterialDesignIcon.java @@ -1,18 +1,16 @@ package org.jabref.gui.icon; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.scene.Node; import javafx.scene.paint.Color; - import org.jabref.gui.util.ColorUtil; - import org.kordamp.ikonli.Ikon; import org.kordamp.ikonli.javafx.FontIcon; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class InternalMaterialDesignIcon implements JabRefIcon { private final List icons; diff --git a/src/main/java/org/jabref/gui/icon/JabRefIcon.java b/src/main/java/org/jabref/gui/icon/JabRefIcon.java index c7d37eb2d53..ada4d3ca7f8 100644 --- a/src/main/java/org/jabref/gui/icon/JabRefIcon.java +++ b/src/main/java/org/jabref/gui/icon/JabRefIcon.java @@ -2,7 +2,6 @@ import javafx.scene.Node; import javafx.scene.paint.Color; - import org.kordamp.ikonli.Ikon; public interface JabRefIcon { diff --git a/src/main/java/org/jabref/gui/icon/JabRefIconView.java b/src/main/java/org/jabref/gui/icon/JabRefIconView.java index 9bbf8c4231b..ab60658d58c 100644 --- a/src/main/java/org/jabref/gui/icon/JabRefIconView.java +++ b/src/main/java/org/jabref/gui/icon/JabRefIconView.java @@ -1,13 +1,11 @@ package org.jabref.gui.icon; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.css.Size; import javafx.css.SizeUnits; - import org.jabref.gui.icon.IconTheme.JabRefIcons; - -import com.tobiasdiez.easybind.EasyBind; import org.kordamp.ikonli.javafx.FontIcon; public class JabRefIconView extends FontIcon { diff --git a/src/main/java/org/jabref/gui/icon/JabRefIkonHandler.java b/src/main/java/org/jabref/gui/icon/JabRefIkonHandler.java index 2f9bc45e0d1..9ce5d103a34 100644 --- a/src/main/java/org/jabref/gui/icon/JabRefIkonHandler.java +++ b/src/main/java/org/jabref/gui/icon/JabRefIkonHandler.java @@ -1,11 +1,11 @@ package org.jabref.gui.icon; -import java.io.InputStream; -import java.net.URL; - import org.kordamp.ikonli.AbstractIkonHandler; import org.kordamp.ikonli.Ikon; +import java.io.InputStream; +import java.net.URL; + public class JabRefIkonHandler extends AbstractIkonHandler { private static String FONT_RESOURCE = "/fonts/JabRefMaterialDesign.ttf"; diff --git a/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java b/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java index 4e97677ae80..fe57aaf97a2 100644 --- a/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java +++ b/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java @@ -1,7 +1,6 @@ package org.jabref.gui.importer; -import java.util.Optional; - +import org.controlsfx.control.PopOver; import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.StateManager; @@ -18,11 +17,11 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import org.controlsfx.control.PopOver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; + public class GenerateEntryFromIdAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(GenerateEntryFromIdAction.class); diff --git a/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdDialog.java b/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdDialog.java index 482a5cca3fa..fcc02f4020c 100644 --- a/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdDialog.java +++ b/src/main/java/org/jabref/gui/importer/GenerateEntryFromIdDialog.java @@ -1,10 +1,12 @@ package org.jabref.gui.importer; +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.DialogPane; import javafx.scene.control.TextField; - +import org.controlsfx.control.PopOver; import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.StateManager; @@ -14,10 +16,6 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; -import org.controlsfx.control.PopOver; - public class GenerateEntryFromIdDialog { @FXML diff --git a/src/main/java/org/jabref/gui/importer/ImportCommand.java b/src/main/java/org/jabref/gui/importer/ImportCommand.java index f820e54d308..7f1ad3c16a6 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCommand.java +++ b/src/main/java/org/jabref/gui/importer/ImportCommand.java @@ -1,26 +1,12 @@ package org.jabref.gui.importer; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.SortedSet; - import javafx.stage.FileChooser; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.LibraryTab; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; -import org.jabref.gui.util.BackgroundTask; -import org.jabref.gui.util.DefaultTaskExecutor; -import org.jabref.gui.util.FileDialogConfiguration; -import org.jabref.gui.util.FileFilterConverter; -import org.jabref.gui.util.TaskExecutor; +import org.jabref.gui.util.*; import org.jabref.logic.database.DatabaseMerger; import org.jabref.logic.importer.ImportException; import org.jabref.logic.importer.ImportFormatReader; @@ -34,10 +20,14 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; /** diff --git a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml index 64eb567b4c0..a29211751df 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml +++ b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml @@ -1,8 +1,6 @@ - - - + { diff --git a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialogViewModel.java b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialogViewModel.java index 2215edda8c8..ab3a8b4169b 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialogViewModel.java @@ -1,20 +1,18 @@ package org.jabref.gui.importer; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.Globals; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Optional; + public class ImportCustomEntryTypesDialogViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ImportCustomEntryTypesDialogViewModel.class); diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.fxml b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.fxml index fc7f6b625b4..61b87d34195 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.fxml +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.fxml @@ -1,16 +1,7 @@ - - - - - - - - - - - + + { diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java index 284b92751cd..730cecedf1f 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesViewModel.java @@ -1,17 +1,11 @@ package org.jabref.gui.importer; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; @@ -30,10 +24,13 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.Optional; + public class ImportEntriesViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ImportEntriesViewModel.class); diff --git a/src/main/java/org/jabref/gui/importer/ImporterViewModel.java b/src/main/java/org/jabref/gui/importer/ImporterViewModel.java index 9ec890a57a1..c1d9fa57d3e 100644 --- a/src/main/java/org/jabref/gui/importer/ImporterViewModel.java +++ b/src/main/java/org/jabref/gui/importer/ImporterViewModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.logic.importer.fileformat.CustomImporter; public class ImporterViewModel { diff --git a/src/main/java/org/jabref/gui/importer/NewEntryAction.java b/src/main/java/org/jabref/gui/importer/NewEntryAction.java index 713fb8a258d..cad95c8bbd4 100644 --- a/src/main/java/org/jabref/gui/importer/NewEntryAction.java +++ b/src/main/java/org/jabref/gui/importer/NewEntryAction.java @@ -1,22 +1,17 @@ package org.jabref.gui.importer; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import org.jabref.gui.DialogService; -import org.jabref.gui.EntryTypeView; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.StateManager; -import org.jabref.gui.Telemetry; +import org.jabref.gui.*; import org.jabref.gui.actions.SimpleCommand; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class NewEntryAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java b/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java index a718765da81..b4e5e610af8 100644 --- a/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java +++ b/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java @@ -1,12 +1,12 @@ package org.jabref.gui.importer; -import java.util.List; -import java.util.Objects; - import org.jabref.gui.JabRefFrame; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; +import java.util.List; +import java.util.Objects; + /** * Class for generating a dialog showing warnings from ParserResult */ diff --git a/src/main/java/org/jabref/gui/importer/actions/CheckForNewEntryTypesAction.java b/src/main/java/org/jabref/gui/importer/actions/CheckForNewEntryTypesAction.java index f6380c7a47c..39fcf4769da 100644 --- a/src/main/java/org/jabref/gui/importer/actions/CheckForNewEntryTypesAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/CheckForNewEntryTypesAction.java @@ -1,8 +1,6 @@ package org.jabref.gui.importer.actions; -import java.util.List; -import java.util.stream.Collectors; - +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.LibraryTab; @@ -11,7 +9,8 @@ import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntryType; -import com.airhacks.afterburner.injection.Injector; +import java.util.List; +import java.util.stream.Collectors; /** * This action checks whether any new custom entry types were loaded from this diff --git a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java index 995c8caad7d..0d07e15ee90 100644 --- a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java @@ -1,12 +1,12 @@ package org.jabref.gui.importer.actions; -import java.util.List; - import org.jabref.gui.LibraryTab; import org.jabref.logic.importer.ParserResult; import org.jabref.migrations.MergeReviewIntoCommentMigration; import org.jabref.model.entry.BibEntry; +import java.util.List; + public class MergeReviewIntoCommentAction implements GUIPostOpenAction { @Override diff --git a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java index bc7792bfba3..86cb7074f67 100644 --- a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java +++ b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java @@ -1,13 +1,13 @@ package org.jabref.gui.importer.actions; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.gui.DialogService; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class MergeReviewIntoCommentConfirmationDialog { private final DialogService dialogService; 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 384764fbbf9..6680b2436a8 100644 --- a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java @@ -1,23 +1,6 @@ package org.jabref.gui.importer.actions; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - -import org.jabref.gui.DialogService; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.StateManager; -import org.jabref.gui.Telemetry; +import org.jabref.gui.*; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.autosaveandbackup.BackupManager; import org.jabref.gui.dialogs.BackupUIManager; @@ -38,10 +21,16 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.sql.SQLException; +import java.util.*; + // The action concerned with opening an existing database. public class OpenDatabaseAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/importer/fetcher/LookupIdentifierAction.java b/src/main/java/org/jabref/gui/importer/fetcher/LookupIdentifierAction.java index 46065ff1137..5ddabf9fefe 100644 --- a/src/main/java/org/jabref/gui/importer/fetcher/LookupIdentifierAction.java +++ b/src/main/java/org/jabref/gui/importer/fetcher/LookupIdentifierAction.java @@ -1,10 +1,5 @@ package org.jabref.gui.importer.fetcher; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; import org.jabref.gui.actions.Action; @@ -21,10 +16,13 @@ import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.identifier.Identifier; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.Optional; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; diff --git a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java index 3b32271d7f0..732e6a694df 100644 --- a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java +++ b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java @@ -1,5 +1,6 @@ package org.jabref.gui.importer.fetcher; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.binding.BooleanExpression; import javafx.css.PseudoClass; import javafx.scene.control.Button; @@ -11,7 +12,6 @@ import javafx.scene.layout.Priority; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; @@ -24,8 +24,6 @@ import org.jabref.logic.l10n.Localization; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; - public class WebSearchPaneView extends VBox { private static final PseudoClass QUERY_INVALID = PseudoClass.getPseudoClass("invalid"); diff --git a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java index c66264a2d68..b90d98628e6 100644 --- a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java +++ b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java @@ -1,17 +1,17 @@ package org.jabref.gui.importer.fetcher; -import java.util.Map; -import java.util.concurrent.Callable; - -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import com.tobiasdiez.easybind.EasyBind; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - +import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; +import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; +import org.apache.lucene.queryparser.flexible.standard.parser.ParseException; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.Telemetry; @@ -27,15 +27,8 @@ import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SidePanePreferences; -import com.tobiasdiez.easybind.EasyBind; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; -import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; -import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; -import org.apache.lucene.queryparser.flexible.standard.parser.ParseException; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Map; +import java.util.concurrent.Callable; import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; diff --git a/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java b/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java index 2d59d3220a2..c22b6d56522 100644 --- a/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java +++ b/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java @@ -1,11 +1,7 @@ package org.jabref.gui.integrity; -import java.util.ArrayList; -import java.util.List; - import javafx.collections.ObservableList; import javafx.concurrent.Task; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -19,6 +15,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; +import java.util.ArrayList; +import java.util.List; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class IntegrityCheckAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.fxml b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.fxml index 5854ccb4bd4..fb1b55a13fb 100644 --- a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.fxml +++ b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.fxml @@ -1,11 +1,6 @@ - - - - - - + { diff --git a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialogViewModel.java b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialogViewModel.java index 1313417642e..a24d1675495 100644 --- a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialogViewModel.java +++ b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialogViewModel.java @@ -1,13 +1,12 @@ package org.jabref.gui.integrity; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.logic.integrity.IntegrityMessage; +import java.util.List; + public class IntegrityCheckDialogViewModel extends AbstractViewModel { private final ObservableList messages; diff --git a/src/main/java/org/jabref/gui/journals/AbbreviateAction.java b/src/main/java/org/jabref/gui/journals/AbbreviateAction.java index ca561603ad0..92b0f0dab28 100644 --- a/src/main/java/org/jabref/gui/journals/AbbreviateAction.java +++ b/src/main/java/org/jabref/gui/journals/AbbreviateAction.java @@ -1,17 +1,6 @@ package org.jabref.gui.journals; -import java.util.List; -import java.util.Set; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.stream.Collectors; - -import org.jabref.gui.DialogService; -import org.jabref.gui.Globals; -import org.jabref.gui.JabRefExecutorService; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.actions.ActionHelper; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; @@ -24,10 +13,16 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.FieldFactory; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.stream.Collectors; + /** * Converts journal full names to either iso or medline abbreviations for all selected entries. */ diff --git a/src/main/java/org/jabref/gui/journals/UndoableAbbreviator.java b/src/main/java/org/jabref/gui/journals/UndoableAbbreviator.java index cac2a0a0009..09eac13f3bc 100644 --- a/src/main/java/org/jabref/gui/journals/UndoableAbbreviator.java +++ b/src/main/java/org/jabref/gui/journals/UndoableAbbreviator.java @@ -1,7 +1,5 @@ package org.jabref.gui.journals; -import javax.swing.undo.CompoundEdit; - import org.jabref.gui.undo.UndoableFieldChange; import org.jabref.logic.journals.Abbreviation; import org.jabref.logic.journals.JournalAbbreviationRepository; @@ -11,6 +9,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import javax.swing.undo.CompoundEdit; + public class UndoableAbbreviator { private final JournalAbbreviationRepository journalAbbreviationRepository; diff --git a/src/main/java/org/jabref/gui/journals/UndoableUnabbreviator.java b/src/main/java/org/jabref/gui/journals/UndoableUnabbreviator.java index 42df5bb1ba8..a7c4afd92a3 100644 --- a/src/main/java/org/jabref/gui/journals/UndoableUnabbreviator.java +++ b/src/main/java/org/jabref/gui/journals/UndoableUnabbreviator.java @@ -1,7 +1,5 @@ package org.jabref.gui.journals; -import javax.swing.undo.CompoundEdit; - import org.jabref.gui.undo.UndoableFieldChange; import org.jabref.logic.journals.Abbreviation; import org.jabref.logic.journals.JournalAbbreviationRepository; @@ -11,6 +9,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import javax.swing.undo.CompoundEdit; + public class UndoableUnabbreviator { private final JournalAbbreviationRepository journalAbbreviationRepository; diff --git a/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java b/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java index 5158d42b2d9..aaf89a66a06 100644 --- a/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java +++ b/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java @@ -1,12 +1,10 @@ package org.jabref.gui.keyboard; import javafx.scene.input.KeyEvent; - -import org.jabref.logic.util.strings.StringManipulator; -import org.jabref.model.util.ResultingStringState; - import org.fxmisc.richtext.CodeArea; import org.fxmisc.richtext.NavigationActions; +import org.jabref.logic.util.strings.StringManipulator; +import org.jabref.model.util.ResultingStringState; public class CodeAreaKeyBindings { diff --git a/src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java b/src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java index 36aece7bc14..52496af1bc3 100644 --- a/src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java +++ b/src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java @@ -1,21 +1,13 @@ package org.jabref.gui.keyboard; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.stream.Collectors; - import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; - import org.jabref.logic.util.OS; +import java.util.*; +import java.util.stream.Collectors; + public class KeyBindingRepository { /** diff --git a/src/main/java/org/jabref/gui/keyboard/TextInputKeyBindings.java b/src/main/java/org/jabref/gui/keyboard/TextInputKeyBindings.java index 632f53a1603..63fd24e6894 100644 --- a/src/main/java/org/jabref/gui/keyboard/TextInputKeyBindings.java +++ b/src/main/java/org/jabref/gui/keyboard/TextInputKeyBindings.java @@ -3,7 +3,6 @@ import javafx.scene.Scene; import javafx.scene.control.TextInputControl; import javafx.scene.input.KeyEvent; - import org.jabref.gui.Globals; import org.jabref.logic.util.strings.StringManipulator; import org.jabref.model.util.ResultingStringState; diff --git a/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java b/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java index b200449491d..01897906da9 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java @@ -1,13 +1,11 @@ package org.jabref.gui.libraryproperties; +import jakarta.inject.Inject; import javafx.scene.Node; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.model.database.BibDatabaseContext; -import jakarta.inject.Inject; - public abstract class AbstractPropertiesTabView extends VBox implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesAction.java b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesAction.java index 4e7282275ad..7d5ebbc0637 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesAction.java +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesAction.java @@ -1,16 +1,15 @@ package org.jabref.gui.libraryproperties; -import java.util.function.Supplier; - +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; import org.jabref.model.database.BibDatabaseContext; - -import com.airhacks.afterburner.injection.Injector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.function.Supplier; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class LibraryPropertiesAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java index fd6e951b1e4..ae3e0cd6362 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java @@ -1,20 +1,18 @@ package org.jabref.gui.libraryproperties; +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.ButtonType; import javafx.scene.control.ScrollPane; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; - import org.jabref.gui.theme.ThemeManager; import org.jabref.gui.util.BaseDialog; import org.jabref.gui.util.ControlHelper; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; - public class LibraryPropertiesView extends BaseDialog { @FXML diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesViewModel.java index 9468084ea94..06eab7fb1f6 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesViewModel.java @@ -1,7 +1,5 @@ package org.jabref.gui.libraryproperties; -import java.util.List; - import org.jabref.gui.libraryproperties.constants.ConstantsPropertiesView; import org.jabref.gui.libraryproperties.contentselectors.ContentSelectorView; import org.jabref.gui.libraryproperties.general.GeneralPropertiesView; @@ -10,6 +8,8 @@ import org.jabref.gui.libraryproperties.saving.SavingPropertiesView; import org.jabref.model.database.BibDatabaseContext; +import java.util.List; + public class LibraryPropertiesViewModel { private final List propertiesTabs; diff --git a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java index 4a5abe298d6..e0c9ba5b1ec 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsItemModel.java @@ -1,18 +1,12 @@ package org.jabref.gui.libraryproperties.constants; -import java.util.regex.Pattern; - +import de.saxsys.mvvmfx.utils.validation.*; import javafx.beans.property.ReadOnlyBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.logic.l10n.Localization; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.util.regex.Pattern; public class ConstantsItemModel { diff --git a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsProperties.fxml b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsProperties.fxml index d352c412c03..4be5f236c07 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsProperties.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsProperties.fxml @@ -1,12 +1,7 @@ - - - - - - - + + implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModel.java index 0dec843e04b..23bb2629cac 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModel.java @@ -1,10 +1,6 @@ package org.jabref.gui.libraryproperties.constants; -import java.util.Comparator; -import java.util.Locale; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleBooleanProperty; @@ -12,7 +8,6 @@ import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.DialogService; import org.jabref.gui.help.HelpAction; import org.jabref.gui.libraryproperties.PropertiesTabViewModel; @@ -22,7 +17,10 @@ import org.jabref.model.entry.BibtexString; import org.jabref.preferences.FilePreferences; -import com.tobiasdiez.easybind.EasyBind; +import java.util.Comparator; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; public class ConstantsPropertiesViewModel implements PropertiesTabViewModel { diff --git a/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelector.fxml b/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelector.fxml index a6d4202e8c9..82f57c574b2 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelector.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelector.fxml @@ -1,10 +1,7 @@ - - - - - + + { diff --git a/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModel.java index cd2cffd4279..ae9ffda0f43 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModel.java @@ -1,26 +1,9 @@ package org.jabref.gui.libraryproperties.contentselectors; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.libraryproperties.PropertiesTabViewModel; import org.jabref.logic.l10n.Localization; @@ -31,6 +14,9 @@ import org.jabref.model.metadata.ContentSelector; import org.jabref.model.metadata.MetaData; +import java.util.*; +import java.util.stream.Collectors; + public class ContentSelectorViewModel implements PropertiesTabViewModel { private static final List DEFAULT_FIELD_NAMES = diff --git a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralProperties.fxml b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralProperties.fxml index 4e070ef854a..1f5aedaf66d 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralProperties.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralProperties.fxml @@ -1,14 +1,7 @@ - - - - - - - - - + + { @FXML diff --git a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java index 1b52b701ee7..34ef64f9d50 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java @@ -1,19 +1,7 @@ package org.jabref.gui.libraryproperties.general; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.libraryproperties.PropertiesTabViewModel; import org.jabref.gui.util.DirectoryDialogConfiguration; @@ -24,6 +12,10 @@ import org.jabref.model.metadata.MetaData; import org.jabref.preferences.PreferencesService; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + public class GeneralPropertiesViewModel implements PropertiesTabViewModel { private final BooleanProperty encodingDisableProperty = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternProperties.fxml b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternProperties.fxml index 6124ce594a1..9c98f532df6 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternProperties.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternProperties.fxml @@ -2,10 +2,7 @@ - - - - + implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java index 327f77496ea..df58177120e 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesViewModel.java @@ -5,7 +5,6 @@ import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; - import org.jabref.gui.commonfxcontrols.CitationKeyPatternPanelItemModel; import org.jabref.gui.commonfxcontrols.CitationKeyPatternPanelViewModel; import org.jabref.gui.libraryproperties.PropertiesTabViewModel; diff --git a/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesView.java index f66853a805d..a0d89ea4772 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesView.java @@ -1,16 +1,14 @@ package org.jabref.gui.libraryproperties.preamble; -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.TextArea; - import org.jabref.gui.libraryproperties.AbstractPropertiesTabView; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; public class PreamblePropertiesView extends AbstractPropertiesTabView { @FXML diff --git a/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesViewModel.java index 371e187302e..597d3aac804 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/preamble/PreamblePropertiesViewModel.java @@ -1,14 +1,13 @@ package org.jabref.gui.libraryproperties.preamble; -import javax.swing.undo.UndoManager; - import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.libraryproperties.PropertiesTabViewModel; import org.jabref.gui.undo.UndoablePreambleChange; import org.jabref.model.database.BibDatabaseContext; +import javax.swing.undo.UndoManager; + public class PreamblePropertiesViewModel implements PropertiesTabViewModel { private final StringProperty preambleProperty = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java index eb5a4a7898a..7df240c1c4b 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java @@ -1,8 +1,9 @@ package org.jabref.gui.libraryproperties.saving; +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; - import org.jabref.gui.commonfxcontrols.FieldFormatterCleanupsPanel; import org.jabref.gui.commonfxcontrols.SaveOrderConfigPanel; import org.jabref.gui.libraryproperties.AbstractPropertiesTabView; @@ -11,9 +12,6 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; - public class SavingPropertiesView extends AbstractPropertiesTabView implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java index 13af305788d..e778868878f 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesViewModel.java @@ -1,16 +1,10 @@ package org.jabref.gui.libraryproperties.saving; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.commonfxcontrols.SortCriterionViewModel; import org.jabref.gui.libraryproperties.PropertiesTabViewModel; import org.jabref.logic.cleanup.FieldFormatterCleanup; @@ -25,6 +19,11 @@ import org.jabref.preferences.CleanupPreferences; import org.jabref.preferences.PreferencesService; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Set; + public class SavingPropertiesViewModel implements PropertiesTabViewModel { private static final SaveOrder UI_DEFAULT_SAVE_ORDER = new SaveOrder( diff --git a/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java b/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java index abab8072266..04c5c1fb16f 100644 --- a/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java +++ b/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.linkedfile; -import java.nio.file.Path; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.StateManager; @@ -18,6 +15,9 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; +import java.nio.file.Path; +import java.util.Optional; + public class AttachFileAction extends SimpleCommand { private final LibraryTab libraryTab; diff --git a/src/main/java/org/jabref/gui/linkedfile/AttachFileFromURLAction.java b/src/main/java/org/jabref/gui/linkedfile/AttachFileFromURLAction.java index a38fb622cf7..08cdb85d0bd 100644 --- a/src/main/java/org/jabref/gui/linkedfile/AttachFileFromURLAction.java +++ b/src/main/java/org/jabref/gui/linkedfile/AttachFileFromURLAction.java @@ -1,9 +1,5 @@ package org.jabref.gui.linkedfile; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Optional; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; @@ -18,6 +14,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Optional; + public class AttachFileFromURLAction extends SimpleCommand { private final StateManager stateManager; diff --git a/src/main/java/org/jabref/gui/linkedfile/DeleteFileAction.java b/src/main/java/org/jabref/gui/linkedfile/DeleteFileAction.java index 83f037067bf..acff48de502 100644 --- a/src/main/java/org/jabref/gui/linkedfile/DeleteFileAction.java +++ b/src/main/java/org/jabref/gui/linkedfile/DeleteFileAction.java @@ -1,16 +1,9 @@ package org.jabref.gui.linkedfile; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import javafx.scene.control.Alert; import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; import javafx.scene.control.ListView; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.fieldeditors.LinkedFileViewModel; @@ -19,10 +12,15 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + public class DeleteFileAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(DeleteFileAction.class); diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialog.fxml b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialog.fxml index 923412bf15b..2c913225728 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialog.fxml +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialog.fxml @@ -1,14 +1,7 @@ - - - - - - - - - + + { @FXML diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java index a95342a9ae1..965931c1c60 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java @@ -1,20 +1,9 @@ package org.jabref.gui.linkedfile; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.regex.Pattern; - -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.optional.ObservableOptionalValue; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; @@ -26,8 +15,12 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.optional.ObservableOptionalValue; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.regex.Pattern; public class LinkedFilesEditDialogViewModel extends AbstractViewModel { diff --git a/src/main/java/org/jabref/gui/logging/GuiWriter.java b/src/main/java/org/jabref/gui/logging/GuiWriter.java index 67295bd4fbd..3af81425699 100644 --- a/src/main/java/org/jabref/gui/logging/GuiWriter.java +++ b/src/main/java/org/jabref/gui/logging/GuiWriter.java @@ -1,16 +1,15 @@ package org.jabref.gui.logging; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.Map; - import org.jabref.logic.logging.LogMessages; - import org.tinylog.core.LogEntry; import org.tinylog.core.LogEntryValue; import org.tinylog.writers.AbstractFormatPatternWriter; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.Map; + public class GuiWriter extends AbstractFormatPatternWriter { public GuiWriter(final Map properties) { diff --git a/src/main/java/org/jabref/gui/maintable/BibEntryTableViewModel.java b/src/main/java/org/jabref/gui/maintable/BibEntryTableViewModel.java index 5befa6f6ec3..bf67229b4b1 100644 --- a/src/main/java/org/jabref/gui/maintable/BibEntryTableViewModel.java +++ b/src/main/java/org/jabref/gui/maintable/BibEntryTableViewModel.java @@ -1,22 +1,14 @@ package org.jabref.gui.maintable; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Collectors; - +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.EasyBinding; +import com.tobiasdiez.easybind.optional.OptionalBinding; import javafx.beans.Observable; import javafx.beans.binding.Binding; import javafx.beans.binding.Bindings; import javafx.beans.property.ReadOnlyStringWrapper; import javafx.beans.property.StringProperty; import javafx.beans.value.ObservableValue; - import org.jabref.gui.specialfields.SpecialFieldValueViewModel; import org.jabref.gui.util.uithreadaware.UiThreadBinding; import org.jabref.logic.importer.util.FileFieldParser; @@ -30,9 +22,10 @@ import org.jabref.model.groups.AbstractGroup; import org.jabref.model.groups.GroupTreeNode; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.EasyBinding; -import com.tobiasdiez.easybind.optional.OptionalBinding; +import java.nio.file.Path; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; public class BibEntryTableViewModel { diff --git a/src/main/java/org/jabref/gui/maintable/CellFactory.java b/src/main/java/org/jabref/gui/maintable/CellFactory.java index 9e64181a967..8ea24c67392 100644 --- a/src/main/java/org/jabref/gui/maintable/CellFactory.java +++ b/src/main/java/org/jabref/gui/maintable/CellFactory.java @@ -1,12 +1,6 @@ package org.jabref.gui.maintable; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.undo.UndoManager; - import javafx.scene.Node; - import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; @@ -17,6 +11,10 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.HashMap; +import java.util.Map; + public class CellFactory { private final Map TABLE_ICONS = new HashMap<>(); diff --git a/src/main/java/org/jabref/gui/maintable/ColumnPreferences.java b/src/main/java/org/jabref/gui/maintable/ColumnPreferences.java index 24dd502ce26..eed230e1aff 100644 --- a/src/main/java/org/jabref/gui/maintable/ColumnPreferences.java +++ b/src/main/java/org/jabref/gui/maintable/ColumnPreferences.java @@ -1,10 +1,10 @@ package org.jabref.gui.maintable; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class ColumnPreferences { public static final double DEFAULT_COLUMN_WIDTH = 100; diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index 6f5dfadbad4..7156e143d2e 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -1,35 +1,13 @@ package org.jabref.gui.maintable; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.swing.undo.UndoManager; - +import com.google.common.eventbus.Subscribe; import javafx.collections.ListChangeListener; import javafx.scene.control.SelectionMode; import javafx.scene.control.TableColumn; import javafx.scene.control.TableRow; import javafx.scene.control.TableView; -import javafx.scene.input.ClipboardContent; -import javafx.scene.input.DragEvent; -import javafx.scene.input.Dragboard; -import javafx.scene.input.KeyCode; -import javafx.scene.input.KeyEvent; -import javafx.scene.input.MouseDragEvent; -import javafx.scene.input.MouseEvent; -import javafx.scene.input.TransferMode; - -import org.jabref.gui.ClipBoardManager; -import org.jabref.gui.DialogService; -import org.jabref.gui.DragAndDropDataFormats; -import org.jabref.gui.Globals; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.StateManager; +import javafx.scene.input.*; +import org.jabref.gui.*; import org.jabref.gui.actions.StandardActions; import org.jabref.gui.edit.EditAction; import org.jabref.gui.externalfiles.ImportHandler; @@ -37,11 +15,7 @@ import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.maintable.columns.LibraryColumn; import org.jabref.gui.maintable.columns.MainTableColumn; -import org.jabref.gui.util.ControlHelper; -import org.jabref.gui.util.CustomLocalDragboard; -import org.jabref.gui.util.DefaultTaskExecutor; -import org.jabref.gui.util.TaskExecutor; -import org.jabref.gui.util.ViewModelTableRowFactory; +import org.jabref.gui.util.*; import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.FetcherServerException; @@ -52,11 +26,18 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + public class MainTable extends TableView { private static final Logger LOGGER = LoggerFactory.getLogger(MainTable.class); diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java index e73189a9357..c5fc89ca09c 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java @@ -1,14 +1,5 @@ package org.jabref.gui.maintable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.swing.undo.UndoManager; - import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.geometry.Insets; import javafx.geometry.Pos; @@ -20,16 +11,10 @@ import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.scene.text.Text; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.icon.IconTheme; -import org.jabref.gui.maintable.columns.FieldColumn; -import org.jabref.gui.maintable.columns.FileColumn; -import org.jabref.gui.maintable.columns.LibraryColumn; -import org.jabref.gui.maintable.columns.LinkedIdentifierColumn; -import org.jabref.gui.maintable.columns.MainTableColumn; -import org.jabref.gui.maintable.columns.SpecialFieldColumn; +import org.jabref.gui.maintable.columns.*; import org.jabref.gui.specialfields.SpecialFieldValueViewModel; import org.jabref.gui.util.TaskExecutor; import org.jabref.gui.util.ValueTableCellFactory; @@ -41,10 +26,13 @@ import org.jabref.model.entry.field.SpecialField; import org.jabref.model.groups.AbstractGroup; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.*; +import java.util.stream.Collectors; + public class MainTableColumnFactory { public static final String STYLE_ICON_COLUMN = "column-icon"; diff --git a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java index 55b1c4f4b89..915230c1076 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableColumnModel.java @@ -1,26 +1,18 @@ package org.jabref.gui.maintable; -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; - -import javafx.beans.property.DoubleProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyStringWrapper; -import javafx.beans.property.SimpleDoubleProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.scene.control.TableColumn; - import org.jabref.gui.util.FieldsUtil; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.metadata.SaveOrder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.EnumSet; +import java.util.List; +import java.util.Objects; + /** * Represents the full internal name of a column in the main table. Consists of two parts: The type of the column and a qualifier, like the * field name to be displayed in the column. diff --git a/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java b/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java index d546055f2c0..f75d9f9cb14 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java @@ -1,8 +1,6 @@ package org.jabref.gui.maintable; -import java.util.List; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.binding.Bindings; import javafx.beans.property.IntegerProperty; import javafx.beans.property.ObjectProperty; @@ -11,7 +9,6 @@ import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; - import org.jabref.gui.StateManager; import org.jabref.gui.groups.GroupViewMode; import org.jabref.gui.groups.GroupsPreferences; @@ -24,7 +21,8 @@ import org.jabref.model.search.matchers.MatcherSets; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import java.util.List; +import java.util.Optional; public class MainTableDataModel { private final FilteredList entriesFiltered; diff --git a/src/main/java/org/jabref/gui/maintable/MainTableFieldValueFormatter.java b/src/main/java/org/jabref/gui/maintable/MainTableFieldValueFormatter.java index 4508d0e8cb5..e941390a432 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableFieldValueFormatter.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableFieldValueFormatter.java @@ -1,7 +1,5 @@ package org.jabref.gui.maintable; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.AuthorList; @@ -10,6 +8,8 @@ import org.jabref.model.entry.field.FieldProperty; import org.jabref.model.entry.field.OrFields; +import java.util.Optional; + import static org.jabref.gui.maintable.NameDisplayPreferences.AbbreviationStyle; import static org.jabref.gui.maintable.NameDisplayPreferences.DisplayStyle; diff --git a/src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java b/src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java index 3d8c4ddc764..7b6fd159cd6 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java @@ -1,17 +1,16 @@ package org.jabref.gui.maintable; -import java.util.ArrayList; -import java.util.List; - import javafx.collections.ObservableList; import javafx.scene.control.ContextMenu; import javafx.scene.control.RadioMenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.control.TableColumn; import javafx.scene.layout.StackPane; - import org.jabref.gui.maintable.columns.MainTableColumn; +import java.util.ArrayList; +import java.util.List; + public class MainTableHeaderContextMenu extends ContextMenu { private static final int OUT_OF_BOUNDS = -1; diff --git a/src/main/java/org/jabref/gui/maintable/OpenExternalFileAction.java b/src/main/java/org/jabref/gui/maintable/OpenExternalFileAction.java index 0a24483c2b4..e85206250d3 100644 --- a/src/main/java/org/jabref/gui/maintable/OpenExternalFileAction.java +++ b/src/main/java/org/jabref/gui/maintable/OpenExternalFileAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.maintable; -import java.util.LinkedList; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -14,6 +11,9 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.PreferencesService; +import java.util.LinkedList; +import java.util.List; + public class OpenExternalFileAction extends SimpleCommand { private final int FILES_LIMIT = 10; diff --git a/src/main/java/org/jabref/gui/maintable/OpenUrlAction.java b/src/main/java/org/jabref/gui/maintable/OpenUrlAction.java index bd8427d4ebe..253d0d1f262 100644 --- a/src/main/java/org/jabref/gui/maintable/OpenUrlAction.java +++ b/src/main/java/org/jabref/gui/maintable/OpenUrlAction.java @@ -1,11 +1,6 @@ package org.jabref.gui.maintable; -import java.io.IOException; -import java.util.List; -import java.util.Optional; - import javafx.beans.binding.BooleanExpression; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -17,6 +12,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import java.io.IOException; +import java.util.List; +import java.util.Optional; + public class OpenUrlAction extends SimpleCommand { private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/maintable/PersistenceVisualStateTable.java b/src/main/java/org/jabref/gui/maintable/PersistenceVisualStateTable.java index 78c85a5f449..28611234901 100644 --- a/src/main/java/org/jabref/gui/maintable/PersistenceVisualStateTable.java +++ b/src/main/java/org/jabref/gui/maintable/PersistenceVisualStateTable.java @@ -1,18 +1,16 @@ package org.jabref.gui.maintable; -import java.util.List; -import java.util.stream.Collectors; - import javafx.beans.InvalidationListener; import javafx.collections.ListChangeListener; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; - import org.jabref.gui.maintable.columns.MainTableColumn; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.stream.Collectors; + /** * Keep track of changes made to the columns (reordering, resorting, resizing). */ diff --git a/src/main/java/org/jabref/gui/maintable/RightClickMenu.java b/src/main/java/org/jabref/gui/maintable/RightClickMenu.java index 29d259217e8..e823be37c27 100644 --- a/src/main/java/org/jabref/gui/maintable/RightClickMenu.java +++ b/src/main/java/org/jabref/gui/maintable/RightClickMenu.java @@ -1,17 +1,9 @@ package org.jabref.gui.maintable; -import javax.swing.undo.UndoManager; - import javafx.scene.control.ContextMenu; import javafx.scene.control.Menu; import javafx.scene.control.SeparatorMenuItem; - -import org.jabref.gui.ClipBoardManager; -import org.jabref.gui.DialogService; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.SendAsKindleEmailAction; -import org.jabref.gui.SendAsStandardEmailAction; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.StandardActions; import org.jabref.gui.edit.CopyMoreAction; @@ -34,6 +26,8 @@ import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PreviewPreferences; +import javax.swing.undo.UndoManager; + public class RightClickMenu { public static ContextMenu create( diff --git a/src/main/java/org/jabref/gui/maintable/SearchShortScienceAction.java b/src/main/java/org/jabref/gui/maintable/SearchShortScienceAction.java index 790e1705d9a..afa606fd1f2 100644 --- a/src/main/java/org/jabref/gui/maintable/SearchShortScienceAction.java +++ b/src/main/java/org/jabref/gui/maintable/SearchShortScienceAction.java @@ -1,10 +1,6 @@ package org.jabref.gui.maintable; -import java.io.IOException; -import java.util.List; - import javafx.beans.binding.BooleanExpression; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; @@ -15,6 +11,9 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import java.io.IOException; +import java.util.List; + import static org.jabref.gui.actions.ActionHelper.isFieldSetForSelectedEntry; import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; diff --git a/src/main/java/org/jabref/gui/maintable/SmartConstrainedResizePolicy.java b/src/main/java/org/jabref/gui/maintable/SmartConstrainedResizePolicy.java index af9bf7ae221..cf57afe303f 100644 --- a/src/main/java/org/jabref/gui/maintable/SmartConstrainedResizePolicy.java +++ b/src/main/java/org/jabref/gui/maintable/SmartConstrainedResizePolicy.java @@ -1,18 +1,17 @@ package org.jabref.gui.maintable; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; - import javafx.scene.control.ResizeFeaturesBase; import javafx.scene.control.TableColumnBase; import javafx.scene.control.TableView; import javafx.util.Callback; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; + /** * This resize policy is almost the same as {@link TableView#CONSTRAINED_RESIZE_POLICY} * We make sure that the width of all columns sums up to the total width of the table. diff --git a/src/main/java/org/jabref/gui/maintable/columns/FieldColumn.java b/src/main/java/org/jabref/gui/maintable/columns/FieldColumn.java index 698e8e16895..647833665fe 100644 --- a/src/main/java/org/jabref/gui/maintable/columns/FieldColumn.java +++ b/src/main/java/org/jabref/gui/maintable/columns/FieldColumn.java @@ -1,7 +1,7 @@ package org.jabref.gui.maintable.columns; +import com.google.common.collect.MoreCollectors; import javafx.beans.value.ObservableValue; - import org.jabref.gui.maintable.BibEntryTableViewModel; import org.jabref.gui.maintable.MainTableColumnModel; import org.jabref.gui.util.ValueTableCellFactory; @@ -11,8 +11,6 @@ import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.UnknownField; -import com.google.common.collect.MoreCollectors; - /** * A column that displays the text-value of the field */ diff --git a/src/main/java/org/jabref/gui/maintable/columns/FileColumn.java b/src/main/java/org/jabref/gui/maintable/columns/FileColumn.java index 7bfbc1e3305..4456af339e6 100644 --- a/src/main/java/org/jabref/gui/maintable/columns/FileColumn.java +++ b/src/main/java/org/jabref/gui/maintable/columns/FileColumn.java @@ -1,15 +1,10 @@ package org.jabref.gui.maintable.columns; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import javafx.scene.Node; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.control.Tooltip; import javafx.scene.input.MouseButton; - import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; @@ -26,6 +21,10 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.PreferencesService; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * A column that draws a clickable symbol for either all the files of a defined file type * or a joined column with all the files of any type diff --git a/src/main/java/org/jabref/gui/maintable/columns/LinkedIdentifierColumn.java b/src/main/java/org/jabref/gui/maintable/columns/LinkedIdentifierColumn.java index 00d256f2e7b..5d3273b737c 100644 --- a/src/main/java/org/jabref/gui/maintable/columns/LinkedIdentifierColumn.java +++ b/src/main/java/org/jabref/gui/maintable/columns/LinkedIdentifierColumn.java @@ -1,24 +1,15 @@ package org.jabref.gui.maintable.columns; -import java.io.IOException; -import java.util.Map; - import javafx.scene.Node; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.control.Tooltip; import javafx.scene.input.MouseButton; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.icon.IconTheme; -import org.jabref.gui.maintable.BibEntryTableViewModel; -import org.jabref.gui.maintable.CellFactory; -import org.jabref.gui.maintable.ColumnPreferences; -import org.jabref.gui.maintable.MainTableColumnFactory; -import org.jabref.gui.maintable.MainTableColumnModel; -import org.jabref.gui.maintable.OpenUrlAction; +import org.jabref.gui.maintable.*; import org.jabref.gui.util.ControlHelper; import org.jabref.gui.util.ValueTableCellFactory; import org.jabref.logic.l10n.Localization; @@ -26,6 +17,9 @@ import org.jabref.model.entry.field.Field; import org.jabref.preferences.PreferencesService; +import java.io.IOException; +import java.util.Map; + /** * A clickable icons column for DOIs, URLs, URIs and EPrints. */ diff --git a/src/main/java/org/jabref/gui/maintable/columns/MainTableColumn.java b/src/main/java/org/jabref/gui/maintable/columns/MainTableColumn.java index 034ac62d7b0..94cd8e9e9a5 100644 --- a/src/main/java/org/jabref/gui/maintable/columns/MainTableColumn.java +++ b/src/main/java/org/jabref/gui/maintable/columns/MainTableColumn.java @@ -2,7 +2,6 @@ import javafx.beans.value.ObservableValue; import javafx.scene.control.TableColumn; - import org.jabref.gui.maintable.BibEntryTableViewModel; import org.jabref.gui.maintable.MainTableColumnModel; import org.jabref.gui.util.BindingsHelper; diff --git a/src/main/java/org/jabref/gui/maintable/columns/SpecialFieldColumn.java b/src/main/java/org/jabref/gui/maintable/columns/SpecialFieldColumn.java index e58459a8a21..c668432a88d 100644 --- a/src/main/java/org/jabref/gui/maintable/columns/SpecialFieldColumn.java +++ b/src/main/java/org/jabref/gui/maintable/columns/SpecialFieldColumn.java @@ -1,16 +1,13 @@ package org.jabref.gui.maintable.columns; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.Node; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.control.Tooltip; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; - +import org.controlsfx.control.Rating; import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.maintable.BibEntryTableViewModel; import org.jabref.gui.maintable.ColumnPreferences; @@ -28,8 +25,8 @@ import org.jabref.model.entry.field.SpecialFieldValue; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; -import org.controlsfx.control.Rating; +import javax.swing.undo.UndoManager; +import java.util.Optional; /** * A column that displays a SpecialField diff --git a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeAction.java b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeAction.java index 5da4a22d33b..ef1c010e832 100644 --- a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeAction.java +++ b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeAction.java @@ -1,12 +1,7 @@ package org.jabref.gui.menus; -import java.util.List; - -import javax.swing.undo.UndoManager; - import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.ReadOnlyStringWrapper; - import org.jabref.gui.EntryTypeView; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.undo.NamedCompound; @@ -15,6 +10,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; +import javax.swing.undo.UndoManager; +import java.util.List; + public class ChangeEntryTypeAction extends SimpleCommand { private final EntryType type; diff --git a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java index fb6bca84143..aed9c4b6b88 100644 --- a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java +++ b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java @@ -1,18 +1,11 @@ package org.jabref.gui.menus; -import java.util.Collection; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.control.ContextMenu; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; - import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.logic.l10n.Localization; @@ -24,6 +17,11 @@ import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; +import javax.swing.undo.UndoManager; +import java.util.Collection; +import java.util.List; +import java.util.Optional; + public class ChangeEntryTypeMenu { private final List entries; diff --git a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java index 370b38af587..3d94d8191c9 100644 --- a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java +++ b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java @@ -1,18 +1,17 @@ package org.jabref.gui.menus; -import java.nio.file.Files; -import java.nio.file.Path; - import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.input.KeyEvent; - import org.jabref.gui.DialogService; import org.jabref.gui.importer.actions.OpenDatabaseAction; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.io.FileHistory; +import java.nio.file.Files; +import java.nio.file.Path; + public class FileHistoryMenu extends Menu { protected final MenuItem clearRecentLibraries; diff --git a/src/main/java/org/jabref/gui/mergeentries/DiffHighlighting.java b/src/main/java/org/jabref/gui/mergeentries/DiffHighlighting.java index 24f7b06e437..63ab312560d 100644 --- a/src/main/java/org/jabref/gui/mergeentries/DiffHighlighting.java +++ b/src/main/java/org/jabref/gui/mergeentries/DiffHighlighting.java @@ -1,17 +1,16 @@ package org.jabref.gui.mergeentries; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import javafx.scene.text.Text; - import com.github.difflib.DiffUtils; import com.github.difflib.patch.AbstractDelta; +import javafx.scene.text.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + public class DiffHighlighting { private static final Logger LOGGER = LoggerFactory.getLogger(DiffHighlighting.class); diff --git a/src/main/java/org/jabref/gui/mergeentries/DiffHighlightingEllipsingTextFlow.java b/src/main/java/org/jabref/gui/mergeentries/DiffHighlightingEllipsingTextFlow.java index 358ba4e5b54..74577a5ee84 100644 --- a/src/main/java/org/jabref/gui/mergeentries/DiffHighlightingEllipsingTextFlow.java +++ b/src/main/java/org/jabref/gui/mergeentries/DiffHighlightingEllipsingTextFlow.java @@ -1,7 +1,6 @@ package org.jabref.gui.mergeentries; -import java.util.List; - +import com.tobiasdiez.easybind.EasyObservableValue; import javafx.beans.DefaultProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.StringProperty; @@ -13,7 +12,7 @@ import javafx.scene.text.Text; import javafx.scene.text.TextFlow; -import com.tobiasdiez.easybind.EasyObservableValue; +import java.util.List; @DefaultProperty("children") public class DiffHighlightingEllipsingTextFlow extends TextFlow { diff --git a/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java b/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java index 19b8394fa05..0453687fd31 100644 --- a/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java +++ b/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java @@ -1,28 +1,12 @@ package org.jabref.gui.mergeentries; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableChangeType; import org.jabref.gui.undo.UndoableFieldChange; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.TaskExecutor; -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherClientException; -import org.jabref.logic.importer.FetcherServerException; -import org.jabref.logic.importer.IdBasedFetcher; -import org.jabref.logic.importer.ImportCleanup; -import org.jabref.logic.importer.WebFetcher; -import org.jabref.logic.importer.WebFetchers; +import org.jabref.logic.importer.*; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -31,10 +15,12 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.*; + /** * Class for fetching and merging bibliographic information */ diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java index 3f01e926240..85a967e165b 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.mergeentries; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -13,6 +10,9 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.preferences.PreferencesService; +import java.util.List; +import java.util.Optional; + public class MergeEntriesAction extends SimpleCommand { private static final int NUMBER_OF_ENTRIES_NEEDED = 2; private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesDialog.java b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesDialog.java index 03f665b0827..c45d65728bc 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeEntriesDialog.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeEntriesDialog.java @@ -2,7 +2,6 @@ import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; - import org.jabref.gui.mergeentries.newmergedialog.ShowDiffConfig; import org.jabref.gui.mergeentries.newmergedialog.ThreeWayMergeView; import org.jabref.gui.util.BaseDialog; diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeTwoEntriesAction.java b/src/main/java/org/jabref/gui/mergeentries/MergeTwoEntriesAction.java index 8390023f7c6..b55f18547db 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeTwoEntriesAction.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeTwoEntriesAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.mergeentries; -import java.util.Arrays; -import java.util.List; - import org.jabref.gui.Globals; import org.jabref.gui.StateManager; import org.jabref.gui.actions.SimpleCommand; @@ -13,6 +10,9 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; +import java.util.Arrays; +import java.util.List; + public class MergeTwoEntriesAction extends SimpleCommand { private final EntriesMergeResult entriesMergeResult; private final StateManager stateManager; diff --git a/src/main/java/org/jabref/gui/mergeentries/MergeWithFetchedEntryAction.java b/src/main/java/org/jabref/gui/mergeentries/MergeWithFetchedEntryAction.java index 4411012c4d0..3074d743668 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MergeWithFetchedEntryAction.java +++ b/src/main/java/org/jabref/gui/mergeentries/MergeWithFetchedEntryAction.java @@ -1,7 +1,5 @@ package org.jabref.gui.mergeentries; -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -13,6 +11,8 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class MergeWithFetchedEntryAction extends SimpleCommand { private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntries.fxml b/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntries.fxml index a77e9493673..5b036df34ff 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntries.fxml +++ b/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntries.fxml @@ -1,15 +1,7 @@ - - - - - - - - - - + + { private static final Logger LOGGER = LoggerFactory.getLogger(MultiMergeEntriesView.class); diff --git a/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntriesViewModel.java b/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntriesViewModel.java index 573ae9f9ba6..9a668fc55ef 100644 --- a/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntriesViewModel.java +++ b/src/main/java/org/jabref/gui/mergeentries/MultiMergeEntriesViewModel.java @@ -1,25 +1,17 @@ package org.jabref.gui.mergeentries; -import java.util.Map; -import java.util.function.Supplier; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.scene.control.ButtonType; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.TaskExecutor; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; +import java.util.Map; +import java.util.function.Supplier; + public class MultiMergeEntriesViewModel extends AbstractViewModel { private final ListProperty entries = new SimpleListProperty<>(FXCollections.observableArrayList()); diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowView.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowView.java index c4a05b96b0f..7f5367d158d 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowView.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowView.java @@ -1,11 +1,12 @@ package org.jabref.gui.mergeentries.newmergedialog; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.GridPane; - +import org.fxmisc.richtext.StyleClassedTextArea; import org.jabref.gui.mergeentries.newmergedialog.FieldRowViewModel.Selection; import org.jabref.gui.mergeentries.newmergedialog.cell.FieldNameCell; import org.jabref.gui.mergeentries.newmergedialog.cell.FieldValueCell; @@ -19,9 +20,6 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.fxmisc.richtext.StyleClassedTextArea; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowViewModel.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowViewModel.java index 7e7489fd0cd..9270c387eca 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowViewModel.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/FieldRowViewModel.java @@ -1,19 +1,9 @@ package org.jabref.gui.mergeentries.newmergedialog; -import javax.swing.undo.AbstractUndoableEdit; -import javax.swing.undo.CannotRedoException; -import javax.swing.undo.CannotUndoException; -import javax.swing.undo.CompoundEdit; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - +import javafx.beans.property.*; import org.jabref.gui.mergeentries.newmergedialog.fieldsmerger.FieldMerger; import org.jabref.gui.mergeentries.newmergedialog.fieldsmerger.FieldMergerFactory; import org.jabref.model.entry.BibEntry; @@ -21,11 +11,14 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.strings.StringUtil; - -import com.tobiasdiez.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.AbstractUndoableEdit; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.CompoundEdit; + public class FieldRowViewModel { public enum Selection { LEFT, diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeHeaderView.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeHeaderView.java index 6bda5311631..8b3a7ea84e9 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeHeaderView.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeHeaderView.java @@ -3,7 +3,6 @@ import javafx.geometry.Insets; import javafx.scene.control.Control; import javafx.scene.layout.GridPane; - import org.jabref.gui.mergeentries.newmergedialog.cell.HeaderCell; import org.jabref.logic.l10n.Localization; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeView.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeView.java index e2e539b4084..906bbae7865 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeView.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeView.java @@ -1,16 +1,8 @@ package org.jabref.gui.mergeentries.newmergedialog; -import java.util.ArrayList; -import java.util.List; - import javafx.scene.control.ScrollPane; -import javafx.scene.layout.ColumnConstraints; -import javafx.scene.layout.GridPane; -import javafx.scene.layout.Priority; -import javafx.scene.layout.RowConstraints; -import javafx.scene.layout.VBox; +import javafx.scene.layout.*; import javafx.stage.Screen; - import org.jabref.gui.mergeentries.newmergedialog.fieldsmerger.FieldMergerFactory; import org.jabref.gui.mergeentries.newmergedialog.toolbar.ThreeWayMergeToolbar; import org.jabref.logic.l10n.Localization; @@ -19,6 +11,9 @@ import org.jabref.model.entry.field.FieldProperty; import org.jabref.preferences.PreferencesService; +import java.util.ArrayList; +import java.util.List; + public class ThreeWayMergeView extends VBox { public static final int GRID_COLUMN_MIN_WIDTH = 250; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeViewModel.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeViewModel.java index c55be8ecc9c..ebf82dfdbcb 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeViewModel.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/ThreeWayMergeViewModel.java @@ -1,24 +1,23 @@ package org.jabref.gui.mergeentries.newmergedialog; -import java.util.Comparator; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.InternalField; +import java.util.Comparator; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class ThreeWayMergeViewModel extends AbstractViewModel { private final ObjectProperty leftEntry = new SimpleObjectProperty<>(); diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/CopyFieldValueCommand.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/CopyFieldValueCommand.java index e18a831933b..900b7e43bc8 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/CopyFieldValueCommand.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/CopyFieldValueCommand.java @@ -1,11 +1,11 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; -import java.util.Objects; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.actions.SimpleCommand; import org.jabref.preferences.PreferencesService; +import java.util.Objects; + public class CopyFieldValueCommand extends SimpleCommand { private final String fieldValue; private final ClipBoardManager clipBoardManager; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCell.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCell.java index 423b611f06c..10ca3777749 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCell.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCell.java @@ -1,5 +1,6 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.css.PseudoClass; @@ -7,18 +8,15 @@ import javafx.geometry.Pos; import javafx.scene.Cursor; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ContentDisplay; -import javafx.scene.control.ScrollPane; -import javafx.scene.control.Toggle; -import javafx.scene.control.ToggleGroup; +import javafx.scene.control.*; import javafx.scene.input.MouseEvent; import javafx.scene.input.ScrollEvent; import javafx.scene.layout.Background; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.paint.Color; - +import org.fxmisc.flowless.VirtualizedScrollPane; +import org.fxmisc.richtext.StyleClassedTextArea; import org.jabref.gui.Globals; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.fieldeditors.URLUtil; @@ -27,10 +25,6 @@ import org.jabref.model.entry.identifier.DOI; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import org.fxmisc.flowless.VirtualizedScrollPane; -import org.fxmisc.richtext.StyleClassedTextArea; import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.materialdesign2.MaterialDesignC; import org.slf4j.Logger; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCellViewModel.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCellViewModel.java index 7587d1e261b..2ac736b8b2e 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCellViewModel.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/FieldValueCellViewModel.java @@ -1,11 +1,6 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.scene.control.ToggleGroup; public class FieldValueCellViewModel { diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/MergedFieldCell.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/MergedFieldCell.java index 074d22b99a0..c70b9921ea6 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/MergedFieldCell.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/MergedFieldCell.java @@ -5,10 +5,8 @@ import javafx.scene.input.ScrollEvent; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; - -import org.jabref.gui.util.BindingsHelper; - import org.fxmisc.richtext.StyleClassedTextArea; +import org.jabref.gui.util.BindingsHelper; public class MergedFieldCell extends ThreeWayMergeCell { private static final String DEFAULT_STYLE_CLASS = "merged-field"; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/OpenExternalLinkAction.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/OpenExternalLinkAction.java index fbeda7407cc..eed9672ef7b 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/OpenExternalLinkAction.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/OpenExternalLinkAction.java @@ -1,16 +1,15 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; -import java.io.IOException; -import java.net.URI; - import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.model.entry.identifier.DOI; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URI; + /** * A command for opening DOIs and URLs. This was created primarily for simplifying {@link FieldValueCell}. */ diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCell.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCell.java index 1c9df85a6bd..df8bf400960 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCell.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCell.java @@ -1,11 +1,10 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.StringProperty; import javafx.css.PseudoClass; import javafx.scene.layout.HBox; -import com.tobiasdiez.easybind.EasyBind; - public abstract class ThreeWayMergeCell extends HBox { public static final String ODD_PSEUDO_CLASS = "odd"; public static final String EVEN_PSEUDO_CLASS = "even"; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCellViewModel.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCellViewModel.java index e5674a60251..3d57b8d039f 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCellViewModel.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/ThreeWayMergeCellViewModel.java @@ -1,12 +1,11 @@ package org.jabref.gui.mergeentries.newmergedialog.cell; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; -import com.tobiasdiez.easybind.EasyBind; - import static org.jabref.gui.mergeentries.newmergedialog.cell.ThreeWayMergeCell.HEADER_ROW; public class ThreeWayMergeCellViewModel { diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/InfoButton.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/InfoButton.java index 874986e9469..b01d0884413 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/InfoButton.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/InfoButton.java @@ -1,11 +1,9 @@ package org.jabref.gui.mergeentries.newmergedialog.cell.sidebuttons; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.scene.control.Button; - import org.jabref.gui.Globals; import org.jabref.gui.actions.Action; import org.jabref.gui.actions.ActionFactory; @@ -13,7 +11,7 @@ import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; -import com.tobiasdiez.easybind.EasyBind; +import java.util.Optional; public class InfoButton extends Button { private final StringProperty infoMessage = new SimpleStringProperty(); diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/ToggleMergeUnmergeButton.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/ToggleMergeUnmergeButton.java index 1fbbd3db49c..00de657349c 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/ToggleMergeUnmergeButton.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/cell/sidebuttons/ToggleMergeUnmergeButton.java @@ -1,13 +1,10 @@ package org.jabref.gui.mergeentries.newmergedialog.cell.sidebuttons; -import java.util.Optional; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.control.Button; - import org.jabref.gui.Globals; import org.jabref.gui.actions.Action; import org.jabref.gui.actions.ActionFactory; @@ -17,6 +14,8 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; +import java.util.Optional; + public class ToggleMergeUnmergeButton extends Button { private final ObjectProperty fieldState = new SimpleObjectProperty<>(FieldState.UNMERGED); private final BooleanProperty canMerge = new SimpleBooleanProperty(Boolean.TRUE); diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/DiffHighlighter.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/DiffHighlighter.java index 93aadd9ead6..05c3d7b0ef7 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/DiffHighlighter.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/DiffHighlighter.java @@ -1,13 +1,12 @@ package org.jabref.gui.mergeentries.newmergedialog.diffhighlighter; +import org.fxmisc.richtext.StyleClassedTextArea; +import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; + import java.util.Arrays; import java.util.List; import java.util.Objects; -import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; - -import org.fxmisc.richtext.StyleClassedTextArea; - public abstract sealed class DiffHighlighter permits SplitDiffHighlighter, UnifiedDiffHighlighter { protected final StyleClassedTextArea sourceTextview; protected final StyleClassedTextArea targetTextview; diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/SplitDiffHighlighter.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/SplitDiffHighlighter.java index 28ca333edb7..7d2b408f6a9 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/SplitDiffHighlighter.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/SplitDiffHighlighter.java @@ -1,12 +1,11 @@ package org.jabref.gui.mergeentries.newmergedialog.diffhighlighter; -import java.util.List; - -import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; - import com.github.difflib.DiffUtils; import com.github.difflib.patch.AbstractDelta; import org.fxmisc.richtext.StyleClassedTextArea; +import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; + +import java.util.List; /** * A diff highlighter in which changes are split between source and target text view. diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/UnifiedDiffHighlighter.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/UnifiedDiffHighlighter.java index f571d078c80..fdfe7e03e3e 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/UnifiedDiffHighlighter.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/diffhighlighter/UnifiedDiffHighlighter.java @@ -1,15 +1,14 @@ package org.jabref.gui.mergeentries.newmergedialog.diffhighlighter; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; - import com.github.difflib.DiffUtils; import com.github.difflib.patch.AbstractDelta; import com.github.difflib.patch.DeltaType; import org.fxmisc.richtext.StyleClassedTextArea; +import org.jabref.gui.mergeentries.newmergedialog.DiffMethod; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; /** * A diff highlighter in which differences of type {@link DeltaType#CHANGE} are unified and represented by an insertion diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMerger.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMerger.java index 91063b931f1..0d710e8f42b 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMerger.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMerger.java @@ -1,13 +1,13 @@ package org.jabref.gui.mergeentries.newmergedialog.fieldsmerger; -import java.util.List; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.logic.importer.util.FileFieldParser; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; +import java.util.List; + /** * A merger for the {@link StandardField#FILE} field * */ diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/GroupMerger.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/GroupMerger.java index df7aec006b0..f202bda6a81 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/GroupMerger.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/GroupMerger.java @@ -1,12 +1,12 @@ package org.jabref.gui.mergeentries.newmergedialog.fieldsmerger; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.strings.StringUtil; + import java.util.Arrays; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.strings.StringUtil; - /** * A merger for the {@link StandardField#GROUPS} field * */ diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/KeywordMerger.java b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/KeywordMerger.java index 8e7e7540767..2ce2a9310e5 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/KeywordMerger.java +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/KeywordMerger.java @@ -1,11 +1,11 @@ package org.jabref.gui.mergeentries.newmergedialog.fieldsmerger; -import java.util.Objects; - import org.jabref.model.entry.KeywordList; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.BibEntryPreferences; +import java.util.Objects; + /** * A merger for the {@link StandardField#KEYWORDS} field * */ diff --git a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/toolbar/ThreeWayMergeToolbar.fxml b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/toolbar/ThreeWayMergeToolbar.fxml index ae4b1b8829d..f265ed25abd 100644 --- a/src/main/java/org/jabref/gui/mergeentries/newmergedialog/toolbar/ThreeWayMergeToolbar.fxml +++ b/src/main/java/org/jabref/gui/mergeentries/newmergedialog/toolbar/ThreeWayMergeToolbar.fxml @@ -1,15 +1,8 @@ - - - - - - - - - + + - - - - - - + { @FXML diff --git a/src/main/java/org/jabref/gui/openoffice/Bootstrap.java b/src/main/java/org/jabref/gui/openoffice/Bootstrap.java index 7a42b22cc71..66f03682665 100644 --- a/src/main/java/org/jabref/gui/openoffice/Bootstrap.java +++ b/src/main/java/org/jabref/gui/openoffice/Bootstrap.java @@ -20,19 +20,6 @@ package org.jabref.gui.openoffice; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; -import java.util.Random; - import com.sun.star.bridge.UnoUrlResolver; import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.comp.helper.BootstrapException; @@ -49,6 +36,14 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.Random; + /** Bootstrap offers functionality to obtain a context or simply * a service manager. * The service manager can create a few basic services, whose implementations are: diff --git a/src/main/java/org/jabref/gui/openoffice/CitationEntryViewModel.java b/src/main/java/org/jabref/gui/openoffice/CitationEntryViewModel.java index 7cb76273486..47dbe47875e 100644 --- a/src/main/java/org/jabref/gui/openoffice/CitationEntryViewModel.java +++ b/src/main/java/org/jabref/gui/openoffice/CitationEntryViewModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.model.openoffice.CitationEntry; public class CitationEntryViewModel { diff --git a/src/main/java/org/jabref/gui/openoffice/DetectOpenOfficeInstallation.java b/src/main/java/org/jabref/gui/openoffice/DetectOpenOfficeInstallation.java index 28e7069c847..ca6be9e95ec 100644 --- a/src/main/java/org/jabref/gui/openoffice/DetectOpenOfficeInstallation.java +++ b/src/main/java/org/jabref/gui/openoffice/DetectOpenOfficeInstallation.java @@ -1,10 +1,5 @@ package org.jabref.gui.openoffice; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.desktop.os.NativeDesktop; import org.jabref.gui.util.DirectoryDialogConfiguration; @@ -14,6 +9,11 @@ import org.jabref.logic.util.io.FileUtil; import org.jabref.model.strings.StringUtil; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + /** * Tools for automatically detecting OpenOffice or LibreOffice installations. */ diff --git a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialog.fxml b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialog.fxml index 4d6fccf48e7..4e255750290 100644 --- a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialog.fxml +++ b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialog.fxml @@ -1,9 +1,6 @@ - - - - + { private static final String HTML_BOLD_END_TAG = ""; diff --git a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogViewModel.java b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogViewModel.java index 634beea8680..75c54965b40 100644 --- a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogViewModel.java +++ b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogViewModel.java @@ -1,16 +1,15 @@ package org.jabref.gui.openoffice; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.model.openoffice.CitationEntry; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class ManageCitationsDialogViewModel { public final boolean failedToGetCitationEntries; diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java index f8ebc72880b..015d2cbfe46 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java @@ -1,24 +1,19 @@ package org.jabref.gui.openoffice; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Supplier; -import java.util.stream.Collectors; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.comp.helper.BootstrapException; +import com.sun.star.container.NoSuchElementException; +import com.sun.star.lang.DisposedException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; import org.jabref.gui.DialogService; import org.jabref.logic.JabRefException; import org.jabref.logic.l10n.Localization; import org.jabref.logic.openoffice.NoDocumentFoundException; -import org.jabref.logic.openoffice.action.EditInsert; -import org.jabref.logic.openoffice.action.EditMerge; -import org.jabref.logic.openoffice.action.EditSeparate; -import org.jabref.logic.openoffice.action.ExportCited; -import org.jabref.logic.openoffice.action.ManageCitations; -import org.jabref.logic.openoffice.action.Update; +import org.jabref.logic.openoffice.action.*; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.logic.openoffice.frontend.RangeForOverlapCheck; import org.jabref.logic.openoffice.style.OOBibStyle; @@ -28,28 +23,17 @@ import org.jabref.model.openoffice.rangesort.FunctionalTextViewCursor; import org.jabref.model.openoffice.style.CitationGroupId; import org.jabref.model.openoffice.style.CitationType; -import org.jabref.model.openoffice.uno.CreationException; -import org.jabref.model.openoffice.uno.NoDocumentException; -import org.jabref.model.openoffice.uno.UnoCrossRef; -import org.jabref.model.openoffice.uno.UnoCursor; -import org.jabref.model.openoffice.uno.UnoRedlines; -import org.jabref.model.openoffice.uno.UnoStyle; -import org.jabref.model.openoffice.uno.UnoUndo; +import org.jabref.model.openoffice.uno.*; import org.jabref.model.openoffice.util.OOResult; import org.jabref.model.openoffice.util.OOVoidResult; - -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.comp.helper.BootstrapException; -import com.sun.star.container.NoSuchElementException; -import com.sun.star.lang.DisposedException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Path; +import java.util.*; +import java.util.function.Supplier; +import java.util.stream.Collectors; + /** * Class for manipulating the Bibliography of the currently started document in OpenOffice. */ diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBaseConnect.java b/src/main/java/org/jabref/gui/openoffice/OOBibBaseConnect.java index 8ddf643e0d6..31f140872fb 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBaseConnect.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBaseConnect.java @@ -1,20 +1,5 @@ package org.jabref.gui.openoffice; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.jabref.gui.DialogService; -import org.jabref.logic.l10n.Localization; -import org.jabref.logic.openoffice.NoDocumentFoundException; -import org.jabref.model.openoffice.uno.CreationException; -import org.jabref.model.openoffice.uno.NoDocumentException; -import org.jabref.model.openoffice.uno.UnoCast; -import org.jabref.model.openoffice.uno.UnoTextDocument; -import org.jabref.model.openoffice.util.OOResult; - import com.sun.star.bridge.XBridge; import com.sun.star.bridge.XBridgeFactory; import com.sun.star.comp.helper.BootstrapException; @@ -27,9 +12,23 @@ import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.XComponentContext; +import org.jabref.gui.DialogService; +import org.jabref.logic.l10n.Localization; +import org.jabref.logic.openoffice.NoDocumentFoundException; +import org.jabref.model.openoffice.uno.CreationException; +import org.jabref.model.openoffice.uno.NoDocumentException; +import org.jabref.model.openoffice.uno.UnoCast; +import org.jabref.model.openoffice.uno.UnoTextDocument; +import org.jabref.model.openoffice.util.OOResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + import static com.sun.star.uno.UnoRuntime.queryInterface; /** diff --git a/src/main/java/org/jabref/gui/openoffice/OOError.java b/src/main/java/org/jabref/gui/openoffice/OOError.java index 6e28a93a1f8..19f75506dd2 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOError.java +++ b/src/main/java/org/jabref/gui/openoffice/OOError.java @@ -1,13 +1,12 @@ package org.jabref.gui.openoffice; +import com.sun.star.lang.DisposedException; import org.jabref.gui.DialogService; import org.jabref.logic.JabRefException; import org.jabref.logic.l10n.Localization; import org.jabref.logic.openoffice.NoDocumentFoundException; import org.jabref.model.openoffice.uno.NoDocumentException; -import com.sun.star.lang.DisposedException; - class OOError extends JabRefException { private String localizedTitle; diff --git a/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java b/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java index 49f3fb59bfb..e97fbe36a72 100644 --- a/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java +++ b/src/main/java/org/jabref/gui/openoffice/OpenOfficePanel.java @@ -1,36 +1,16 @@ package org.jabref.gui.openoffice; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.sun.star.comp.helper.BootstrapException; import javafx.concurrent.Task; import javafx.geometry.Insets; import javafx.geometry.Side; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.CheckMenuItem; -import javafx.scene.control.ContextMenu; -import javafx.scene.control.MenuItem; -import javafx.scene.control.ProgressBar; -import javafx.scene.control.RadioMenuItem; -import javafx.scene.control.SeparatorMenuItem; -import javafx.scene.control.ToggleGroup; -import javafx.scene.control.Tooltip; +import javafx.scene.control.*; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; - -import org.jabref.gui.DialogService; -import org.jabref.gui.JabRefGUI; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.LibraryTabContainer; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.StandardActions; import org.jabref.gui.help.HelpAction; @@ -59,11 +39,16 @@ import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.sun.star.comp.helper.BootstrapException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + /** * Pane to manage the interaction between JabRef and OpenOffice. */ diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialog.fxml b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialog.fxml index 7c6a3f614c9..2c0198f928b 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialog.fxml +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialog.fxml @@ -1,12 +1,7 @@ - - - - - - - + + { private final MenuItem edit = new MenuItem(Localization.lang("Edit")); diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java index e5980ac4ea2..561c15c9571 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java @@ -1,11 +1,5 @@ package org.jabref.gui.openoffice; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleListProperty; @@ -15,7 +9,6 @@ import javafx.scene.control.DialogPane; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextArea; - import org.jabref.gui.DialogService; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.externalfiletype.ExternalFileType; @@ -30,6 +23,12 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class StyleSelectDialogViewModel { private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectItemViewModel.java b/src/main/java/org/jabref/gui/openoffice/StyleSelectItemViewModel.java index a8fce7e7796..bc708824d9e 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectItemViewModel.java +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectItemViewModel.java @@ -1,13 +1,7 @@ package org.jabref.gui.openoffice; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.scene.Node; - import org.jabref.gui.icon.IconTheme; import org.jabref.logic.openoffice.style.OOBibStyle; diff --git a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java index 25199fcac99..e3b2e718ea8 100644 --- a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java +++ b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java @@ -1,15 +1,13 @@ package org.jabref.gui.preferences; -import java.util.List; - +import jakarta.inject.Inject; import javafx.scene.Node; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.gui.util.TaskExecutor; import org.jabref.preferences.PreferencesService; -import jakarta.inject.Inject; +import java.util.List; public abstract class AbstractPreferenceTabView extends VBox implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesDialog.fxml b/src/main/java/org/jabref/gui/preferences/PreferencesDialog.fxml index f13373f36d4..0c68c268ae8 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesDialog.fxml +++ b/src/main/java/org/jabref/gui/preferences/PreferencesDialog.fxml @@ -1,18 +1,10 @@ - - - - - - - - - - - + + + - - - - - - - - - - + + { diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesSearchHandler.java b/src/main/java/org/jabref/gui/preferences/PreferencesSearchHandler.java index 63ba430fadd..73e979d1f3d 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesSearchHandler.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesSearchHandler.java @@ -1,9 +1,6 @@ package org.jabref.gui.preferences; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - +import com.google.common.collect.ArrayListMultimap; import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; @@ -12,7 +9,9 @@ import javafx.scene.Parent; import javafx.scene.control.Labeled; -import com.google.common.collect.ArrayListMultimap; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; class PreferencesSearchHandler { diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesTab.java b/src/main/java/org/jabref/gui/preferences/PreferencesTab.java index d038e49622f..220dd57f9dd 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesTab.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesTab.java @@ -1,9 +1,9 @@ package org.jabref.gui.preferences; -import java.util.List; - import javafx.scene.Node; +import java.util.List; + /** * A prefsTab is a component displayed in the PreferenceDialog. *

diff --git a/src/main/java/org/jabref/gui/preferences/ShowPreferencesAction.java b/src/main/java/org/jabref/gui/preferences/ShowPreferencesAction.java index b070e914aea..ce209954b47 100644 --- a/src/main/java/org/jabref/gui/preferences/ShowPreferencesAction.java +++ b/src/main/java/org/jabref/gui/preferences/ShowPreferencesAction.java @@ -1,12 +1,11 @@ package org.jabref.gui.preferences; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.util.TaskExecutor; -import com.airhacks.afterburner.injection.Injector; - public class ShowPreferencesAction extends SimpleCommand { private final JabRefFrame jabRefFrame; diff --git a/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTab.fxml b/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTab.fxml index a75b4846688..5abd216340b 100644 --- a/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTab.fxml @@ -1,13 +1,8 @@ - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTabViewModel.java b/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTabViewModel.java index 5932aed5df7..f282dec6c6d 100644 --- a/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/autocompletion/AutoCompletionTabViewModel.java @@ -1,19 +1,18 @@ package org.jabref.gui.preferences.autocompletion; -import java.util.ArrayList; -import java.util.List; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode; import org.jabref.gui.autocompleter.AutoCompletePreferences; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.FieldFactory; +import java.util.ArrayList; +import java.util.List; + public class AutoCompletionTabViewModel implements PreferenceTabViewModel { private final BooleanProperty enableAutoCompleteProperty = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTab.fxml b/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTab.fxml index 3e261a6c213..e717b9e020c 100644 --- a/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTab.fxml @@ -1,15 +1,8 @@ - - - - - - - - - + + implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java b/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java index af13b0ab35f..7049fd159f9 100644 --- a/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/citationkeypattern/CitationKeyPatternTabViewModel.java @@ -1,15 +1,7 @@ package org.jabref.gui.preferences.citationkeypattern; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.commonfxcontrols.CitationKeyPatternPanelItemModel; import org.jabref.gui.commonfxcontrols.CitationKeyPatternPanelViewModel; import org.jabref.gui.preferences.PreferenceTabViewModel; diff --git a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypeViewModel.java b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypeViewModel.java index fe6f7eea700..ed97dc7874b 100644 --- a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypeViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypeViewModel.java @@ -1,10 +1,10 @@ package org.jabref.gui.preferences.customentrytypes; -import java.util.function.Predicate; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.field.Field; +import java.util.function.Predicate; + public class CustomEntryTypeViewModel extends EntryTypeViewModel { public CustomEntryTypeViewModel(BibEntryType entryType, Predicate isMultiline) { diff --git a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTab.fxml b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTab.fxml index 1990561768d..2257c314564 100644 --- a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTab.fxml @@ -1,15 +1,7 @@ - - - - - - - - - - + + implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java index 727542e00e0..88088edca0f 100644 --- a/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java @@ -1,14 +1,9 @@ package org.jabref.gui.preferences.customentrytypes; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.function.Predicate; -import java.util.stream.Collectors; - +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; import javafx.beans.Observable; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; @@ -16,28 +11,21 @@ import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypesManager; -import org.jabref.model.entry.field.BibField; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.entry.field.FieldPriority; -import org.jabref.model.entry.field.FieldProperty; -import org.jabref.model.entry.field.OrFields; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; public class CustomEntryTypesTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/customentrytypes/EntryTypeViewModel.java b/src/main/java/org/jabref/gui/preferences/customentrytypes/EntryTypeViewModel.java index 8681093d5f4..cf3430b6489 100644 --- a/src/main/java/org/jabref/gui/preferences/customentrytypes/EntryTypeViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customentrytypes/EntryTypeViewModel.java @@ -1,18 +1,17 @@ package org.jabref.gui.preferences.customentrytypes; -import java.util.List; -import java.util.Objects; -import java.util.function.Predicate; -import java.util.stream.Collectors; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.field.Field; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; +import java.util.stream.Collectors; + import static org.jabref.gui.preferences.customentrytypes.FieldViewModel.Mandatory; public class EntryTypeViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/customentrytypes/FieldViewModel.java b/src/main/java/org/jabref/gui/preferences/customentrytypes/FieldViewModel.java index 1d1cd3dd9c4..f69032d8493 100644 --- a/src/main/java/org/jabref/gui/preferences/customentrytypes/FieldViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customentrytypes/FieldViewModel.java @@ -1,18 +1,8 @@ package org.jabref.gui.preferences.customentrytypes; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - +import javafx.beans.property.*; import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.field.BibField; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.entry.field.FieldPriority; -import org.jabref.model.entry.field.FieldProperty; +import org.jabref.model.entry.field.*; public class FieldViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.fxml b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.fxml index 1b57c1af66a..0e8603b709b 100644 --- a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.fxml @@ -1,9 +1,6 @@ - - - - + diff --git a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java index dfcf5d64283..f5e682d1611 100644 --- a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java +++ b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java @@ -1,18 +1,16 @@ package org.jabref.gui.preferences.customexporter; +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; import javafx.fxml.FXML; import javafx.scene.control.SelectionMode; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; - import org.jabref.gui.exporter.ExporterViewModel; import org.jabref.gui.preferences.AbstractPreferenceTabView; import org.jabref.gui.preferences.PreferencesTab; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; - public class CustomExporterTab extends AbstractPreferenceTabView implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTabViewModel.java b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTabViewModel.java index 9298dbfe5a5..7abe42bd56c 100644 --- a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTabViewModel.java @@ -1,13 +1,8 @@ package org.jabref.gui.preferences.customexporter; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.exporter.CreateModifyExporterDialogView; import org.jabref.gui.exporter.ExporterViewModel; @@ -15,6 +10,10 @@ import org.jabref.logic.exporter.TemplateExporter; import org.jabref.preferences.PreferencesService; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class CustomExporterTabViewModel implements PreferenceTabViewModel { private final ListProperty exporters = diff --git a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.fxml b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.fxml index c9b12fcd336..75dfdbde842 100644 --- a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.fxml @@ -1,9 +1,6 @@ - - - - + diff --git a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.java b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.java index c8997d0ac5f..741046de9a1 100644 --- a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.java +++ b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTab.java @@ -1,21 +1,15 @@ package org.jabref.gui.preferences.customimporter; +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; import javafx.fxml.FXML; -import javafx.scene.control.Button; -import javafx.scene.control.SelectionMode; -import javafx.scene.control.TableColumn; -import javafx.scene.control.TableView; -import javafx.scene.control.Tooltip; - +import javafx.scene.control.*; import org.jabref.gui.importer.ImporterViewModel; import org.jabref.gui.preferences.AbstractPreferenceTabView; import org.jabref.gui.preferences.PreferencesTab; import org.jabref.gui.util.ViewModelTableRowFactory; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; - public class CustomImporterTab extends AbstractPreferenceTabView implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java index d1534a8ae5e..940feaabec7 100644 --- a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java @@ -1,16 +1,8 @@ package org.jabref.gui.preferences.customimporter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.importer.ImporterViewModel; import org.jabref.gui.preferences.PreferenceTabViewModel; @@ -21,10 +13,16 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.logic.util.io.FileUtil; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + public class CustomImporterTabViewModel implements PreferenceTabViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(CustomImporterTabViewModel.class); diff --git a/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml b/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml index 66015eb4199..dedf6cc27c1 100644 --- a/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/entry/EntryTab.fxml @@ -1,13 +1,8 @@ - - - - - - - + + implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/entry/EntryTabViewModel.java b/src/main/java/org/jabref/gui/preferences/entry/EntryTabViewModel.java index 64382d71a54..a1b03735dad 100644 --- a/src/main/java/org/jabref/gui/preferences/entry/EntryTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/entry/EntryTabViewModel.java @@ -4,7 +4,6 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.preferences.OwnerPreferences; diff --git a/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTab.fxml b/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTab.fxml index 85d4ded8602..b913f91e980 100644 --- a/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTab.fxml @@ -1,14 +1,8 @@ - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTabViewModel.java b/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTabViewModel.java index bc2c6c37104..16706add3e2 100644 --- a/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/entryeditor/EntryEditorTabViewModel.java @@ -1,14 +1,9 @@ package org.jabref.gui.preferences.entryeditor; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.DialogService; import org.jabref.gui.entryeditor.EntryEditorPreferences; import org.jabref.gui.preferences.PreferenceTabViewModel; @@ -19,6 +14,10 @@ import org.jabref.preferences.MrDlibPreferences; import org.jabref.preferences.PreferencesService; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + public class EntryEditorTabViewModel implements PreferenceTabViewModel { private final BooleanProperty openOnNewEntryProperty = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/preferences/export/ExportTab.java b/src/main/java/org/jabref/gui/preferences/export/ExportTab.java index 5ce6947eb96..2a4665141e0 100644 --- a/src/main/java/org/jabref/gui/preferences/export/ExportTab.java +++ b/src/main/java/org/jabref/gui/preferences/export/ExportTab.java @@ -1,14 +1,12 @@ package org.jabref.gui.preferences.export; +import com.airhacks.afterburner.views.ViewLoader; import javafx.fxml.FXML; - import org.jabref.gui.commonfxcontrols.SaveOrderConfigPanel; import org.jabref.gui.preferences.AbstractPreferenceTabView; import org.jabref.gui.preferences.PreferencesTab; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.views.ViewLoader; - public class ExportTab extends AbstractPreferenceTabView implements PreferencesTab { @FXML private SaveOrderConfigPanel exportOrderPanel; diff --git a/src/main/java/org/jabref/gui/preferences/export/ExportTabViewModel.java b/src/main/java/org/jabref/gui/preferences/export/ExportTabViewModel.java index 2b5c986746c..25559499b20 100644 --- a/src/main/java/org/jabref/gui/preferences/export/ExportTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/export/ExportTabViewModel.java @@ -1,14 +1,10 @@ package org.jabref.gui.preferences.export; -import java.util.ArrayList; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.commonfxcontrols.SortCriterionViewModel; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.model.entry.field.Field; @@ -17,6 +13,9 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.preferences.ExportPreferences; +import java.util.ArrayList; +import java.util.Set; + public class ExportTabViewModel implements PreferenceTabViewModel { // SaveOrderConfigPanel diff --git a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml index 15b6c1e413f..2bb2f221400 100644 --- a/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTab.fxml @@ -1,16 +1,7 @@ - - - - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java b/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java index bb99a5c0b8a..0f6f2ec753c 100644 --- a/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/external/ExternalTabViewModel.java @@ -1,19 +1,10 @@ package org.jabref.gui.preferences.external; -import java.util.HashMap; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.*; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.scene.control.ButtonType; import javafx.scene.control.DialogPane; - import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.gui.push.PushToApplication; @@ -27,11 +18,7 @@ import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.util.HashMap; public class ExternalTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.fxml b/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.fxml index ca5f5ca3879..4112e32e58d 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.fxml +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.fxml @@ -1,15 +1,7 @@ - - - - - - - - - - + + { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypeItemViewModel.java b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypeItemViewModel.java index da149d6e516..e81b40822f6 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypeItemViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypeItemViewModel.java @@ -4,7 +4,6 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.gui.externalfiletype.CustomExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.icon.IconTheme; diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.fxml b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.fxml index 7ac24bb5ccb..c7def99cc5b 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.fxml @@ -1,9 +1,6 @@ - - - - + diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java index 9cb1c121550..2cdb81c5115 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTab.java @@ -1,9 +1,9 @@ package org.jabref.gui.preferences.externalfiletypes; +import com.airhacks.afterburner.views.ViewLoader; import javafx.fxml.FXML; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.preferences.AbstractPreferenceTabView; @@ -12,8 +12,6 @@ import org.jabref.gui.util.ValueTableCellFactory; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.views.ViewLoader; - /** * Editor for external file types. */ diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTabViewModel.java b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTabViewModel.java index 221649bba98..dddcd7ba13d 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/ExternalFileTypesTabViewModel.java @@ -1,12 +1,7 @@ package org.jabref.gui.preferences.externalfiletypes; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Set; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; @@ -14,6 +9,10 @@ import org.jabref.logic.l10n.Localization; import org.jabref.preferences.FilePreferences; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Set; + public class ExternalFileTypesTabViewModel implements PreferenceTabViewModel { private final ObservableList fileTypes = FXCollections.observableArrayList(); diff --git a/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml b/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml index 3d4e80ecdc2..ba9ea1635b4 100644 --- a/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml @@ -1,18 +1,8 @@ - - - - - - - - - - - - + + implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java b/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java index 0457ded93b5..e5f71e1eeae 100644 --- a/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java @@ -1,24 +1,9 @@ package org.jabref.gui.preferences.general; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyListProperty; -import javafx.beans.property.ReadOnlyListWrapper; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.*; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.scene.control.SpinnerValueFactory; - import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.desktop.JabRefDesktop; @@ -38,18 +23,13 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.FileUpdateMonitor; -import org.jabref.preferences.FilePreferences; -import org.jabref.preferences.InternalPreferences; -import org.jabref.preferences.LibraryPreferences; -import org.jabref.preferences.PreferencesService; -import org.jabref.preferences.TelemetryPreferences; -import org.jabref.preferences.WorkspacePreferences; - -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import org.jabref.preferences.*; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; public class GeneralTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/groups/GroupsTab.fxml b/src/main/java/org/jabref/gui/preferences/groups/GroupsTab.fxml index 863a0c97fc1..3ce44e51468 100644 --- a/src/main/java/org/jabref/gui/preferences/groups/GroupsTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/groups/GroupsTab.fxml @@ -1,9 +1,6 @@ - - - - + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/groups/GroupsTabViewModel.java b/src/main/java/org/jabref/gui/preferences/groups/GroupsTabViewModel.java index b16cb7d8211..8edd238e766 100644 --- a/src/main/java/org/jabref/gui/preferences/groups/GroupsTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/groups/GroupsTabViewModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; - import org.jabref.gui.groups.GroupViewMode; import org.jabref.gui.groups.GroupsPreferences; import org.jabref.gui.preferences.PreferenceTabViewModel; diff --git a/src/main/java/org/jabref/gui/preferences/journals/AbbreviationViewModel.java b/src/main/java/org/jabref/gui/preferences/journals/AbbreviationViewModel.java index 6bb076c79d6..4cc27bc4cc6 100644 --- a/src/main/java/org/jabref/gui/preferences/journals/AbbreviationViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/journals/AbbreviationViewModel.java @@ -1,15 +1,14 @@ package org.jabref.gui.preferences.journals; -import java.util.Locale; -import java.util.Objects; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.logic.journals.Abbreviation; +import java.util.Locale; +import java.util.Objects; + /** * This class provides a view model for abbreviation objects which can also define placeholder objects of abbreviations. * This is indicated by using the {@code pseudoAbbreviation} property. diff --git a/src/main/java/org/jabref/gui/preferences/journals/AbbreviationsFileViewModel.java b/src/main/java/org/jabref/gui/preferences/journals/AbbreviationsFileViewModel.java index 1ff04b087ed..b67852399c4 100644 --- a/src/main/java/org/jabref/gui/preferences/journals/AbbreviationsFileViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/journals/AbbreviationsFileViewModel.java @@ -1,5 +1,13 @@ package org.jabref.gui.preferences.journals; +import javafx.beans.property.ReadOnlyBooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleListProperty; +import javafx.collections.FXCollections; +import org.jabref.logic.journals.Abbreviation; +import org.jabref.logic.journals.AbbreviationWriter; +import org.jabref.logic.journals.JournalAbbreviationLoader; + import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; @@ -10,15 +18,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import javafx.beans.property.ReadOnlyBooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.collections.FXCollections; - -import org.jabref.logic.journals.Abbreviation; -import org.jabref.logic.journals.AbbreviationWriter; -import org.jabref.logic.journals.JournalAbbreviationLoader; - /** * This class provides a model for abbreviation files. It actually doesn't save the files as objects but rather saves * their paths. This also allows to specify pseudo files as placeholder objects. diff --git a/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.fxml b/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.fxml index 5e61d63a372..03a8650a3e5 100644 --- a/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.fxml @@ -1,18 +1,10 @@ - - - - - - - - - - - + + + - - - - - + diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java index acce88319e5..ec20f4b3b18 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java @@ -1,14 +1,10 @@ package org.jabref.gui.preferences.keybindings; +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import javafx.fxml.FXML; -import javafx.scene.control.MenuButton; -import javafx.scene.control.MenuItem; -import javafx.scene.control.SelectionMode; -import javafx.scene.control.SelectionModel; -import javafx.scene.control.TreeItem; -import javafx.scene.control.TreeTableColumn; -import javafx.scene.control.TreeTableView; - +import javafx.scene.control.*; import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.preferences.AbstractPreferenceTabView; @@ -18,10 +14,6 @@ import org.jabref.gui.util.ViewModelTreeTableCellFactory; import org.jabref.logic.l10n.Localization; -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; -import jakarta.inject.Inject; - public class KeyBindingsTab extends AbstractPreferenceTabView implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTabViewModel.java b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTabViewModel.java index fc1adf034f2..e40daab2549 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTabViewModel.java @@ -1,10 +1,5 @@ package org.jabref.gui.preferences.keybindings; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleListProperty; @@ -14,7 +9,6 @@ import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; import javafx.scene.input.KeyEvent; - import org.jabref.gui.DialogService; import org.jabref.gui.keyboard.KeyBindingCategory; import org.jabref.gui.keyboard.KeyBindingRepository; @@ -26,6 +20,11 @@ import org.jabref.logic.l10n.Localization; import org.jabref.preferences.PreferencesService; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class KeyBindingsTabViewModel implements PreferenceTabViewModel { private final KeyBindingRepository keyBindingRepository; diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/presets/BashKeyBindingPreset.java b/src/main/java/org/jabref/gui/preferences/keybindings/presets/BashKeyBindingPreset.java index 72265447c39..a0a2c7c7fbd 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/presets/BashKeyBindingPreset.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/presets/BashKeyBindingPreset.java @@ -1,10 +1,10 @@ package org.jabref.gui.preferences.keybindings.presets; +import org.jabref.gui.keyboard.KeyBinding; + import java.util.HashMap; import java.util.Map; -import org.jabref.gui.keyboard.KeyBinding; - public class BashKeyBindingPreset implements KeyBindingPreset { @Override diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/presets/KeyBindingPreset.java b/src/main/java/org/jabref/gui/preferences/keybindings/presets/KeyBindingPreset.java index 4eae173e8de..562deeeab24 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/presets/KeyBindingPreset.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/presets/KeyBindingPreset.java @@ -1,9 +1,9 @@ package org.jabref.gui.preferences.keybindings.presets; -import java.util.Map; - import org.jabref.gui.keyboard.KeyBinding; +import java.util.Map; + public interface KeyBindingPreset { String getName(); diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/presets/NewEntryBindingPreset.java b/src/main/java/org/jabref/gui/preferences/keybindings/presets/NewEntryBindingPreset.java index c86f0647cc0..993f9a5a6f8 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/presets/NewEntryBindingPreset.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/presets/NewEntryBindingPreset.java @@ -1,11 +1,11 @@ package org.jabref.gui.preferences.keybindings.presets; -import java.util.HashMap; -import java.util.Map; - import org.jabref.gui.keyboard.KeyBinding; import org.jabref.logic.l10n.Localization; +import java.util.HashMap; +import java.util.Map; + public class NewEntryBindingPreset implements KeyBindingPreset { @Override diff --git a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTab.fxml b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTab.fxml index fe23b0c90af..850ec3c5b0a 100644 --- a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTab.fxml @@ -1,18 +1,7 @@ - - - - - - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java index 5817f71ddfb..928f2ab64a4 100644 --- a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java @@ -1,17 +1,11 @@ package org.jabref.gui.preferences.linkedfiles; -import java.nio.file.Files; -import java.nio.file.InvalidPathException; -import java.nio.file.Path; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.gui.util.DirectoryDialogConfiguration; @@ -20,10 +14,9 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; public class LinkedFilesTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterItemModel.java b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterItemModel.java index 91a3761b8e2..9385932d394 100644 --- a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterItemModel.java +++ b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterItemModel.java @@ -2,7 +2,6 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.logic.layout.format.NameFormatter; public class NameFormatterItemModel { diff --git a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.fxml b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.fxml index 467a9eef8a3..62abaf3b1f1 100644 --- a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.fxml @@ -1,13 +1,7 @@ - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java index 1456d6791cf..c0eef632687 100644 --- a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java @@ -1,18 +1,17 @@ package org.jabref.gui.preferences.nameformatter; -import java.util.ArrayList; -import java.util.List; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; - import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.layout.format.NameFormatterPreferences; import org.jabref.model.strings.StringUtil; +import java.util.ArrayList; +import java.util.List; + public class NameFormatterTabViewModel implements PreferenceTabViewModel { private final ListProperty formatterListProperty = diff --git a/src/main/java/org/jabref/gui/preferences/network/CustomCertificateViewModel.java b/src/main/java/org/jabref/gui/preferences/network/CustomCertificateViewModel.java index 066ea97ea08..2904d9b17d5 100644 --- a/src/main/java/org/jabref/gui/preferences/network/CustomCertificateViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/network/CustomCertificateViewModel.java @@ -1,18 +1,12 @@ package org.jabref.gui.preferences.network; -import java.time.LocalDate; -import java.util.Optional; - -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyObjectProperty; -import javafx.beans.property.ReadOnlyStringProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - +import javafx.beans.property.*; import org.jabref.gui.AbstractViewModel; import org.jabref.logic.net.ssl.SSLCertificate; +import java.time.LocalDate; +import java.util.Optional; + public class CustomCertificateViewModel extends AbstractViewModel { private final StringProperty serialNumberProperty = new SimpleStringProperty(""); private final StringProperty issuerProperty = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/preferences/network/NetworkTab.fxml b/src/main/java/org/jabref/gui/preferences/network/NetworkTab.fxml index bad0a1663e9..7e4f25439b3 100644 --- a/src/main/java/org/jabref/gui/preferences/network/NetworkTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/network/NetworkTab.fxml @@ -1,19 +1,10 @@ - - - - - - - - - - - - + + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/network/NetworkTabViewModel.java b/src/main/java/org/jabref/gui/preferences/network/NetworkTabViewModel.java index a747f54cdf8..6511c76a2e6 100644 --- a/src/main/java/org/jabref/gui/preferences/network/NetworkTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/network/NetworkTabViewModel.java @@ -1,23 +1,11 @@ package org.jabref.gui.preferences.network; -import java.net.MalformedURLException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicBoolean; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ReadOnlyBooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.*; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; import javafx.stage.FileChooser; - +import kong.unirest.UnirestException; import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.gui.util.FileDialogConfiguration; @@ -33,12 +21,12 @@ import org.jabref.preferences.InternalPreferences; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; -import kong.unirest.UnirestException; +import java.net.MalformedURLException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; public class NetworkTabViewModel implements PreferenceTabViewModel { private final BooleanProperty versionCheckProperty = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.fxml b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.fxml index de8b527a263..8e370832ff8 100644 --- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.fxml @@ -1,20 +1,11 @@ - - - - - - - - - - - - + + + implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java index 3c06e1b8fff..ea494545501 100644 --- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTabViewModel.java @@ -1,21 +1,10 @@ package org.jabref.gui.preferences.preview; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.transformation.FilteredList; import javafx.scene.control.MultipleSelectionModel; @@ -23,7 +12,8 @@ import javafx.scene.input.DragEvent; import javafx.scene.input.Dragboard; import javafx.scene.input.TransferMode; - +import org.fxmisc.richtext.model.StyleSpans; +import org.fxmisc.richtext.model.StyleSpansBuilder; import org.jabref.gui.DialogService; import org.jabref.gui.DragAndDropDataFormats; import org.jabref.gui.Globals; @@ -39,16 +29,13 @@ import org.jabref.logic.layout.TextBasedPreviewLayout; import org.jabref.logic.preview.PreviewLayout; import org.jabref.preferences.PreviewPreferences; - -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; -import org.fxmisc.richtext.model.StyleSpans; -import org.fxmisc.richtext.model.StyleSpansBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * This class is Preferences -> Entry Preview tab model *

diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java b/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java index beaa496170b..f1343a6cae5 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java @@ -1,15 +1,11 @@ package org.jabref.gui.preferences.protectedterms; -import java.util.ArrayList; -import java.util.List; - import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.gui.util.BaseDialog; import org.jabref.gui.util.FileDialogConfiguration; @@ -18,6 +14,9 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.preferences.FilePreferences; +import java.util.ArrayList; +import java.util.List; + public class NewProtectedTermsFileDialog extends BaseDialog { private final TextField newFile = new TextField(); diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsListItemModel.java b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsListItemModel.java index ad06b94b55c..78da8d1c502 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsListItemModel.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsListItemModel.java @@ -1,12 +1,6 @@ package org.jabref.gui.preferences.protectedterms; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ReadOnlyBooleanProperty; -import javafx.beans.property.ReadOnlyBooleanWrapper; -import javafx.beans.property.ReadOnlyStringProperty; -import javafx.beans.property.ReadOnlyStringWrapper; -import javafx.beans.property.SimpleBooleanProperty; - +import javafx.beans.property.*; import org.jabref.logic.protectedterms.ProtectedTermsList; public class ProtectedTermsListItemModel { diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.fxml b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.fxml index 66e35465e3f..ee87a417169 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.fxml @@ -1,9 +1,6 @@ - - - - + diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java index be1bf7b0d10..3ca8947c0ea 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java @@ -1,12 +1,13 @@ package org.jabref.gui.preferences.protectedterms; +import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import javafx.beans.property.ReadOnlyBooleanWrapper; import javafx.fxml.FXML; import javafx.scene.control.ContextMenu; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.CheckBoxTableCell; - import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; @@ -21,9 +22,6 @@ import org.jabref.logic.protectedterms.ProtectedTermsList; import org.jabref.logic.protectedterms.ProtectedTermsLoader; -import com.airhacks.afterburner.views.ViewLoader; -import jakarta.inject.Inject; - /** * Dialog for managing term list files. */ diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java index 9ce297fd9ef..63154df5b4b 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java @@ -1,11 +1,5 @@ package org.jabref.gui.preferences.protectedterms; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; @@ -13,7 +7,6 @@ import javafx.scene.control.DialogPane; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextArea; - import org.jabref.gui.DialogService; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.externalfiletype.ExternalFileType; @@ -29,10 +22,15 @@ import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + public class ProtectedTermsTabViewModel implements PreferenceTabViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ProtectedTermsTabViewModel.class); diff --git a/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml b/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml index e5bab38600a..983ef1d95c9 100644 --- a/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml @@ -1,17 +1,8 @@ - - - - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/table/TableTabViewModel.java b/src/main/java/org/jabref/gui/preferences/table/TableTabViewModel.java index b6d9a697c62..8e15c0c5f64 100644 --- a/src/main/java/org/jabref/gui/preferences/table/TableTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/table/TableTabViewModel.java @@ -1,17 +1,13 @@ package org.jabref.gui.preferences.table; -import java.util.EnumSet; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.scene.control.SelectionModel; import javafx.util.StringConverter; - import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.maintable.ColumnPreferences; @@ -30,10 +26,7 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.util.EnumSet; public class TableTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml index b868daec274..6f881066df7 100644 --- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml @@ -1,16 +1,7 @@ - - - - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java index 4cba89f86aa..6d348c569e8 100644 --- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java @@ -1,26 +1,9 @@ package org.jabref.gui.preferences.websearch; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyBooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - +import kong.unirest.UnirestException; import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.gui.slr.StudyCatalogItem; @@ -39,7 +22,13 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; -import kong.unirest.UnirestException; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.Optional; +import java.util.stream.Collectors; public class WebSearchTabViewModel implements PreferenceTabViewModel { private final BooleanProperty enableWebSearchProperty = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTab.fxml b/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTab.fxml index 68a5720ca3a..5e7a9e74dfb 100644 --- a/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTab.fxml @@ -1,14 +1,7 @@ - - - - - - - - - + + implements PreferencesTab { @FXML diff --git a/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTabViewModel.java b/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTabViewModel.java index 62ce706a76a..356a1c1eba1 100644 --- a/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/xmp/XmpPrivacyTabViewModel.java @@ -1,15 +1,11 @@ package org.jabref.gui.preferences.xmp; -import java.util.Comparator; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.beans.property.SimpleObjectProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.l10n.Localization; @@ -17,10 +13,7 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; +import java.util.Comparator; public class XmpPrivacyTabViewModel implements PreferenceTabViewModel { diff --git a/src/main/java/org/jabref/gui/preview/CopyCitationAction.java b/src/main/java/org/jabref/gui/preview/CopyCitationAction.java index 50dcb4c850c..825a5158694 100644 --- a/src/main/java/org/jabref/gui/preview/CopyCitationAction.java +++ b/src/main/java/org/jabref/gui/preview/CopyCitationAction.java @@ -1,13 +1,6 @@ package org.jabref.gui.preview; -import java.io.IOException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import javafx.scene.input.ClipboardContent; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; @@ -28,10 +21,15 @@ import org.jabref.logic.util.OS; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + /** * Copies the selected entries and formats them with the selected citation style (or preview), then it is copied to the clipboard. This worker cannot be reused. */ diff --git a/src/main/java/org/jabref/gui/preview/PreviewPanel.java b/src/main/java/org/jabref/gui/preview/PreviewPanel.java index bbdd9d19f49..9103fad6ca8 100644 --- a/src/main/java/org/jabref/gui/preview/PreviewPanel.java +++ b/src/main/java/org/jabref/gui/preview/PreviewPanel.java @@ -1,21 +1,10 @@ package org.jabref.gui.preview; -import java.io.File; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; -import javafx.scene.input.ClipboardContent; -import javafx.scene.input.DataFormat; -import javafx.scene.input.Dragboard; -import javafx.scene.input.KeyEvent; -import javafx.scene.input.TransferMode; +import javafx.scene.input.*; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.externalfiles.ExternalFilesEntryLinker; @@ -31,10 +20,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PreviewPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class PreviewPanel extends VBox { private static final Logger LOGGER = LoggerFactory.getLogger(PreviewPanel.class); diff --git a/src/main/java/org/jabref/gui/preview/PreviewViewer.java b/src/main/java/org/jabref/gui/preview/PreviewViewer.java index ce72aa968cd..efc2597b0c5 100644 --- a/src/main/java/org/jabref/gui/preview/PreviewViewer.java +++ b/src/main/java/org/jabref/gui/preview/PreviewViewer.java @@ -1,11 +1,5 @@ package org.jabref.gui.preview; -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; - import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.beans.value.ChangeListener; @@ -14,7 +8,6 @@ import javafx.scene.control.ScrollPane; import javafx.scene.input.ClipboardContent; import javafx.scene.web.WebView; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.Globals; @@ -31,7 +24,6 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -40,6 +32,12 @@ import org.w3c.dom.events.EventTarget; import org.w3c.dom.html.HTMLAnchorElement; +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Pattern; + /** * Displays an BibEntry using the given layout format. */ diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 5ce63618ce1..cd1c5a7d1e1 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -1,9 +1,5 @@ package org.jabref.gui.push; -import java.io.IOException; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.Action; import org.jabref.gui.icon.IconTheme; @@ -16,10 +12,13 @@ import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.List; +import java.util.Optional; + /** * Abstract class for pushing entries into different editors. */ diff --git a/src/main/java/org/jabref/gui/push/PushToApplication.java b/src/main/java/org/jabref/gui/push/PushToApplication.java index 9a0441ab0f4..cf658fbf333 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplication.java +++ b/src/main/java/org/jabref/gui/push/PushToApplication.java @@ -1,13 +1,13 @@ package org.jabref.gui.push; -import java.util.List; - import org.jabref.gui.actions.Action; import org.jabref.gui.icon.JabRefIcon; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PushToApplicationPreferences; +import java.util.List; + /** * Class that defines interaction with an external application in the form of "pushing" selected entries to it. */ diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java index 104d040d92b..7f54e87edfb 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java @@ -1,13 +1,8 @@ package org.jabref.gui.push; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.control.ButtonBase; import javafx.scene.control.MenuItem; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.Action; @@ -21,11 +16,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; import static org.jabref.gui.actions.ActionHelper.needsEntriesSelected; diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationSettings.java b/src/main/java/org/jabref/gui/push/PushToApplicationSettings.java index 7112fc489ca..9781fbeb4f8 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationSettings.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationSettings.java @@ -1,8 +1,5 @@ package org.jabref.gui.push; -import java.util.HashMap; -import java.util.Map; - import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; @@ -10,7 +7,6 @@ import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; - import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.util.FileDialogConfiguration; @@ -18,6 +14,9 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PushToApplicationPreferences; +import java.util.HashMap; +import java.util.Map; + public class PushToApplicationSettings { protected final Label commandLabel; diff --git a/src/main/java/org/jabref/gui/push/PushToApplications.java b/src/main/java/org/jabref/gui/push/PushToApplications.java index 4badc5e3d3c..71088effd18 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplications.java +++ b/src/main/java/org/jabref/gui/push/PushToApplications.java @@ -1,12 +1,12 @@ package org.jabref.gui.push; +import org.jabref.gui.DialogService; +import org.jabref.preferences.PreferencesService; + import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.jabref.gui.DialogService; -import org.jabref.preferences.PreferencesService; - public class PushToApplications { public static final String EMACS = "Emacs"; diff --git a/src/main/java/org/jabref/gui/push/PushToEmacs.java b/src/main/java/org/jabref/gui/push/PushToEmacs.java index 59ebce31615..c324f512d4f 100644 --- a/src/main/java/org/jabref/gui/push/PushToEmacs.java +++ b/src/main/java/org/jabref/gui/push/PushToEmacs.java @@ -1,10 +1,5 @@ package org.jabref.gui.push; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefExecutorService; import org.jabref.gui.icon.IconTheme; @@ -15,10 +10,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; + public class PushToEmacs extends AbstractPushToApplication { public static final String NAME = PushToApplications.EMACS; diff --git a/src/main/java/org/jabref/gui/push/PushToEmacsSettings.java b/src/main/java/org/jabref/gui/push/PushToEmacsSettings.java index b4732c81176..3338f5013ec 100644 --- a/src/main/java/org/jabref/gui/push/PushToEmacsSettings.java +++ b/src/main/java/org/jabref/gui/push/PushToEmacsSettings.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.control.TextField; - import org.jabref.gui.DialogService; import org.jabref.logic.l10n.Localization; import org.jabref.preferences.FilePreferences; diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index 3dc86731476..1501a66aac7 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -1,12 +1,5 @@ package org.jabref.gui.push; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefExecutorService; import org.jabref.gui.icon.IconTheme; @@ -16,10 +9,16 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.List; + public class PushToLyx extends AbstractPushToApplication { public static final String NAME = PushToApplications.LYX; diff --git a/src/main/java/org/jabref/gui/push/PushToSublimeText.java b/src/main/java/org/jabref/gui/push/PushToSublimeText.java index f5905dee04b..629f55d8c7d 100644 --- a/src/main/java/org/jabref/gui/push/PushToSublimeText.java +++ b/src/main/java/org/jabref/gui/push/PushToSublimeText.java @@ -1,10 +1,5 @@ package org.jabref.gui.push; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefExecutorService; import org.jabref.gui.icon.IconTheme; @@ -15,10 +10,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.strings.StringUtil; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; + public class PushToSublimeText extends AbstractPushToApplication { public static final String NAME = PushToApplications.SUBLIME_TEXT; diff --git a/src/main/java/org/jabref/gui/push/PushToTexShop.java b/src/main/java/org/jabref/gui/push/PushToTexShop.java index 28a266772f4..41c60e66b4d 100644 --- a/src/main/java/org/jabref/gui/push/PushToTexShop.java +++ b/src/main/java/org/jabref/gui/push/PushToTexShop.java @@ -1,8 +1,5 @@ package org.jabref.gui.push; -import java.io.IOException; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefExecutorService; import org.jabref.gui.icon.IconTheme; @@ -13,10 +10,12 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.List; + public class PushToTexShop extends AbstractPushToApplication { public static final String NAME = PushToApplications.TEXSHOP; diff --git a/src/main/java/org/jabref/gui/push/PushToVim.java b/src/main/java/org/jabref/gui/push/PushToVim.java index 5a842ac0241..b1f1812abf9 100644 --- a/src/main/java/org/jabref/gui/push/PushToVim.java +++ b/src/main/java/org/jabref/gui/push/PushToVim.java @@ -1,10 +1,5 @@ package org.jabref.gui.push; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefExecutorService; import org.jabref.gui.icon.IconTheme; @@ -14,10 +9,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; + public class PushToVim extends AbstractPushToApplication { public static final String NAME = PushToApplications.VIM; diff --git a/src/main/java/org/jabref/gui/push/PushToVimSettings.java b/src/main/java/org/jabref/gui/push/PushToVimSettings.java index bf3e21405fa..279d497e2ea 100644 --- a/src/main/java/org/jabref/gui/push/PushToVimSettings.java +++ b/src/main/java/org/jabref/gui/push/PushToVimSettings.java @@ -2,7 +2,6 @@ import javafx.scene.control.Label; import javafx.scene.control.TextField; - import org.jabref.gui.DialogService; import org.jabref.logic.l10n.Localization; import org.jabref.preferences.FilePreferences; diff --git a/src/main/java/org/jabref/gui/remote/CLIMessageHandler.java b/src/main/java/org/jabref/gui/remote/CLIMessageHandler.java index 3d7805edb28..08cd6f6daa0 100644 --- a/src/main/java/org/jabref/gui/remote/CLIMessageHandler.java +++ b/src/main/java/org/jabref/gui/remote/CLIMessageHandler.java @@ -1,9 +1,7 @@ package org.jabref.gui.remote; -import java.util.List; - import javafx.application.Platform; - +import org.apache.commons.cli.ParseException; import org.jabref.cli.ArgumentProcessor; import org.jabref.gui.JabRefGUI; import org.jabref.logic.importer.ParserResult; @@ -11,11 +9,11 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import org.apache.commons.cli.ParseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; + public class CLIMessageHandler implements RemoteMessageHandler { private static final Logger LOGGER = LoggerFactory.getLogger(CLIMessageHandler.class); diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index 48674b86096..098531f6ad7 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -1,15 +1,10 @@ package org.jabref.gui.search; -import java.lang.reflect.Field; -import java.time.Duration; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -import javax.swing.undo.UndoManager; - +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.Validator; +import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import impl.org.controlsfx.skin.AutoCompletePopup; import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; @@ -23,14 +18,7 @@ import javafx.geometry.Pos; import javafx.scene.Cursor; import javafx.scene.Node; -import javafx.scene.control.Button; -import javafx.scene.control.ButtonBase; -import javafx.scene.control.ContentDisplay; -import javafx.scene.control.Label; -import javafx.scene.control.ListView; -import javafx.scene.control.Skin; -import javafx.scene.control.ToggleButton; -import javafx.scene.control.Tooltip; +import javafx.scene.control.*; import javafx.scene.control.cell.TextFieldListCell; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseButton; @@ -40,16 +28,13 @@ import javafx.scene.layout.StackPane; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; - +import org.controlsfx.control.textfield.AutoCompletionBinding; +import org.controlsfx.control.textfield.CustomTextField; import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; -import org.jabref.gui.autocompleter.AppendPersonNamesStrategy; -import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode; -import org.jabref.gui.autocompleter.AutoCompletionTextInputBinding; -import org.jabref.gui.autocompleter.PersonNameStringConverter; -import org.jabref.gui.autocompleter.SuggestionProvider; +import org.jabref.gui.autocompleter.*; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.keyboard.KeyBindingRepository; @@ -65,19 +50,20 @@ import org.jabref.model.search.rules.SearchRules; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SearchPreferences; - -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.Validator; -import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; -import impl.org.controlsfx.skin.AutoCompletePopup; -import org.controlsfx.control.textfield.AutoCompletionBinding; -import org.controlsfx.control.textfield.CustomTextField; import org.reactfx.util.FxTimer; import org.reactfx.util.Timer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.lang.reflect.Field; +import java.time.Duration; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class GlobalSearchBar extends HBox { diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.fxml b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.fxml index 587752aebb4..167241004b2 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.fxml +++ b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.fxml @@ -1,10 +1,6 @@ - - - - - + diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java index 7f7c83cf446..a607d57ec79 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java @@ -1,14 +1,14 @@ package org.jabref.gui.search; -import javax.swing.undo.UndoManager; - +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.SplitPane; import javafx.scene.control.ToggleButton; import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.WindowEvent; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.icon.IconTheme; @@ -20,9 +20,7 @@ import org.jabref.logic.l10n.Localization; import org.jabref.preferences.PreferencesService; -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; -import jakarta.inject.Inject; +import javax.swing.undo.UndoManager; public class GlobalSearchResultDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialogViewModel.java b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialogViewModel.java index aab636eabc6..16944cd3e16 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialogViewModel.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialogViewModel.java @@ -1,14 +1,12 @@ package org.jabref.gui.search; +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SearchPreferences; -import com.tobiasdiez.easybind.EasyBind; - public class GlobalSearchResultDialogViewModel { private final BibDatabaseContext searchDatabaseContext = new BibDatabaseContext(); private final BooleanProperty keepOnTop = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java b/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java index d95d20f90e1..242fd923eb7 100644 --- a/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java +++ b/src/main/java/org/jabref/gui/search/RebuildFulltextSearchIndexAction.java @@ -1,7 +1,5 @@ package org.jabref.gui.search; -import java.io.IOException; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTab; import org.jabref.gui.StateManager; @@ -12,10 +10,11 @@ import org.jabref.logic.pdf.search.indexing.PdfIndexer; import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; + import static org.jabref.gui.actions.ActionHelper.needsDatabase; public class RebuildFulltextSearchIndexAction extends SimpleCommand { diff --git a/src/main/java/org/jabref/gui/search/SearchDisplayMode.java b/src/main/java/org/jabref/gui/search/SearchDisplayMode.java index 78bf43d6545..bde1ab5d0ae 100644 --- a/src/main/java/org/jabref/gui/search/SearchDisplayMode.java +++ b/src/main/java/org/jabref/gui/search/SearchDisplayMode.java @@ -1,9 +1,9 @@ package org.jabref.gui.search; -import java.util.function.Supplier; - import org.jabref.logic.l10n.Localization; +import java.util.function.Supplier; + /** * Collects the possible search modes */ diff --git a/src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java b/src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java index 10ecb4e4569..353f3c353ee 100644 --- a/src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java +++ b/src/main/java/org/jabref/gui/search/SearchFieldRightClickMenu.java @@ -4,7 +4,7 @@ import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; - +import org.controlsfx.control.textfield.CustomTextField; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionFactory; @@ -14,8 +14,6 @@ import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.logic.l10n.Localization; -import org.controlsfx.control.textfield.CustomTextField; - public class SearchFieldRightClickMenu { public static ContextMenu create( KeyBindingRepository keyBindingRepository, diff --git a/src/main/java/org/jabref/gui/search/SearchResultsTable.java b/src/main/java/org/jabref/gui/search/SearchResultsTable.java index f9aa838a5f4..bc6bc9256ff 100644 --- a/src/main/java/org/jabref/gui/search/SearchResultsTable.java +++ b/src/main/java/org/jabref/gui/search/SearchResultsTable.java @@ -1,27 +1,20 @@ package org.jabref.gui.search; -import java.util.List; - -import javax.swing.undo.UndoManager; - import javafx.scene.control.SelectionMode; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; -import org.jabref.gui.maintable.BibEntryTableViewModel; -import org.jabref.gui.maintable.MainTable; -import org.jabref.gui.maintable.MainTableColumnFactory; -import org.jabref.gui.maintable.MainTablePreferences; -import org.jabref.gui.maintable.PersistenceVisualStateTable; -import org.jabref.gui.maintable.SmartConstrainedResizePolicy; +import org.jabref.gui.maintable.*; import org.jabref.gui.maintable.columns.LibraryColumn; import org.jabref.gui.maintable.columns.MainTableColumn; import org.jabref.gui.util.TaskExecutor; import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.List; + public class SearchResultsTable extends TableView { public SearchResultsTable( diff --git a/src/main/java/org/jabref/gui/search/SearchResultsTableDataModel.java b/src/main/java/org/jabref/gui/search/SearchResultsTableDataModel.java index 044327b8371..0e4c73e5b17 100644 --- a/src/main/java/org/jabref/gui/search/SearchResultsTableDataModel.java +++ b/src/main/java/org/jabref/gui/search/SearchResultsTableDataModel.java @@ -1,15 +1,12 @@ package org.jabref.gui.search; -import java.util.List; -import java.util.Optional; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; - import org.jabref.gui.StateManager; import org.jabref.gui.maintable.BibEntryTableViewModel; import org.jabref.gui.maintable.MainTableFieldValueFormatter; @@ -19,7 +16,8 @@ import org.jabref.model.entry.BibEntry; import org.jabref.preferences.PreferencesService; -import com.tobiasdiez.easybind.EasyBind; +import java.util.List; +import java.util.Optional; public class SearchResultsTableDataModel { diff --git a/src/main/java/org/jabref/gui/search/SearchTextField.java b/src/main/java/org/jabref/gui/search/SearchTextField.java index 5073d01475a..e29610477d6 100644 --- a/src/main/java/org/jabref/gui/search/SearchTextField.java +++ b/src/main/java/org/jabref/gui/search/SearchTextField.java @@ -1,10 +1,9 @@ package org.jabref.gui.search; -import org.jabref.gui.icon.IconTheme; -import org.jabref.logic.l10n.Localization; - import org.controlsfx.control.textfield.CustomTextField; import org.controlsfx.control.textfield.TextFields; +import org.jabref.gui.icon.IconTheme; +import org.jabref.logic.l10n.Localization; public class SearchTextField { diff --git a/src/main/java/org/jabref/gui/search/rules/describer/ContainsAndRegexBasedSearchRuleDescriber.java b/src/main/java/org/jabref/gui/search/rules/describer/ContainsAndRegexBasedSearchRuleDescriber.java index 4ff87ec4cb4..3a118f0c54a 100644 --- a/src/main/java/org/jabref/gui/search/rules/describer/ContainsAndRegexBasedSearchRuleDescriber.java +++ b/src/main/java/org/jabref/gui/search/rules/describer/ContainsAndRegexBasedSearchRuleDescriber.java @@ -1,17 +1,16 @@ package org.jabref.gui.search.rules.describer; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.text.Text; import javafx.scene.text.TextFlow; - import org.jabref.gui.util.TooltipTextUtil; import org.jabref.logic.l10n.Localization; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.model.search.rules.SentenceAnalyzer; +import java.util.EnumSet; +import java.util.List; + public class ContainsAndRegexBasedSearchRuleDescriber implements SearchDescriber { private final EnumSet searchFlags; diff --git a/src/main/java/org/jabref/gui/search/rules/describer/GrammarBasedSearchRuleDescriber.java b/src/main/java/org/jabref/gui/search/rules/describer/GrammarBasedSearchRuleDescriber.java index 9522e59377a..96e40d626e0 100644 --- a/src/main/java/org/jabref/gui/search/rules/describer/GrammarBasedSearchRuleDescriber.java +++ b/src/main/java/org/jabref/gui/search/rules/describer/GrammarBasedSearchRuleDescriber.java @@ -1,15 +1,8 @@ package org.jabref.gui.search.rules.describer; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; - import javafx.scene.text.Text; import javafx.scene.text.TextFlow; - +import org.antlr.v4.runtime.tree.ParseTree; import org.jabref.gui.util.TooltipTextUtil; import org.jabref.logic.l10n.Localization; import org.jabref.model.search.rules.GrammarBasedSearchRule; @@ -19,7 +12,8 @@ import org.jabref.search.SearchBaseVisitor; import org.jabref.search.SearchParser; -import org.antlr.v4.runtime.tree.ParseTree; +import java.util.*; +import java.util.regex.Pattern; public class GrammarBasedSearchRuleDescriber implements SearchDescriber { diff --git a/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseCommand.java b/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseCommand.java index 9a79e714a65..b4fa8f81cd0 100644 --- a/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseCommand.java +++ b/src/main/java/org/jabref/gui/shared/ConnectToSharedDatabaseCommand.java @@ -1,11 +1,10 @@ package org.jabref.gui.shared; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.actions.SimpleCommand; -import com.airhacks.afterburner.injection.Injector; - /** * Opens a shared database. */ diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml index a62c5a9e068..6d6adb936db 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialog.fxml @@ -1,18 +1,8 @@ - - - - - - - - + - - - - + { @FXML diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java index ac8547974f7..705deae2ac0 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java @@ -1,32 +1,12 @@ package org.jabref.gui.shared; -import java.io.UnsupportedEncodingException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.GeneralSecurityException; -import java.sql.SQLException; -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; - -import javax.swing.undo.UndoManager; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import com.tobiasdiez.easybind.EasyBind; +import de.saxsys.mvvmfx.utils.validation.*; +import javafx.beans.property.*; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; - -import org.jabref.gui.AbstractViewModel; -import org.jabref.gui.DialogService; -import org.jabref.gui.Globals; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.exporter.SaveDatabaseAction; import org.jabref.gui.help.HelpAction; import org.jabref.gui.util.FileDialogConfiguration; @@ -34,11 +14,7 @@ import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.help.HelpFile; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.shared.DBMSConnectionProperties; -import org.jabref.logic.shared.DBMSConnectionPropertiesBuilder; -import org.jabref.logic.shared.DBMSType; -import org.jabref.logic.shared.DatabaseLocation; -import org.jabref.logic.shared.DatabaseNotSupportedException; +import org.jabref.logic.shared.*; import org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException; import org.jabref.logic.shared.prefs.SharedDatabasePreferences; import org.jabref.logic.shared.security.Password; @@ -47,16 +23,19 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.tobiasdiez.easybind.EasyBind; -import de.saxsys.mvvmfx.utils.validation.CompositeValidator; -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.GeneralSecurityException; +import java.sql.SQLException; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; + public class SharedDatabaseLoginDialogViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(SharedDatabaseLoginDialogViewModel.class); diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java b/src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java index 5eaf3cdda1a..992f9c648ed 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java @@ -1,16 +1,10 @@ package org.jabref.gui.shared; -import java.sql.SQLException; -import java.util.Objects; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - +import com.google.common.eventbus.Subscribe; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.LibraryTab; @@ -23,11 +17,7 @@ import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; -import org.jabref.logic.shared.DBMSConnection; -import org.jabref.logic.shared.DBMSConnectionProperties; -import org.jabref.logic.shared.DBMSSynchronizer; -import org.jabref.logic.shared.DatabaseNotSupportedException; -import org.jabref.logic.shared.DatabaseSynchronizer; +import org.jabref.logic.shared.*; import org.jabref.logic.shared.event.ConnectionLostEvent; import org.jabref.logic.shared.event.SharedEntriesNotPresentEvent; import org.jabref.logic.shared.event.UpdateRefusedEvent; @@ -40,7 +30,10 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; -import com.google.common.eventbus.Subscribe; +import javax.swing.undo.UndoManager; +import java.sql.SQLException; +import java.util.Objects; +import java.util.Optional; public class SharedDatabaseUIManager { diff --git a/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java b/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java index d29251bc5dd..12fe2ea3a5a 100644 --- a/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java +++ b/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java @@ -1,7 +1,7 @@ package org.jabref.gui.sidepane; +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.control.Button; - import org.jabref.gui.DialogService; import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.groups.GroupModeViewModel; @@ -10,8 +10,6 @@ import org.jabref.gui.icon.IconTheme; import org.jabref.logic.l10n.Localization; -import com.tobiasdiez.easybind.EasyBind; - public class GroupsSidePaneComponent extends SidePaneComponent { private final GroupsPreferences groupsPreferences; private final DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/sidepane/SidePane.java b/src/main/java/org/jabref/gui/sidepane/SidePane.java index 4e9e852c737..961aa886fc7 100644 --- a/src/main/java/org/jabref/gui/sidepane/SidePane.java +++ b/src/main/java/org/jabref/gui/sidepane/SidePane.java @@ -1,15 +1,9 @@ package org.jabref.gui.sidepane; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.undo.UndoManager; - import javafx.beans.binding.Bindings; import javafx.beans.binding.BooleanBinding; import javafx.collections.ListChangeListener; import javafx.scene.layout.VBox; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTabContainer; import org.jabref.gui.StateManager; @@ -20,6 +14,10 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.HashMap; +import java.util.Map; + public class SidePane extends VBox { private final SidePaneViewModel viewModel; private final PreferencesService preferencesService; diff --git a/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java b/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java index bfd502bb3a4..49d3275f026 100644 --- a/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java +++ b/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java @@ -8,7 +8,6 @@ import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; - import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.groups.GroupTreeView; import org.jabref.gui.icon.IconTheme; diff --git a/src/main/java/org/jabref/gui/sidepane/SidePaneContentFactory.java b/src/main/java/org/jabref/gui/sidepane/SidePaneContentFactory.java index c284697b8eb..35ef37c3bbc 100644 --- a/src/main/java/org/jabref/gui/sidepane/SidePaneContentFactory.java +++ b/src/main/java/org/jabref/gui/sidepane/SidePaneContentFactory.java @@ -1,9 +1,6 @@ package org.jabref.gui.sidepane; -import javax.swing.undo.UndoManager; - import javafx.scene.Node; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTabContainer; import org.jabref.gui.StateManager; @@ -16,6 +13,8 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; + public class SidePaneContentFactory { private final LibraryTabContainer tabContainer; private final PreferencesService preferences; diff --git a/src/main/java/org/jabref/gui/sidepane/SidePaneViewModel.java b/src/main/java/org/jabref/gui/sidepane/SidePaneViewModel.java index eb12066b3ce..9faa7e9024d 100644 --- a/src/main/java/org/jabref/gui/sidepane/SidePaneViewModel.java +++ b/src/main/java/org/jabref/gui/sidepane/SidePaneViewModel.java @@ -1,18 +1,7 @@ package org.jabref.gui.sidepane; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.IntStream; - -import javax.swing.undo.UndoManager; - import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTabContainer; @@ -24,10 +13,13 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SidePanePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.*; +import java.util.stream.IntStream; + public class SidePaneViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(SidePaneViewModel.class); diff --git a/src/main/java/org/jabref/gui/slr/EditExistingStudyAction.java b/src/main/java/org/jabref/gui/slr/EditExistingStudyAction.java index ab123b1729d..3c6dcc6b066 100644 --- a/src/main/java/org/jabref/gui/slr/EditExistingStudyAction.java +++ b/src/main/java/org/jabref/gui/slr/EditExistingStudyAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.slr; -import java.io.IOException; -import java.nio.file.Path; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; @@ -12,10 +9,12 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.study.Study; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; + public class EditExistingStudyAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(EditExistingStudyAction.class); diff --git a/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java b/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java index cf66079cf26..6ed7e7e4c0f 100644 --- a/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java +++ b/src/main/java/org/jabref/gui/slr/ExistingStudySearchAction.java @@ -1,8 +1,6 @@ package org.jabref.gui.slr; -import java.io.IOException; -import java.nio.file.Path; - +import org.eclipse.jgit.api.errors.GitAPIException; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -19,11 +17,12 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import org.eclipse.jgit.api.errors.GitAPIException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; + public class ExistingStudySearchAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(ExistingStudySearchAction.class); @@ -127,7 +126,7 @@ protected void crawl() { BackgroundTask.wrap(() -> { crawler.performCrawl(); return 0; // Return any value to make this a callable instead of a runnable. This allows throwing - // exceptions. + // exceptions. }) .onFailure(e -> { LOGGER.error("Error during persistence of crawling results."); diff --git a/src/main/java/org/jabref/gui/slr/ManageStudyDefinition.fxml b/src/main/java/org/jabref/gui/slr/ManageStudyDefinition.fxml index cc2297a0fcf..7cf58f999a8 100644 --- a/src/main/java/org/jabref/gui/slr/ManageStudyDefinition.fxml +++ b/src/main/java/org/jabref/gui/slr/ManageStudyDefinition.fxml @@ -1,23 +1,8 @@ - - - - - - - - - - - - - - - - - - + + + diff --git a/src/main/java/org/jabref/gui/slr/StudyCatalogItem.java b/src/main/java/org/jabref/gui/slr/StudyCatalogItem.java index 41713fc9621..84e727e28ac 100644 --- a/src/main/java/org/jabref/gui/slr/StudyCatalogItem.java +++ b/src/main/java/org/jabref/gui/slr/StudyCatalogItem.java @@ -1,14 +1,13 @@ package org.jabref.gui.slr; -import java.util.Objects; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; - import org.jabref.model.study.StudyDatabase; +import java.util.Objects; + /** * View representation of {@link StudyDatabase} */ diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldAction.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldAction.java index b20a8f6f96b..141f01d2204 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldAction.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldAction.java @@ -1,12 +1,5 @@ package org.jabref.gui.specialfields; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -20,10 +13,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.SpecialField; import org.jabref.preferences.PreferencesService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.UndoManager; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class SpecialFieldAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(SpecialFieldAction.class); diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldMenuItemFactory.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldMenuItemFactory.java index 4fda3e91870..e8f0af1ad7a 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldMenuItemFactory.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldMenuItemFactory.java @@ -1,12 +1,8 @@ package org.jabref.gui.specialfields; -import java.util.function.Function; - -import javax.swing.undo.UndoManager; - +import de.saxsys.mvvmfx.utils.commands.Command; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -15,7 +11,8 @@ import org.jabref.model.entry.field.SpecialFieldValue; import org.jabref.preferences.PreferencesService; -import de.saxsys.mvvmfx.utils.commands.Command; +import javax.swing.undo.UndoManager; +import java.util.function.Function; public class SpecialFieldMenuItemFactory { public static MenuItem getSpecialFieldSingleItem( diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldValueViewModel.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldValueViewModel.java index e2d3ffda9a6..c7e0ee29c83 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldValueViewModel.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldValueViewModel.java @@ -1,14 +1,14 @@ package org.jabref.gui.specialfields; -import java.util.Objects; -import java.util.Optional; - import org.jabref.gui.actions.Action; import org.jabref.gui.actions.StandardActions; import org.jabref.gui.icon.JabRefIcon; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.SpecialFieldValue; +import java.util.Objects; +import java.util.Optional; + public class SpecialFieldValueViewModel { private final SpecialFieldValue value; diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldViewModel.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldViewModel.java index 0e463bca616..228047e68b1 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldViewModel.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldViewModel.java @@ -1,12 +1,5 @@ package org.jabref.gui.specialfields; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -21,6 +14,12 @@ import org.jabref.model.entry.field.SpecialFieldValue; import org.jabref.preferences.PreferencesService; +import javax.swing.undo.UndoManager; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + public class SpecialFieldViewModel { private final SpecialField field; diff --git a/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java b/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java index d32065e31da..9a06b5ee0bd 100644 --- a/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java +++ b/src/main/java/org/jabref/gui/texparser/CitationsDisplay.java @@ -1,9 +1,5 @@ package org.jabref.gui.texparser; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.Node; @@ -15,12 +11,15 @@ import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; - import org.jabref.gui.icon.IconTheme; import org.jabref.gui.util.ViewModelListCellFactory; import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.texparser.Citation; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + public class CitationsDisplay extends ListView { private final ObjectProperty basePath; diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexAction.java b/src/main/java/org/jabref/gui/texparser/ParseLatexAction.java index 637feed20fb..265f31b9126 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexAction.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexAction.java @@ -1,13 +1,12 @@ package org.jabref.gui.texparser; +import com.airhacks.afterburner.injection.Injector; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.actions.ActionHelper; import org.jabref.gui.actions.SimpleCommand; import org.jabref.model.database.BibDatabaseContext; -import com.airhacks.afterburner.injection.Injector; - public class ParseLatexAction extends SimpleCommand { private final StateManager stateManager; diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexDialog.fxml b/src/main/java/org/jabref/gui/texparser/ParseLatexDialog.fxml index d45cd77b916..eb40a94019f 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexDialog.fxml +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexDialog.fxml @@ -1,13 +1,7 @@ - - - - - - - - + + { private final BibDatabaseContext databaseContext; diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexDialogViewModel.java b/src/main/java/org/jabref/gui/texparser/ParseLatexDialogViewModel.java index 7bf425e5e42..fff9a21b2f0 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexDialogViewModel.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexDialogViewModel.java @@ -1,26 +1,13 @@ package org.jabref.gui.texparser; -import java.io.IOException; -import java.nio.file.FileSystemException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyListWrapper; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; +import de.saxsys.mvvmfx.utils.validation.ValidationMessage; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import de.saxsys.mvvmfx.utils.validation.Validator; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.control.TreeItem; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.util.BackgroundTask; @@ -34,14 +21,19 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator; -import de.saxsys.mvvmfx.utils.validation.ValidationMessage; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; -import de.saxsys.mvvmfx.utils.validation.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.FileSystemException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class ParseLatexDialogViewModel extends AbstractViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(ParseLatexDialogViewModel.class); diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexResult.fxml b/src/main/java/org/jabref/gui/texparser/ParseLatexResult.fxml index d0bdddf6fd9..78154b3bc76 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexResult.fxml +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexResult.fxml @@ -1,9 +1,6 @@ - - - - + diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java b/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java index 09b8cbb48b0..26ab7440251 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java @@ -1,13 +1,13 @@ package org.jabref.gui.texparser; -import java.nio.file.Path; - +import com.airhacks.afterburner.views.ViewLoader; +import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.ListView; import javafx.scene.text.Text; - import org.jabref.gui.theme.ThemeManager; import org.jabref.gui.util.BaseDialog; import org.jabref.gui.util.ControlHelper; @@ -16,9 +16,7 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.texparser.LatexBibEntriesResolverResult; -import com.airhacks.afterburner.views.ViewLoader; -import com.tobiasdiez.easybind.EasyBind; -import jakarta.inject.Inject; +import java.nio.file.Path; public class ParseLatexResultView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexResultViewModel.java b/src/main/java/org/jabref/gui/texparser/ParseLatexResultViewModel.java index 8c41d852cbd..1e1249aa1cc 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexResultViewModel.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexResultViewModel.java @@ -1,16 +1,11 @@ package org.jabref.gui.texparser; -import java.util.Collection; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - +import com.airhacks.afterburner.injection.Injector; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ReadOnlyListWrapper; import javafx.beans.property.SimpleBooleanProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; import org.jabref.gui.importer.ImportEntriesDialog; @@ -21,7 +16,10 @@ import org.jabref.model.texparser.Citation; import org.jabref.model.texparser.LatexBibEntriesResolverResult; -import com.airhacks.afterburner.injection.Injector; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; public class ParseLatexResultViewModel extends AbstractViewModel { diff --git a/src/main/java/org/jabref/gui/texparser/ReferenceViewModel.java b/src/main/java/org/jabref/gui/texparser/ReferenceViewModel.java index d63ec551cbb..77d4c3e6668 100644 --- a/src/main/java/org/jabref/gui/texparser/ReferenceViewModel.java +++ b/src/main/java/org/jabref/gui/texparser/ReferenceViewModel.java @@ -1,13 +1,12 @@ package org.jabref.gui.texparser; -import java.util.Collection; - import javafx.beans.property.ReadOnlyListWrapper; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.model.texparser.Citation; +import java.util.Collection; + public class ReferenceViewModel { private final String entry; diff --git a/src/main/java/org/jabref/gui/theme/StyleSheet.java b/src/main/java/org/jabref/gui/theme/StyleSheet.java index c120f17e877..d6b53c6fac6 100644 --- a/src/main/java/org/jabref/gui/theme/StyleSheet.java +++ b/src/main/java/org/jabref/gui/theme/StyleSheet.java @@ -1,5 +1,9 @@ package org.jabref.gui.theme; +import org.jabref.gui.JabRefFrame; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; @@ -7,11 +11,6 @@ import java.nio.file.Path; import java.util.Optional; -import org.jabref.gui.JabRefFrame; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - abstract class StyleSheet { static final String DATA_URL_PREFIX = "data:text/css;charset=utf-8;base64,"; diff --git a/src/main/java/org/jabref/gui/theme/StyleSheetFile.java b/src/main/java/org/jabref/gui/theme/StyleSheetFile.java index 952e3a7da63..448aaaffc1d 100644 --- a/src/main/java/org/jabref/gui/theme/StyleSheetFile.java +++ b/src/main/java/org/jabref/gui/theme/StyleSheetFile.java @@ -1,5 +1,9 @@ package org.jabref.gui.theme; +import com.google.common.base.Strings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -11,10 +15,6 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; -import com.google.common.base.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - final class StyleSheetFile extends StyleSheet { /** diff --git a/src/main/java/org/jabref/gui/theme/ThemeManager.java b/src/main/java/org/jabref/gui/theme/ThemeManager.java index 383260face2..12afd9e786b 100644 --- a/src/main/java/org/jabref/gui/theme/ThemeManager.java +++ b/src/main/java/org/jabref/gui/theme/ThemeManager.java @@ -1,29 +1,22 @@ package org.jabref.gui.theme; -import java.io.IOException; -import java.net.URL; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.WeakHashMap; -import java.util.function.Consumer; - +import com.jthemedetecor.OsThemeDetector; +import com.tobiasdiez.easybind.EasyBind; import javafx.scene.Scene; import javafx.scene.web.WebEngine; - import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.model.util.FileUpdateListener; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.WorkspacePreferences; - -import com.jthemedetecor.OsThemeDetector; -import com.tobiasdiez.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Path; +import java.util.*; +import java.util.function.Consumer; + /** * Installs and manages style files and provides live reloading. JabRef provides two inbuilt themes and a user * customizable one: Light, Dark and Custom. The Light theme is basically the base.css theme. Every other theme is diff --git a/src/main/java/org/jabref/gui/undo/AbstractUndoableJabRefEdit.java b/src/main/java/org/jabref/gui/undo/AbstractUndoableJabRefEdit.java index d5f4fa0663f..f0c8e362fc6 100644 --- a/src/main/java/org/jabref/gui/undo/AbstractUndoableJabRefEdit.java +++ b/src/main/java/org/jabref/gui/undo/AbstractUndoableJabRefEdit.java @@ -1,9 +1,9 @@ package org.jabref.gui.undo; -import javax.swing.undo.AbstractUndoableEdit; - import org.jabref.logic.l10n.Localization; +import javax.swing.undo.AbstractUndoableEdit; + public class AbstractUndoableJabRefEdit extends AbstractUndoableEdit { @Override diff --git a/src/main/java/org/jabref/gui/undo/CountingUndoManager.java b/src/main/java/org/jabref/gui/undo/CountingUndoManager.java index f42d0eeb7cb..047ddfad2fd 100644 --- a/src/main/java/org/jabref/gui/undo/CountingUndoManager.java +++ b/src/main/java/org/jabref/gui/undo/CountingUndoManager.java @@ -1,14 +1,13 @@ package org.jabref.gui.undo; -import javax.swing.undo.CannotUndoException; -import javax.swing.undo.UndoManager; -import javax.swing.undo.UndoableEdit; - +import com.google.common.eventbus.EventBus; import org.jabref.logic.l10n.Localization; import org.jabref.logic.undo.AddUndoableActionEvent; import org.jabref.logic.undo.UndoRedoEvent; -import com.google.common.eventbus.EventBus; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.UndoManager; +import javax.swing.undo.UndoableEdit; public class CountingUndoManager extends UndoManager { diff --git a/src/main/java/org/jabref/gui/undo/NamedCompound.java b/src/main/java/org/jabref/gui/undo/NamedCompound.java index 55be19a96e3..afce94e5545 100644 --- a/src/main/java/org/jabref/gui/undo/NamedCompound.java +++ b/src/main/java/org/jabref/gui/undo/NamedCompound.java @@ -1,10 +1,10 @@ package org.jabref.gui.undo; +import org.jabref.logic.l10n.Localization; + import javax.swing.undo.CompoundEdit; import javax.swing.undo.UndoableEdit; -import org.jabref.logic.l10n.Localization; - public class NamedCompound extends CompoundEdit { private final String name; diff --git a/src/main/java/org/jabref/gui/undo/UndoRedoAction.java b/src/main/java/org/jabref/gui/undo/UndoRedoAction.java index e5b01e98503..fbe796a6c41 100644 --- a/src/main/java/org/jabref/gui/undo/UndoRedoAction.java +++ b/src/main/java/org/jabref/gui/undo/UndoRedoAction.java @@ -1,8 +1,5 @@ package org.jabref.gui.undo; -import javax.swing.undo.CannotRedoException; -import javax.swing.undo.CannotUndoException; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.LibraryTab; @@ -11,10 +8,12 @@ import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.actions.StandardActions; import org.jabref.logic.l10n.Localization; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.CannotUndoException; + public class UndoRedoAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(UndoRedoAction.class); diff --git a/src/main/java/org/jabref/gui/undo/UndoableFieldChange.java b/src/main/java/org/jabref/gui/undo/UndoableFieldChange.java index e792f5b8f6a..37227ce7be8 100644 --- a/src/main/java/org/jabref/gui/undo/UndoableFieldChange.java +++ b/src/main/java/org/jabref/gui/undo/UndoableFieldChange.java @@ -5,7 +5,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java b/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java index 8c84d5f7363..b44543444d2 100644 --- a/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java +++ b/src/main/java/org/jabref/gui/undo/UndoableInsertEntries.java @@ -1,16 +1,15 @@ package org.jabref.gui.undo; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; +import java.util.List; + /** * This class represents the removal of entries. The constructor needs * references to the database, entries, and a boolean marked true if the undo diff --git a/src/main/java/org/jabref/gui/undo/UndoableInsertString.java b/src/main/java/org/jabref/gui/undo/UndoableInsertString.java index 6485861abbe..0f0ef17a108 100644 --- a/src/main/java/org/jabref/gui/undo/UndoableInsertString.java +++ b/src/main/java/org/jabref/gui/undo/UndoableInsertString.java @@ -5,7 +5,6 @@ import org.jabref.model.database.KeyCollisionException; import org.jabref.model.entry.BibtexString; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/undo/UndoableRemoveEntries.java b/src/main/java/org/jabref/gui/undo/UndoableRemoveEntries.java index ccf5a37d795..93cb903b648 100644 --- a/src/main/java/org/jabref/gui/undo/UndoableRemoveEntries.java +++ b/src/main/java/org/jabref/gui/undo/UndoableRemoveEntries.java @@ -1,17 +1,16 @@ package org.jabref.gui.undo; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntriesEventSource; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; +import java.util.List; + /** * This class represents the removal of entries. The constructor needs * references to the database, the entries, and the map of open entry editors. diff --git a/src/main/java/org/jabref/gui/undo/UndoableRemoveString.java b/src/main/java/org/jabref/gui/undo/UndoableRemoveString.java index 2c086ed3cf0..cca522be9c3 100644 --- a/src/main/java/org/jabref/gui/undo/UndoableRemoveString.java +++ b/src/main/java/org/jabref/gui/undo/UndoableRemoveString.java @@ -5,7 +5,6 @@ import org.jabref.model.database.KeyCollisionException; import org.jabref.model.entry.BibtexString; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/util/BackgroundTask.java b/src/main/java/org/jabref/gui/util/BackgroundTask.java index 5f75ff8c949..1691617c66e 100644 --- a/src/main/java/org/jabref/gui/util/BackgroundTask.java +++ b/src/main/java/org/jabref/gui/util/BackgroundTask.java @@ -1,27 +1,18 @@ package org.jabref.gui.util; -import java.util.concurrent.Callable; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; -import java.util.function.Function; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.DoubleProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleDoubleProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import com.google.common.collect.ImmutableMap; +import com.tobiasdiez.easybind.EasyBind; +import javafx.beans.property.*; import javafx.concurrent.Task; import javafx.scene.Node; - import org.jabref.gui.icon.IconTheme; import org.jabref.logic.l10n.Localization; -import com.google.common.collect.ImmutableMap; -import com.tobiasdiez.easybind.EasyBind; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import java.util.function.Function; /** * This class is essentially a wrapper around {@link Task}. diff --git a/src/main/java/org/jabref/gui/util/BaseDialog.java b/src/main/java/org/jabref/gui/util/BaseDialog.java index ced4706510d..653b8578427 100644 --- a/src/main/java/org/jabref/gui/util/BaseDialog.java +++ b/src/main/java/org/jabref/gui/util/BaseDialog.java @@ -1,19 +1,18 @@ package org.jabref.gui.util; -import java.util.Optional; - import javafx.scene.control.Button; import javafx.scene.control.ButtonType; import javafx.scene.control.Dialog; import javafx.scene.image.Image; import javafx.scene.input.KeyCode; import javafx.stage.Stage; - import org.jabref.gui.Globals; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.keyboard.KeyBindingRepository; +import java.util.Optional; + public class BaseDialog extends Dialog implements org.jabref.gui.Dialog { protected BaseDialog() { diff --git a/src/main/java/org/jabref/gui/util/BindingsHelper.java b/src/main/java/org/jabref/gui/util/BindingsHelper.java index c2a3caa280b..5de7eb78bbe 100644 --- a/src/main/java/org/jabref/gui/util/BindingsHelper.java +++ b/src/main/java/org/jabref/gui/util/BindingsHelper.java @@ -1,10 +1,8 @@ package org.jabref.gui.util; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; -import java.util.function.Function; - +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.PreboundBinding; +import com.tobiasdiez.easybind.Subscription; import javafx.beans.binding.BooleanBinding; import javafx.beans.binding.ObjectBinding; import javafx.beans.binding.StringBinding; @@ -12,17 +10,14 @@ import javafx.beans.property.Property; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; -import javafx.collections.FXCollections; -import javafx.collections.ListChangeListener; -import javafx.collections.MapChangeListener; -import javafx.collections.ObservableList; -import javafx.collections.ObservableMap; +import javafx.collections.*; import javafx.css.PseudoClass; import javafx.scene.Node; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.PreboundBinding; -import com.tobiasdiez.easybind.Subscription; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; /** * Helper methods for javafx binding. Some methods are taken from https://bugs.openjdk.java.net/browse/JDK-8134679 diff --git a/src/main/java/org/jabref/gui/util/ControlHelper.java b/src/main/java/org/jabref/gui/util/ControlHelper.java index 7c724f92792..88453f9c39f 100644 --- a/src/main/java/org/jabref/gui/util/ControlHelper.java +++ b/src/main/java/org/jabref/gui/util/ControlHelper.java @@ -1,19 +1,15 @@ package org.jabref.gui.util; -import java.util.function.Consumer; -import java.util.function.UnaryOperator; - import javafx.css.PseudoClass; import javafx.event.ActionEvent; import javafx.event.Event; import javafx.scene.Parent; -import javafx.scene.control.Button; -import javafx.scene.control.ButtonType; -import javafx.scene.control.Cell; -import javafx.scene.control.DialogPane; -import javafx.scene.control.TextFormatter; +import javafx.scene.control.*; import javafx.scene.input.DragEvent; +import java.util.function.Consumer; +import java.util.function.UnaryOperator; + public class ControlHelper { // Pseudo-classes for drag and drop diff --git a/src/main/java/org/jabref/gui/util/CurrentThreadTaskExecutor.java b/src/main/java/org/jabref/gui/util/CurrentThreadTaskExecutor.java index e615225f715..15738ab9984 100644 --- a/src/main/java/org/jabref/gui/util/CurrentThreadTaskExecutor.java +++ b/src/main/java/org/jabref/gui/util/CurrentThreadTaskExecutor.java @@ -1,5 +1,10 @@ package org.jabref.gui.util; +import javafx.concurrent.Task; +import org.jabref.logic.util.DelayTaskThrottler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.WeakHashMap; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -7,13 +12,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import javafx.concurrent.Task; - -import org.jabref.logic.util.DelayTaskThrottler; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Implementation of {@link TaskExecutor} that runs every task on the current thread, i.e. in a sequential order. This * class is not designed to be used in production but should make code involving asynchronous operations deterministic diff --git a/src/main/java/org/jabref/gui/util/CustomLocalDragboard.java b/src/main/java/org/jabref/gui/util/CustomLocalDragboard.java index 18c98c82fda..ed7be44e7c5 100644 --- a/src/main/java/org/jabref/gui/util/CustomLocalDragboard.java +++ b/src/main/java/org/jabref/gui/util/CustomLocalDragboard.java @@ -1,15 +1,15 @@ package org.jabref.gui.util; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.jabref.gui.DragAndDropDataFormats; import org.jabref.gui.StateManager; import org.jabref.logic.preview.PreviewLayout; import org.jabref.model.entry.BibEntry; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Placeholder class for a custom generic type safe dragboard to be used in drag and drop, does not depend on serialization * Don't use this class directly. Use the instance provided in {@link StateManager#getLocalDragboard()} diff --git a/src/main/java/org/jabref/gui/util/CustomRatingSkin.java b/src/main/java/org/jabref/gui/util/CustomRatingSkin.java index 96e6e8d75d5..4ae1849c087 100644 --- a/src/main/java/org/jabref/gui/util/CustomRatingSkin.java +++ b/src/main/java/org/jabref/gui/util/CustomRatingSkin.java @@ -1,11 +1,9 @@ package org.jabref.gui.util; -import javafx.scene.Node; - -import org.jabref.gui.icon.IconTheme; - import impl.org.controlsfx.skin.RatingSkin; +import javafx.scene.Node; import org.controlsfx.control.Rating; +import org.jabref.gui.icon.IconTheme; public class CustomRatingSkin extends RatingSkin { public CustomRatingSkin(Rating control) { diff --git a/src/main/java/org/jabref/gui/util/CustomTitledPaneSkin.java b/src/main/java/org/jabref/gui/util/CustomTitledPaneSkin.java index de375f13b0a..9dd14e546bd 100644 --- a/src/main/java/org/jabref/gui/util/CustomTitledPaneSkin.java +++ b/src/main/java/org/jabref/gui/util/CustomTitledPaneSkin.java @@ -1,10 +1,5 @@ package org.jabref.gui.util; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - import javafx.beans.binding.Bindings; import javafx.beans.binding.DoubleBinding; import javafx.beans.property.ObjectProperty; @@ -21,6 +16,11 @@ import javafx.scene.text.Text; import javafx.scene.transform.Rotate; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + import static javafx.css.StyleConverter.getEnumConverter; /** diff --git a/src/main/java/org/jabref/gui/util/DefaultFileUpdateMonitor.java b/src/main/java/org/jabref/gui/util/DefaultFileUpdateMonitor.java index 0e0fc705bb3..3cf87a32ead 100644 --- a/src/main/java/org/jabref/gui/util/DefaultFileUpdateMonitor.java +++ b/src/main/java/org/jabref/gui/util/DefaultFileUpdateMonitor.java @@ -1,27 +1,20 @@ package org.jabref.gui.util; -import java.io.IOException; -import java.nio.file.ClosedWatchServiceException; -import java.nio.file.FileSystems; -import java.nio.file.Path; -import java.nio.file.StandardWatchEventKinds; -import java.nio.file.WatchEvent; -import java.nio.file.WatchKey; -import java.nio.file.WatchService; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; - +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; import org.jabref.logic.JabRefException; import org.jabref.logic.WatchServiceUnavailableException; import org.jabref.model.util.FileUpdateListener; import org.jabref.model.util.FileUpdateMonitor; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.*; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; + /** * This class monitors a set of files for changes. Upon detecting a change it notifies the registered {@link * FileUpdateListener}s. diff --git a/src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java b/src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java index c96c4b0e5b9..4d2f30dbeaa 100644 --- a/src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java +++ b/src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java @@ -1,27 +1,17 @@ package org.jabref.gui.util; -import java.util.Objects; -import java.util.WeakHashMap; -import java.util.concurrent.Callable; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.FutureTask; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; - import javafx.application.Platform; import javafx.concurrent.Task; - import org.jabref.gui.StateManager; import org.jabref.logic.util.DelayTaskThrottler; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Objects; +import java.util.WeakHashMap; +import java.util.concurrent.*; +import java.util.function.Consumer; + /** * A very simple implementation of the {@link TaskExecutor} interface. * Every submitted task is invoked in a separate thread. diff --git a/src/main/java/org/jabref/gui/util/FieldsUtil.java b/src/main/java/org/jabref/gui/util/FieldsUtil.java index 204e1e56fb4..ca1ca26a6e4 100644 --- a/src/main/java/org/jabref/gui/util/FieldsUtil.java +++ b/src/main/java/org/jabref/gui/util/FieldsUtil.java @@ -1,16 +1,10 @@ package org.jabref.gui.util; import javafx.util.StringConverter; - import org.jabref.gui.Globals; import org.jabref.gui.specialfields.SpecialFieldViewModel; import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.entry.field.IEEEField; -import org.jabref.model.entry.field.InternalField; -import org.jabref.model.entry.field.SpecialField; -import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.field.*; public class FieldsUtil { diff --git a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java index 077877ff71a..f5be375f956 100644 --- a/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java +++ b/src/main/java/org/jabref/gui/util/FileDialogConfiguration.java @@ -1,5 +1,8 @@ package org.jabref.gui.util; +import javafx.stage.FileChooser; +import org.jabref.logic.util.FileType; + import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -8,10 +11,6 @@ import java.util.Optional; import java.util.stream.Stream; -import javafx.stage.FileChooser; - -import org.jabref.logic.util.FileType; - public class FileDialogConfiguration { private final List extensionFilters; @@ -67,9 +66,8 @@ 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 if (!Files.isDirectory(directory)) { diff --git a/src/main/java/org/jabref/gui/util/FileFilterConverter.java b/src/main/java/org/jabref/gui/util/FileFilterConverter.java index 78ba8dc1009..df6ef285838 100644 --- a/src/main/java/org/jabref/gui/util/FileFilterConverter.java +++ b/src/main/java/org/jabref/gui/util/FileFilterConverter.java @@ -1,5 +1,13 @@ package org.jabref.gui.util; +import javafx.stage.FileChooser; +import org.jabref.logic.exporter.Exporter; +import org.jabref.logic.importer.Importer; +import org.jabref.logic.l10n.Localization; +import org.jabref.logic.util.FileType; +import org.jabref.logic.util.io.FileUtil; +import org.jabref.model.strings.StringUtil; + import java.io.FileFilter; import java.io.IOException; import java.nio.file.DirectoryStream.Filter; @@ -10,15 +18,6 @@ import java.util.SortedSet; import java.util.stream.Collectors; -import javafx.stage.FileChooser; - -import org.jabref.logic.exporter.Exporter; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.FileType; -import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.strings.StringUtil; - public class FileFilterConverter { public static FileChooser.ExtensionFilter ANY_FILE = diff --git a/src/main/java/org/jabref/gui/util/FileNodeViewModel.java b/src/main/java/org/jabref/gui/util/FileNodeViewModel.java index cf917686577..5fa8ca04ceb 100644 --- a/src/main/java/org/jabref/gui/util/FileNodeViewModel.java +++ b/src/main/java/org/jabref/gui/util/FileNodeViewModel.java @@ -1,5 +1,12 @@ package org.jabref.gui.util; +import javafx.beans.property.ReadOnlyListWrapper; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import org.jabref.logic.l10n.Localization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -9,15 +16,6 @@ import java.time.format.DateTimeFormatter; import java.util.Objects; -import javafx.beans.property.ReadOnlyListWrapper; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; - -import org.jabref.logic.l10n.Localization; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FileNodeViewModel { private static final Logger LOGGER = LoggerFactory.getLogger(FileNodeViewModel.class); diff --git a/src/main/java/org/jabref/gui/util/IconValidationDecorator.java b/src/main/java/org/jabref/gui/util/IconValidationDecorator.java index 2608c5c0663..a0ba421053f 100644 --- a/src/main/java/org/jabref/gui/util/IconValidationDecorator.java +++ b/src/main/java/org/jabref/gui/util/IconValidationDecorator.java @@ -1,20 +1,18 @@ package org.jabref.gui.util; -import java.util.Collection; -import java.util.Collections; - import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.control.Tooltip; - -import org.jabref.gui.icon.IconTheme; - import org.controlsfx.control.decoration.Decoration; import org.controlsfx.control.decoration.GraphicDecoration; import org.controlsfx.validation.Severity; import org.controlsfx.validation.ValidationMessage; import org.controlsfx.validation.decoration.GraphicValidationDecoration; +import org.jabref.gui.icon.IconTheme; + +import java.util.Collection; +import java.util.Collections; /** * This class is similar to {@link GraphicValidationDecoration} but with a different style and font-based icon. diff --git a/src/main/java/org/jabref/gui/util/JabRefResourceLocator.java b/src/main/java/org/jabref/gui/util/JabRefResourceLocator.java index 03d4a2bfbe1..ca483c01985 100644 --- a/src/main/java/org/jabref/gui/util/JabRefResourceLocator.java +++ b/src/main/java/org/jabref/gui/util/JabRefResourceLocator.java @@ -1,13 +1,12 @@ package org.jabref.gui.util; -import java.util.ResourceBundle; - -import org.jabref.logic.l10n.Localization; - import com.airhacks.afterburner.views.ResourceLocator; +import org.jabref.logic.l10n.Localization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ResourceBundle; + public class JabRefResourceLocator implements ResourceLocator { private static final Logger LOGGER = LoggerFactory.getLogger(JabRefResourceLocator.class); diff --git a/src/main/java/org/jabref/gui/util/OnlyIntegerFormatter.java b/src/main/java/org/jabref/gui/util/OnlyIntegerFormatter.java index e16db338060..5b134c352b2 100644 --- a/src/main/java/org/jabref/gui/util/OnlyIntegerFormatter.java +++ b/src/main/java/org/jabref/gui/util/OnlyIntegerFormatter.java @@ -1,11 +1,11 @@ package org.jabref.gui.util; -import java.util.function.UnaryOperator; -import java.util.regex.Pattern; - import javafx.scene.control.TextFormatter; import javafx.util.converter.IntegerStringConverter; +import java.util.function.UnaryOperator; +import java.util.regex.Pattern; + /** * Formatter that only accepts integer. *

diff --git a/src/main/java/org/jabref/gui/util/OptionalObjectProperty.java b/src/main/java/org/jabref/gui/util/OptionalObjectProperty.java index a52d5654732..91b80764f9b 100644 --- a/src/main/java/org/jabref/gui/util/OptionalObjectProperty.java +++ b/src/main/java/org/jabref/gui/util/OptionalObjectProperty.java @@ -1,12 +1,11 @@ package org.jabref.gui.util; -import java.util.Optional; - +import com.tobiasdiez.easybind.PreboundBinding; import javafx.beans.binding.BooleanExpression; import javafx.beans.binding.ObjectBinding; import javafx.beans.property.SimpleObjectProperty; -import com.tobiasdiez.easybind.PreboundBinding; +import java.util.Optional; /** * Similar to {@link com.tobiasdiez.easybind.monadic.MonadicObservableValue} diff --git a/src/main/java/org/jabref/gui/util/OptionalValueTableCellFactory.java b/src/main/java/org/jabref/gui/util/OptionalValueTableCellFactory.java index 2232561583b..057c3216716 100644 --- a/src/main/java/org/jabref/gui/util/OptionalValueTableCellFactory.java +++ b/src/main/java/org/jabref/gui/util/OptionalValueTableCellFactory.java @@ -1,11 +1,11 @@ package org.jabref.gui.util; -import java.util.Optional; -import java.util.function.BiFunction; - import javafx.scene.Node; import javafx.scene.control.TableCell; +import java.util.Optional; +import java.util.function.BiFunction; + /** * Constructs a {@link TableCell} based on an optional value of the cell and a bunch of specified converter methods. * diff --git a/src/main/java/org/jabref/gui/util/RecursiveTreeItem.java b/src/main/java/org/jabref/gui/util/RecursiveTreeItem.java index 2e4f43446ca..e46ce0a14bf 100644 --- a/src/main/java/org/jabref/gui/util/RecursiveTreeItem.java +++ b/src/main/java/org/jabref/gui/util/RecursiveTreeItem.java @@ -1,7 +1,6 @@ package org.jabref.gui.util; -import java.util.function.Predicate; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.binding.Bindings; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; @@ -13,7 +12,7 @@ import javafx.scene.control.CheckBoxTreeItem; import javafx.util.Callback; -import com.tobiasdiez.easybind.EasyBind; +import java.util.function.Predicate; /** * Taken from https://gist.github.com/lestard/011e9ed4433f9eb791a8 diff --git a/src/main/java/org/jabref/gui/util/StreamGobbler.java b/src/main/java/org/jabref/gui/util/StreamGobbler.java index b2131968f87..6ede45f2f71 100644 --- a/src/main/java/org/jabref/gui/util/StreamGobbler.java +++ b/src/main/java/org/jabref/gui/util/StreamGobbler.java @@ -1,14 +1,14 @@ package org.jabref.gui.util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.function.Consumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class StreamGobbler implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(StreamGobbler.class); diff --git a/src/main/java/org/jabref/gui/util/TaskExecutor.java b/src/main/java/org/jabref/gui/util/TaskExecutor.java index e08d858a0cc..d7a138e99ec 100644 --- a/src/main/java/org/jabref/gui/util/TaskExecutor.java +++ b/src/main/java/org/jabref/gui/util/TaskExecutor.java @@ -1,12 +1,11 @@ package org.jabref.gui.util; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - import javafx.concurrent.Task; - import org.jabref.logic.util.DelayTaskThrottler; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + /** * An object that executes submitted {@link Task}s. This * interface provides a way of decoupling task submission from the diff --git a/src/main/java/org/jabref/gui/util/TextFlowLimited.java b/src/main/java/org/jabref/gui/util/TextFlowLimited.java index 229e0da3a15..cf1ff13b1b5 100644 --- a/src/main/java/org/jabref/gui/util/TextFlowLimited.java +++ b/src/main/java/org/jabref/gui/util/TextFlowLimited.java @@ -10,7 +10,6 @@ import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.util.Duration; - import org.jabref.logic.l10n.Localization; public class TextFlowLimited extends TextFlow { diff --git a/src/main/java/org/jabref/gui/util/TooltipTextUtil.java b/src/main/java/org/jabref/gui/util/TooltipTextUtil.java index bc0b78c2cb1..62299aaf5a3 100644 --- a/src/main/java/org/jabref/gui/util/TooltipTextUtil.java +++ b/src/main/java/org/jabref/gui/util/TooltipTextUtil.java @@ -1,13 +1,13 @@ package org.jabref.gui.util; +import javafx.scene.text.Text; + import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javafx.scene.text.Text; - /** * Utility class with static methods for javafx {@link Text} objects */ diff --git a/src/main/java/org/jabref/gui/util/UiThreadList.java b/src/main/java/org/jabref/gui/util/UiThreadList.java index 1e2f582a578..25ca5dcb22b 100644 --- a/src/main/java/org/jabref/gui/util/UiThreadList.java +++ b/src/main/java/org/jabref/gui/util/UiThreadList.java @@ -1,15 +1,14 @@ package org.jabref.gui.util; -import java.util.concurrent.CountDownLatch; - import javafx.application.Platform; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; import javafx.collections.transformation.TransformationList; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.concurrent.CountDownLatch; + class UiThreadList extends TransformationList { private static final Logger LOGGER = LoggerFactory.getLogger(UiThreadList.class); diff --git a/src/main/java/org/jabref/gui/util/ValueTableCellFactory.java b/src/main/java/org/jabref/gui/util/ValueTableCellFactory.java index 2d7f7cce58d..de0f9b1afab 100644 --- a/src/main/java/org/jabref/gui/util/ValueTableCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ValueTableCellFactory.java @@ -1,8 +1,5 @@ package org.jabref.gui.util; -import java.util.function.BiFunction; -import java.util.function.Function; - import javafx.beans.binding.BooleanExpression; import javafx.event.EventHandler; import javafx.scene.Node; @@ -14,9 +11,11 @@ import javafx.scene.input.MouseEvent; import javafx.stage.Screen; import javafx.util.Callback; - import org.jabref.model.strings.StringUtil; +import java.util.function.BiFunction; +import java.util.function.Function; + /** * Constructs a {@link TableCell} based on the value of the cell and a bunch of specified converter methods. * diff --git a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java index 82183f07a8c..d78646a7c9e 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelListCellFactory.java @@ -1,29 +1,23 @@ package org.jabref.gui.util; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.BiConsumer; - +import com.tobiasdiez.easybind.Subscription; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; import javafx.beans.value.ObservableValue; import javafx.css.PseudoClass; import javafx.scene.Node; -import javafx.scene.control.ComboBox; -import javafx.scene.control.ContextMenu; -import javafx.scene.control.ListCell; -import javafx.scene.control.ListView; -import javafx.scene.control.Tooltip; +import javafx.scene.control.*; import javafx.scene.input.DragEvent; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.util.Callback; - import org.jabref.gui.icon.JabRefIcon; import org.jabref.model.strings.StringUtil; -import com.tobiasdiez.easybind.Subscription; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; /** * Constructs a {@link ListCell} based on the view model of the row and a bunch of specified converter methods. diff --git a/src/main/java/org/jabref/gui/util/ViewModelTableRowFactory.java b/src/main/java/org/jabref/gui/util/ViewModelTableRowFactory.java index 3066f1978de..b411c8f452e 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelTableRowFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelTableRowFactory.java @@ -1,26 +1,16 @@ package org.jabref.gui.util; -import java.util.function.BiConsumer; -import java.util.function.Function; - import javafx.geometry.Bounds; import javafx.geometry.Point2D; -import javafx.scene.control.ContextMenu; -import javafx.scene.control.TableRow; -import javafx.scene.control.TableView; -import javafx.scene.control.Tooltip; -import javafx.scene.control.TreeTableCell; -import javafx.scene.input.DragEvent; -import javafx.scene.input.KeyCode; -import javafx.scene.input.KeyEvent; -import javafx.scene.input.MouseDragEvent; -import javafx.scene.input.MouseEvent; +import javafx.scene.control.*; +import javafx.scene.input.*; import javafx.util.Callback; - import org.jabref.model.strings.StringUtil; - import org.reactfx.util.TriConsumer; +import java.util.function.BiConsumer; +import java.util.function.Function; + /** * Constructs a {@link TreeTableCell} based on the view model of the row and a bunch of specified converter methods. * diff --git a/src/main/java/org/jabref/gui/util/ViewModelTextFieldTableCellVisualizationFactory.java b/src/main/java/org/jabref/gui/util/ViewModelTextFieldTableCellVisualizationFactory.java index e04e73d8b6c..4d3f4da7f8d 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelTextFieldTableCellVisualizationFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelTextFieldTableCellVisualizationFactory.java @@ -1,10 +1,7 @@ package org.jabref.gui.util; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.function.Function; - +import com.tobiasdiez.easybind.Subscription; +import de.saxsys.mvvmfx.utils.validation.ValidationStatus; import javafx.application.Platform; import javafx.css.PseudoClass; import javafx.scene.control.TableCell; @@ -16,8 +13,10 @@ import javafx.util.Callback; import javafx.util.StringConverter; -import com.tobiasdiez.easybind.Subscription; -import de.saxsys.mvvmfx.utils.validation.ValidationStatus; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; public class ViewModelTextFieldTableCellVisualizationFactory implements Callback, TableCell> { diff --git a/src/main/java/org/jabref/gui/util/ViewModelTreeCellFactory.java b/src/main/java/org/jabref/gui/util/ViewModelTreeCellFactory.java index bc983ccbc1f..6c2cb1abb47 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelTreeCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelTreeCellFactory.java @@ -3,16 +3,11 @@ import javafx.beans.value.ObservableValue; import javafx.event.EventHandler; import javafx.scene.Node; -import javafx.scene.control.CheckBoxTreeItem; -import javafx.scene.control.TreeCell; -import javafx.scene.control.TreeItem; -import javafx.scene.control.TreeTableCell; -import javafx.scene.control.TreeView; +import javafx.scene.control.*; import javafx.scene.control.cell.CheckBoxTreeCell; import javafx.scene.input.MouseEvent; import javafx.util.Callback; import javafx.util.StringConverter; - import org.jabref.gui.icon.JabRefIcon; /** diff --git a/src/main/java/org/jabref/gui/util/ViewModelTreeTableCellFactory.java b/src/main/java/org/jabref/gui/util/ViewModelTreeTableCellFactory.java index a1e3f81b7bf..a0e84b7c6ac 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelTreeTableCellFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelTreeTableCellFactory.java @@ -7,7 +7,6 @@ import javafx.scene.control.TreeTableColumn; import javafx.scene.input.MouseEvent; import javafx.util.Callback; - import org.jabref.gui.icon.JabRefIcon; import org.jabref.model.strings.StringUtil; diff --git a/src/main/java/org/jabref/gui/util/ViewModelTreeTableRowFactory.java b/src/main/java/org/jabref/gui/util/ViewModelTreeTableRowFactory.java index a3cb5309eb4..3f89787f98d 100644 --- a/src/main/java/org/jabref/gui/util/ViewModelTreeTableRowFactory.java +++ b/src/main/java/org/jabref/gui/util/ViewModelTreeTableRowFactory.java @@ -1,13 +1,6 @@ package org.jabref.gui.util; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Function; - +import com.tobiasdiez.easybind.Subscription; import javafx.beans.value.ObservableValue; import javafx.css.PseudoClass; import javafx.event.Event; @@ -17,16 +10,18 @@ import javafx.scene.control.ContextMenu; import javafx.scene.control.TreeTableRow; import javafx.scene.control.TreeTableView; -import javafx.scene.input.DragEvent; -import javafx.scene.input.KeyCode; -import javafx.scene.input.KeyEvent; -import javafx.scene.input.MouseDragEvent; -import javafx.scene.input.MouseEvent; +import javafx.scene.input.*; import javafx.util.Callback; - -import com.tobiasdiez.easybind.Subscription; import org.reactfx.util.TriConsumer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; + public class ViewModelTreeTableRowFactory implements Callback, TreeTableRow> { private BiConsumer onMouseClickedEvent; private BiConsumer onMousePressedEvent; diff --git a/src/main/java/org/jabref/gui/util/ZipFileChooser.java b/src/main/java/org/jabref/gui/util/ZipFileChooser.java index 3b724f91328..894562e06d2 100644 --- a/src/main/java/org/jabref/gui/util/ZipFileChooser.java +++ b/src/main/java/org/jabref/gui/util/ZipFileChooser.java @@ -1,15 +1,5 @@ package org.jabref.gui.util; -import java.io.IOException; -import java.nio.file.FileSystem; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.FormatStyle; -import java.util.stream.Collectors; - import javafx.beans.property.ReadOnlyLongWrapper; import javafx.beans.property.ReadOnlyStringWrapper; import javafx.collections.FXCollections; @@ -18,9 +8,18 @@ import javafx.scene.control.SelectionMode; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; - import org.jabref.logic.l10n.Localization; +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.stream.Collectors; + /** * Dialog to allow users to choose a file contained in a ZIP file. */ diff --git a/src/main/java/org/jabref/gui/util/comparator/NumericFieldComparator.java b/src/main/java/org/jabref/gui/util/comparator/NumericFieldComparator.java index 38dd0d535ab..f8c1f185021 100644 --- a/src/main/java/org/jabref/gui/util/comparator/NumericFieldComparator.java +++ b/src/main/java/org/jabref/gui/util/comparator/NumericFieldComparator.java @@ -1,9 +1,9 @@ package org.jabref.gui.util.comparator; -import java.util.Comparator; - import org.jabref.model.strings.StringUtil; +import java.util.Comparator; + /** * Comparator for numeric cases. The purpose of this class is to add the numeric comparison, because values are sorted * as if they were strings. diff --git a/src/main/java/org/jabref/gui/util/comparator/RankingFieldComparator.java b/src/main/java/org/jabref/gui/util/comparator/RankingFieldComparator.java index 79f6ff49aa5..2e287b2b5ca 100644 --- a/src/main/java/org/jabref/gui/util/comparator/RankingFieldComparator.java +++ b/src/main/java/org/jabref/gui/util/comparator/RankingFieldComparator.java @@ -1,10 +1,10 @@ package org.jabref.gui.util.comparator; +import org.jabref.gui.specialfields.SpecialFieldValueViewModel; + import java.util.Comparator; import java.util.Optional; -import org.jabref.gui.specialfields.SpecialFieldValueViewModel; - /** * Comparator for rankings. *

diff --git a/src/main/java/org/jabref/gui/util/comparator/SpecialFieldComparator.java b/src/main/java/org/jabref/gui/util/comparator/SpecialFieldComparator.java index 4c3575ad114..9854f6b64a7 100644 --- a/src/main/java/org/jabref/gui/util/comparator/SpecialFieldComparator.java +++ b/src/main/java/org/jabref/gui/util/comparator/SpecialFieldComparator.java @@ -1,10 +1,10 @@ package org.jabref.gui.util.comparator; +import org.jabref.gui.specialfields.SpecialFieldValueViewModel; + import java.util.Comparator; import java.util.Optional; -import org.jabref.gui.specialfields.SpecialFieldValueViewModel; - public class SpecialFieldComparator implements Comparator> { @Override diff --git a/src/main/java/org/jabref/gui/util/component/TemporalAccessorPicker.java b/src/main/java/org/jabref/gui/util/component/TemporalAccessorPicker.java index 03aac0e16fb..4a97c9c3f20 100644 --- a/src/main/java/org/jabref/gui/util/component/TemporalAccessorPicker.java +++ b/src/main/java/org/jabref/gui/util/component/TemporalAccessorPicker.java @@ -1,23 +1,10 @@ package org.jabref.gui.util.component; -import java.time.DateTimeException; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.Year; -import java.time.YearMonth; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; -import java.util.Objects; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.control.ContextMenu; import javafx.scene.control.DatePicker; import javafx.util.StringConverter; - import org.jabref.gui.Globals; import org.jabref.gui.fieldeditors.TextInputControlBehavior; import org.jabref.gui.fieldeditors.contextmenu.EditorContextAction; @@ -25,6 +12,13 @@ import org.jabref.model.entry.Date; import org.jabref.model.strings.StringUtil; +import java.time.*; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalQueries; +import java.util.Objects; + /** * A date picker with configurable datetime format where both date and time can be changed via the text field and the * date can additionally be changed via the JavaFX default date picker. Also supports incomplete dates. diff --git a/src/main/java/org/jabref/gui/util/uithreadaware/UiThreadObservableList.java b/src/main/java/org/jabref/gui/util/uithreadaware/UiThreadObservableList.java index 17556211480..1b836654ef9 100644 --- a/src/main/java/org/jabref/gui/util/uithreadaware/UiThreadObservableList.java +++ b/src/main/java/org/jabref/gui/util/uithreadaware/UiThreadObservableList.java @@ -1,14 +1,14 @@ package org.jabref.gui.util.uithreadaware; +import javafx.beans.InvalidationListener; +import javafx.collections.ListChangeListener; +import javafx.collections.ObservableList; + import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; -import javafx.beans.InvalidationListener; -import javafx.collections.ListChangeListener; -import javafx.collections.ObservableList; - /** * This class can be used to wrap an @see ObservableList inside it. When wrapped, any Listener listening for updates to the wrapped ObservableList (for example because of a binding to it) is ensured to be notified on the JavaFX Application Thread. It should be used to implement bindings where updates come in from a background thread but should be reflected in the UI where it is necessary that changes to the UI are performed on the JavaFX Application thread. * diff --git a/src/main/java/org/jabref/http/dto/BibEntryDTO.java b/src/main/java/org/jabref/http/dto/BibEntryDTO.java index 7ee9af39596..18a6db1723a 100644 --- a/src/main/java/org/jabref/http/dto/BibEntryDTO.java +++ b/src/main/java/org/jabref/http/dto/BibEntryDTO.java @@ -1,8 +1,6 @@ package org.jabref.http.dto; -import java.io.IOException; -import java.io.StringWriter; - +import com.google.common.base.MoreObjects; import org.jabref.logic.bibtex.BibEntryWriter; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.bibtex.FieldWriter; @@ -11,11 +9,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.SharedBibEntryData; - -import com.google.common.base.MoreObjects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringWriter; + /** * The data transfer object (DTO) for an BibEntry * diff --git a/src/main/java/org/jabref/http/server/Application.java b/src/main/java/org/jabref/http/server/Application.java index 00567335edb..2acee4cb964 100644 --- a/src/main/java/org/jabref/http/server/Application.java +++ b/src/main/java/org/jabref/http/server/Application.java @@ -1,14 +1,13 @@ package org.jabref.http.server; -import java.util.Set; - -import org.jabref.http.dto.GsonFactory; -import org.jabref.preferences.PreferenceServiceFactory; - import jakarta.inject.Inject; import jakarta.ws.rs.ApplicationPath; import org.glassfish.hk2.api.ServiceLocator; import org.glassfish.hk2.utilities.ServiceLocatorUtilities; +import org.jabref.http.dto.GsonFactory; +import org.jabref.preferences.PreferenceServiceFactory; + +import java.util.Set; @ApplicationPath("/") public class Application extends jakarta.ws.rs.core.Application { diff --git a/src/main/java/org/jabref/http/server/LibrariesResource.java b/src/main/java/org/jabref/http/server/LibrariesResource.java index 05cbd0be1b3..54090d155ab 100644 --- a/src/main/java/org/jabref/http/server/LibrariesResource.java +++ b/src/main/java/org/jabref/http/server/LibrariesResource.java @@ -1,16 +1,15 @@ package org.jabref.http.server; -import java.util.List; - -import org.jabref.logic.util.io.BackupFileUtil; -import org.jabref.preferences.PreferencesService; - import com.google.gson.Gson; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; +import org.jabref.logic.util.io.BackupFileUtil; +import org.jabref.preferences.PreferencesService; + +import java.util.List; @Path("libraries") public class LibrariesResource { diff --git a/src/main/java/org/jabref/http/server/LibraryResource.java b/src/main/java/org/jabref/http/server/LibraryResource.java index bb53a4f14f0..aeedbc5c830 100644 --- a/src/main/java/org/jabref/http/server/LibraryResource.java +++ b/src/main/java/org/jabref/http/server/LibraryResource.java @@ -1,10 +1,10 @@ package org.jabref.http.server; -import java.io.IOException; -import java.nio.file.Files; -import java.util.List; -import java.util.Objects; - +import com.google.gson.Gson; +import jakarta.inject.Inject; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.jabref.gui.Globals; import org.jabref.http.JabrefMediaType; import org.jabref.http.dto.BibEntryDTO; @@ -15,20 +15,14 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import com.google.gson.Gson; -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.InternalServerErrorException; -import jakarta.ws.rs.NotFoundException; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; +import java.util.Objects; + @Path("libraries/{id}") public class LibraryResource { public static final Logger LOGGER = LoggerFactory.getLogger(LibraryResource.class); diff --git a/src/main/java/org/jabref/http/server/Server.java b/src/main/java/org/jabref/http/server/Server.java index e0356c4377f..39871c5e003 100644 --- a/src/main/java/org/jabref/http/server/Server.java +++ b/src/main/java/org/jabref/http/server/Server.java @@ -1,28 +1,25 @@ package org.jabref.http.server; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import javax.net.ssl.SSLContext; - +import jakarta.ws.rs.SeBootstrap; import javafx.collections.ObservableList; - +import net.harawata.appdirs.AppDirsFactory; +import org.glassfish.grizzly.ssl.SSLContextConfigurator; import org.jabref.architecture.AllowedToUseStandardStreams; import org.jabref.logic.util.OS; import org.jabref.preferences.JabRefPreferences; - -import jakarta.ws.rs.SeBootstrap; -import net.harawata.appdirs.AppDirsFactory; -import org.glassfish.grizzly.ssl.SSLContextConfigurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.bridge.SLF4JBridgeHandler; +import javax.net.ssl.SSLContext; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + @AllowedToUseStandardStreams( "This is a CLI application. It resides in the package http.server to be close to the other http server related classes.") public class Server { diff --git a/src/main/java/org/jabref/logic/TypedBibEntry.java b/src/main/java/org/jabref/logic/TypedBibEntry.java index a4da3dbcb80..1b7809456f3 100644 --- a/src/main/java/org/jabref/logic/TypedBibEntry.java +++ b/src/main/java/org/jabref/logic/TypedBibEntry.java @@ -1,8 +1,5 @@ package org.jabref.logic; -import java.util.Objects; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; @@ -10,6 +7,9 @@ import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypesManager; +import java.util.Objects; +import java.util.Optional; + /** * Wrapper around a {@link BibEntry} offering methods for {@link BibDatabaseMode}-dependent results */ diff --git a/src/main/java/org/jabref/logic/auxparser/AuxParserResult.java b/src/main/java/org/jabref/logic/auxparser/AuxParserResult.java index d9ca4460f74..5a32cbd72b2 100644 --- a/src/main/java/org/jabref/logic/auxparser/AuxParserResult.java +++ b/src/main/java/org/jabref/logic/auxparser/AuxParserResult.java @@ -1,14 +1,10 @@ package org.jabref.logic.auxparser; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibtexString; +import java.util.*; + public class AuxParserResult { private final BibDatabase masterDatabase; diff --git a/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java b/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java index 595c886e200..b857ea52598 100644 --- a/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java +++ b/src/main/java/org/jabref/logic/auxparser/DefaultAuxParser.java @@ -1,5 +1,11 @@ package org.jabref.logic.auxparser; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; @@ -11,13 +17,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * LaTeX Aux to BibTeX Parser *

diff --git a/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java b/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java index 22f5e73d68f..9c879b6d63b 100644 --- a/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java +++ b/src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java @@ -1,19 +1,5 @@ package org.jabref.logic.bibtex; -import java.io.IOException; -import java.io.StringWriter; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.function.Predicate; -import java.util.stream.Collectors; - import org.jabref.logic.TypedBibEntry; import org.jabref.logic.exporter.BibWriter; import org.jabref.logic.util.OS; @@ -26,9 +12,14 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.OrFields; import org.jabref.model.strings.StringUtil; - import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringWriter; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; + public class BibEntryWriter { private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(BibEntryWriter.class); diff --git a/src/main/java/org/jabref/logic/bibtex/FieldContentFormatter.java b/src/main/java/org/jabref/logic/bibtex/FieldContentFormatter.java index 726ea97de55..10c66588db1 100644 --- a/src/main/java/org/jabref/logic/bibtex/FieldContentFormatter.java +++ b/src/main/java/org/jabref/logic/bibtex/FieldContentFormatter.java @@ -1,13 +1,13 @@ package org.jabref.logic.bibtex; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; + import java.util.HashSet; import java.util.Objects; import java.util.Set; import java.util.regex.Pattern; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - /** * This class provides the reformatting needed when reading BibTeX fields formatted * in JabRef style. The reformatting must undo all formatting done by JabRef when diff --git a/src/main/java/org/jabref/logic/bibtex/FieldPreferences.java b/src/main/java/org/jabref/logic/bibtex/FieldPreferences.java index bbcdfbae1b9..88139dcc22d 100644 --- a/src/main/java/org/jabref/logic/bibtex/FieldPreferences.java +++ b/src/main/java/org/jabref/logic/bibtex/FieldPreferences.java @@ -1,15 +1,14 @@ package org.jabref.logic.bibtex; -import java.util.Collection; -import java.util.List; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.model.entry.field.Field; +import java.util.Collection; +import java.util.List; + public class FieldPreferences { private final BooleanProperty resolveStrings = new SimpleBooleanProperty(); diff --git a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java index 908c761e8c6..712deab4d70 100644 --- a/src/main/java/org/jabref/logic/bibtex/FieldWriter.java +++ b/src/main/java/org/jabref/logic/bibtex/FieldWriter.java @@ -1,7 +1,6 @@ package org.jabref.logic.bibtex; import org.jabref.model.entry.field.Field; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java b/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java index 692302b9893..5471f74f9ed 100644 --- a/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java +++ b/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java @@ -1,12 +1,12 @@ package org.jabref.logic.bibtex; +import org.jabref.model.entry.LinkedFile; + import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.jabref.model.entry.LinkedFile; - public class FileFieldWriter { private FileFieldWriter() {} 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 40f6edd97a3..23fb6e4daa2 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiff.java @@ -1,11 +1,5 @@ package org.jabref.logic.bibtex.comparator; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import org.jabref.logic.database.DuplicateCheck; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; @@ -13,6 +7,8 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.field.StandardField; +import java.util.*; + public class BibDatabaseDiff { private static final double MATCH_THRESHOLD = 0.4; diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java index c40e3eb611a..fa01ecf6bdd 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/BibStringDiff.java @@ -1,17 +1,10 @@ package org.jabref.logic.bibtex.comparator; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibtexString; +import java.util.*; + public class BibStringDiff { private final BibtexString originalString; 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 36df24c09e7..3c0a408c773 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/BibtexStringComparator.java @@ -1,10 +1,10 @@ package org.jabref.logic.bibtex.comparator; +import org.jabref.model.entry.BibtexString; + import java.util.Comparator; import java.util.Locale; -import org.jabref.model.entry.BibtexString; - public class BibtexStringComparator implements Comparator { private final boolean considerRefs; diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java b/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java index f988c3c96b6..eb9aed39167 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparator.java @@ -1,10 +1,10 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Comparator; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; +import java.util.Comparator; + /** * Compares Bibtex entries based on their 'crossref' fields. Entries including * this field are deemed smaller than entries without this field. This serves diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java b/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java index ec91a76ee5f..e874a5f6601 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/EntryComparator.java @@ -1,15 +1,15 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Comparator; -import java.util.Locale; -import java.util.Objects; - import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; import org.jabref.model.entry.field.InternalField; +import java.util.Comparator; +import java.util.Locale; +import java.util.Objects; + /** * This implementation of Comparator takes care of most of the details of sorting BibTeX entries in JabRef. It is * structured as a node in a linked list of comparators, where each node can contain a link to a new comparator that diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java b/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java index 4d3ced6bebc..11259d9ae66 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/FieldComparator.java @@ -1,5 +1,12 @@ package org.jabref.logic.bibtex.comparator; +import org.jabref.model.entry.AuthorList; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.Month; +import org.jabref.model.entry.field.*; +import org.jabref.model.metadata.SaveOrder; +import org.jabref.model.strings.StringUtil; + import java.text.Collator; import java.text.ParseException; import java.text.RuleBasedCollator; @@ -7,17 +14,6 @@ import java.util.Locale; import java.util.Optional; -import org.jabref.model.entry.AuthorList; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.Month; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldProperty; -import org.jabref.model.entry.field.InternalField; -import org.jabref.model.entry.field.OrFields; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.metadata.SaveOrder; -import org.jabref.model.strings.StringUtil; - /** * A comparator for BibEntry fields */ diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java index 35c2e5a1338..e3442c55a04 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/GroupDiff.java @@ -1,10 +1,10 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Optional; - import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.metadata.MetaData; +import java.util.Optional; + public class GroupDiff { private final GroupTreeNode originalGroupRoot; private final GroupTreeNode newGroupRoot; diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java b/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java index f46851fa098..24b6e197628 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/IdComparator.java @@ -1,9 +1,9 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Comparator; - import org.jabref.model.entry.BibEntry; +import java.util.Comparator; + /** * Comparator for sorting BibEntry objects based on their ID. This * can be used to sort entries back into the order they were created, diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java index b67d9d0d4a8..d8ff19279c8 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java @@ -1,13 +1,13 @@ package org.jabref.logic.bibtex.comparator; +import org.jabref.model.metadata.MetaData; +import org.jabref.preferences.PreferencesService; + import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.Optional; -import org.jabref.model.metadata.MetaData; -import org.jabref.preferences.PreferencesService; - public class MetaDataDiff { public enum DifferenceType { PROTECTED, diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java index 2308a8d80c6..3fde0967aeb 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/PreambleDiff.java @@ -1,10 +1,10 @@ package org.jabref.logic.bibtex.comparator; +import org.jabref.model.database.BibDatabaseContext; + import java.util.Objects; import java.util.Optional; -import org.jabref.model.database.BibDatabaseContext; - public class PreambleDiff { private final String originalPreamble; diff --git a/src/main/java/org/jabref/logic/bst/BstEntry.java b/src/main/java/org/jabref/logic/bst/BstEntry.java index 89571de8046..ccfa80c34f5 100644 --- a/src/main/java/org/jabref/logic/bst/BstEntry.java +++ b/src/main/java/org/jabref/logic/bst/BstEntry.java @@ -1,10 +1,10 @@ package org.jabref.logic.bst; +import org.jabref.model.entry.BibEntry; + import java.util.HashMap; import java.util.Map; -import org.jabref.model.entry.BibEntry; - public class BstEntry { public final BibEntry entry; diff --git a/src/main/java/org/jabref/logic/bst/BstFunctions.java b/src/main/java/org/jabref/logic/bst/BstFunctions.java index 6fd41e3d309..fa497b747f7 100644 --- a/src/main/java/org/jabref/logic/bst/BstFunctions.java +++ b/src/main/java/org/jabref/logic/bst/BstFunctions.java @@ -1,5 +1,14 @@ package org.jabref.logic.bst; +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.jabref.logic.bst.util.*; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.entry.Author; +import org.jabref.model.entry.AuthorList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.Deque; import java.util.HashMap; import java.util.Map; @@ -7,20 +16,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.logic.bst.util.BstCaseChanger; -import org.jabref.logic.bst.util.BstNameFormatter; -import org.jabref.logic.bst.util.BstPurifier; -import org.jabref.logic.bst.util.BstTextPrefixer; -import org.jabref.logic.bst.util.BstWidthCalculator; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.Author; -import org.jabref.model.entry.AuthorList; - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ParseTree; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BstFunctions { private static final Logger LOGGER = LoggerFactory.getLogger(BstFunctions.class); private static final Pattern ADD_PERIOD_PATTERN = Pattern.compile("([^.?!}\\s])(}|\\s)*$"); diff --git a/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java b/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java index 33772edcf31..2639ae1b2e1 100644 --- a/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java +++ b/src/main/java/org/jabref/logic/bst/BstPreviewLayout.java @@ -1,9 +1,5 @@ package org.jabref.logic.bst; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - import org.jabref.logic.cleanup.ConvertToBibtexCleanup; import org.jabref.logic.formatter.bibtexfields.RemoveNewlinesFormatter; import org.jabref.logic.l10n.Localization; @@ -13,10 +9,13 @@ import org.jabref.logic.preview.PreviewLayout; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + public class BstPreviewLayout implements PreviewLayout { private static final Logger LOGGER = LoggerFactory.getLogger(BstPreviewLayout.class); diff --git a/src/main/java/org/jabref/logic/bst/BstVM.java b/src/main/java/org/jabref/logic/bst/BstVM.java index fa769e9fa04..598a0389440 100644 --- a/src/main/java/org/jabref/logic/bst/BstVM.java +++ b/src/main/java/org/jabref/logic/bst/BstVM.java @@ -1,25 +1,14 @@ package org.jabref.logic.bst; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Deque; -import java.util.List; -import java.util.Objects; - +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.ParseCancellationException; +import org.antlr.v4.runtime.tree.ParseTree; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; -import org.antlr.v4.runtime.BailErrorStrategy; -import org.antlr.v4.runtime.BaseErrorListener; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.CharStreams; -import org.antlr.v4.runtime.CommonTokenStream; -import org.antlr.v4.runtime.RecognitionException; -import org.antlr.v4.runtime.Recognizer; -import org.antlr.v4.runtime.misc.ParseCancellationException; -import org.antlr.v4.runtime.tree.ParseTree; +import java.io.IOException; +import java.nio.file.Path; +import java.util.*; public class BstVM { diff --git a/src/main/java/org/jabref/logic/bst/BstVMContext.java b/src/main/java/org/jabref/logic/bst/BstVMContext.java index 79aefcd62f0..ea302cb24ab 100644 --- a/src/main/java/org/jabref/logic/bst/BstVMContext.java +++ b/src/main/java/org/jabref/logic/bst/BstVMContext.java @@ -1,15 +1,10 @@ package org.jabref.logic.bst; -import java.nio.file.Path; -import java.util.Deque; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; +import java.nio.file.Path; +import java.util.*; + public record BstVMContext( List entries, Map strings, diff --git a/src/main/java/org/jabref/logic/bst/BstVMVisitor.java b/src/main/java/org/jabref/logic/bst/BstVMVisitor.java index cd1b1cc2332..5f7aa024e77 100644 --- a/src/main/java/org/jabref/logic/bst/BstVMVisitor.java +++ b/src/main/java/org/jabref/logic/bst/BstVMVisitor.java @@ -1,11 +1,8 @@ package org.jabref.logic.bst; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNode; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.bibtex.FieldWriter; import org.jabref.logic.bibtex.InvalidFieldValueException; @@ -13,13 +10,11 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ParseTree; -import org.antlr.v4.runtime.tree.TerminalNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; + class BstVMVisitor extends BstBaseVisitor { private static final Logger LOGGER = LoggerFactory.getLogger(BstVMVisitor.class); diff --git a/src/main/java/org/jabref/logic/bst/util/BstCaseChanger.java b/src/main/java/org/jabref/logic/bst/util/BstCaseChanger.java index c51da799e49..2b901e24b70 100644 --- a/src/main/java/org/jabref/logic/bst/util/BstCaseChanger.java +++ b/src/main/java/org/jabref/logic/bst/util/BstCaseChanger.java @@ -1,11 +1,11 @@ package org.jabref.logic.bst.util; -import java.util.Locale; -import java.util.Optional; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Locale; +import java.util.Optional; + public final class BstCaseChanger { private static final Logger LOGGER = LoggerFactory.getLogger(BstCaseChanger.class); diff --git a/src/main/java/org/jabref/logic/bst/util/BstNameFormatter.java b/src/main/java/org/jabref/logic/bst/util/BstNameFormatter.java index 5c7512b7afc..6696cb47802 100644 --- a/src/main/java/org/jabref/logic/bst/util/BstNameFormatter.java +++ b/src/main/java/org/jabref/logic/bst/util/BstNameFormatter.java @@ -1,17 +1,16 @@ package org.jabref.logic.bst.util; -import java.util.Arrays; -import java.util.Locale; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.logic.bst.BstVMException; import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Arrays; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; + /** * From Bibtex: * diff --git a/src/main/java/org/jabref/logic/citationkeypattern/AbstractCitationKeyPattern.java b/src/main/java/org/jabref/logic/citationkeypattern/AbstractCitationKeyPattern.java index 083aebb736c..6a99b8b2031 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/AbstractCitationKeyPattern.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/AbstractCitationKeyPattern.java @@ -1,16 +1,10 @@ package org.jabref.logic.citationkeypattern; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.stream.Collectors; - import org.jabref.model.entry.types.EntryType; +import java.util.*; +import java.util.stream.Collectors; + /** * A small table, where an entry type is associated with a Bibtex key pattern (an * ArrayList). A parent CitationKeyPattern can be set. diff --git a/src/main/java/org/jabref/logic/citationkeypattern/BracketedPattern.java b/src/main/java/org/jabref/logic/citationkeypattern/BracketedPattern.java index ee8adaf7569..55dd97f8265 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/BracketedPattern.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/BracketedPattern.java @@ -1,43 +1,28 @@ package org.jabref.logic.citationkeypattern; -import java.math.BigInteger; -import java.text.Normalizer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.Scanner; -import java.util.StringJoiner; -import java.util.StringTokenizer; -import java.util.function.Function; -import java.util.function.Predicate; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.formatter.Formatters; import org.jabref.logic.formatter.casechanger.Word; import org.jabref.logic.layout.format.RemoveLatexCommandsFormatter; import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.Author; -import org.jabref.model.entry.AuthorList; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.Keyword; -import org.jabref.model.entry.KeywordList; +import org.jabref.model.entry.*; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.math.BigInteger; +import java.text.Normalizer; +import java.util.*; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + /** * This class provides methods to expand bracketed expressions, such as * [year]_[author]_[firstpage], using information from a provided BibEntry. The above-mentioned expression would yield diff --git a/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java b/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java index 657d1ee5b99..40b13acc219 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyGenerator.java @@ -1,22 +1,21 @@ package org.jabref.logic.citationkeypattern; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Function; -import java.util.regex.PatternSyntaxException; - import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Function; +import java.util.regex.PatternSyntaxException; + /** * This is the utility class of the LabelPattern package. */ diff --git a/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPatternPreferences.java b/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPatternPreferences.java index d8b52af8274..11e327afddc 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPatternPreferences.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/CitationKeyPatternPreferences.java @@ -1,14 +1,7 @@ package org.jabref.logic.citationkeypattern; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - import com.google.common.annotations.VisibleForTesting; +import javafx.beans.property.*; public class CitationKeyPatternPreferences { diff --git a/src/main/java/org/jabref/logic/citationkeypattern/DatabaseCitationKeyPattern.java b/src/main/java/org/jabref/logic/citationkeypattern/DatabaseCitationKeyPattern.java index 33e643d4a4c..087434debb3 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/DatabaseCitationKeyPattern.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/DatabaseCitationKeyPattern.java @@ -1,9 +1,9 @@ package org.jabref.logic.citationkeypattern; -import java.util.List; - import org.jabref.model.entry.types.EntryType; +import java.util.List; + public class DatabaseCitationKeyPattern extends AbstractCitationKeyPattern { private final GlobalCitationKeyPattern globalCitationKeyPattern; diff --git a/src/main/java/org/jabref/logic/citationkeypattern/GlobalCitationKeyPattern.java b/src/main/java/org/jabref/logic/citationkeypattern/GlobalCitationKeyPattern.java index 38c6b3000b9..7f754dca217 100644 --- a/src/main/java/org/jabref/logic/citationkeypattern/GlobalCitationKeyPattern.java +++ b/src/main/java/org/jabref/logic/citationkeypattern/GlobalCitationKeyPattern.java @@ -1,9 +1,9 @@ package org.jabref.logic.citationkeypattern; -import java.util.List; - import org.jabref.model.entry.types.EntryType; +import java.util.List; + public class GlobalCitationKeyPattern extends AbstractCitationKeyPattern { public GlobalCitationKeyPattern(List bibtexKeyPattern) { diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java index d86c6a684e9..ffccb7d03d0 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java +++ b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java @@ -1,17 +1,16 @@ package org.jabref.logic.citationstyle; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; - +import de.undercouch.citeproc.CSL; +import de.undercouch.citeproc.DefaultAbbreviationProvider; +import de.undercouch.citeproc.output.Bibliography; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; -import de.undercouch.citeproc.CSL; -import de.undercouch.citeproc.DefaultAbbreviationProvider; -import de.undercouch.citeproc.output.Bibliography; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; /** * Provides an adapter class to CSL. It holds a CSL instance under the hood that is only recreated when diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java index 56884d5b0e9..09332b80484 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java @@ -1,5 +1,18 @@ package org.jabref.logic.citationstyle; +import de.undercouch.citeproc.helper.CSLUtils; +import org.jabref.logic.util.StandardFileType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.CharacterData; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.StringReader; import java.net.URI; @@ -9,29 +22,10 @@ import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.jabref.logic.util.StandardFileType; - -import de.undercouch.citeproc.helper.CSLUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.CharacterData; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - /** * Representation of a CitationStyle. Stores its name, the file path and the style itself */ diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java index 40e701d7e44..eb3ee1ada08 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java @@ -1,17 +1,16 @@ package org.jabref.logic.citationstyle; -import java.util.Objects; - +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.eventbus.Subscribe; import org.jabref.logic.preview.PreviewLayout; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.event.EntriesRemovedEvent; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntryChangedEvent; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.eventbus.Subscribe; +import java.util.Objects; /** * Caches the generated Citations for quicker access diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java index 5a801a5bda1..c1e8f08c85c 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java @@ -1,18 +1,17 @@ package org.jabref.logic.citationstyle; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; - import org.jbibtex.TokenMgrException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + /** * Facade to unify the access to the citation style engine. Use these methods if you need rendered BibTeX item(s) in a * given journal style. This class uses {@link CSLAdapter} to create output. diff --git a/src/main/java/org/jabref/logic/citationstyle/JabRefItemDataProvider.java b/src/main/java/org/jabref/logic/citationstyle/JabRefItemDataProvider.java index 938876eb521..9082699d552 100644 --- a/src/main/java/org/jabref/logic/citationstyle/JabRefItemDataProvider.java +++ b/src/main/java/org/jabref/logic/citationstyle/JabRefItemDataProvider.java @@ -1,14 +1,9 @@ package org.jabref.logic.citationstyle; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - +import de.undercouch.citeproc.ItemDataProvider; +import de.undercouch.citeproc.bibtex.BibTeXConverter; +import de.undercouch.citeproc.csl.CSLItemData; +import de.undercouch.citeproc.helper.json.StringJsonBuilderFactory; import org.jabref.logic.formatter.bibtexfields.RemoveNewlinesFormatter; import org.jabref.logic.integrity.PagesChecker; import org.jabref.model.database.BibDatabaseContext; @@ -21,15 +16,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.LatexToUnicodeAdapter; - -import de.undercouch.citeproc.ItemDataProvider; -import de.undercouch.citeproc.bibtex.BibTeXConverter; -import de.undercouch.citeproc.csl.CSLItemData; -import de.undercouch.citeproc.helper.json.StringJsonBuilderFactory; import org.jbibtex.BibTeXEntry; import org.jbibtex.DigitStringValue; import org.jbibtex.Key; +import java.util.*; +import java.util.stream.Collectors; + /** * Custom {@link ItemDataProvider} that allows to set the data so that we don't have to instantiate a new CSL object * every time. diff --git a/src/main/java/org/jabref/logic/citationstyle/JabRefLocaleProvider.java b/src/main/java/org/jabref/logic/citationstyle/JabRefLocaleProvider.java index 376303c7caf..a9ab2c8b5af 100644 --- a/src/main/java/org/jabref/logic/citationstyle/JabRefLocaleProvider.java +++ b/src/main/java/org/jabref/logic/citationstyle/JabRefLocaleProvider.java @@ -1,14 +1,14 @@ package org.jabref.logic.citationstyle; +import de.undercouch.citeproc.LocaleProvider; +import de.undercouch.citeproc.helper.CSLUtils; + import java.io.IOException; import java.io.UncheckedIOException; import java.net.URL; import java.util.HashMap; import java.util.Map; -import de.undercouch.citeproc.LocaleProvider; -import de.undercouch.citeproc.helper.CSLUtils; - /** * A {@link LocaleProvider} that loads locales from a directory in the current module. *

diff --git a/src/main/java/org/jabref/logic/cleanup/CleanupJob.java b/src/main/java/org/jabref/logic/cleanup/CleanupJob.java index a36f12a2408..c74d9a44534 100644 --- a/src/main/java/org/jabref/logic/cleanup/CleanupJob.java +++ b/src/main/java/org/jabref/logic/cleanup/CleanupJob.java @@ -1,10 +1,10 @@ package org.jabref.logic.cleanup; -import java.util.List; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; +import java.util.List; + @FunctionalInterface public interface CleanupJob { diff --git a/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java b/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java index b85a57178d5..40966274d82 100644 --- a/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java +++ b/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java @@ -1,9 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabaseContext; @@ -11,6 +7,10 @@ import org.jabref.preferences.CleanupPreferences; import org.jabref.preferences.FilePreferences; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + public class CleanupWorker { private final BibDatabaseContext databaseContext; diff --git a/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java b/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java index 5d0c6edf031..b67837004c1 100644 --- a/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanup.java @@ -1,10 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; @@ -13,6 +8,11 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; + /** * Converts the entry to biblatex format. */ diff --git a/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java b/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java index 8ea1b23a045..64d00206564 100644 --- a/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/ConvertToBibtexCleanup.java @@ -1,9 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.EntryConverter; @@ -11,6 +7,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * Converts the entry to biblatex format. */ diff --git a/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java b/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java index 3b512dd2e2a..45bd658a0c5 100644 --- a/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/DoiCleanup.java @@ -1,12 +1,5 @@ package org.jabref.logic.cleanup; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.formatter.bibtexfields.ClearFormatter; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; @@ -16,6 +9,13 @@ import org.jabref.model.entry.identifier.ArXivIdentifier; import org.jabref.model.entry.identifier.DOI; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + /** * Formats the DOI (e.g. removes http part) and also infers DOIs from the note, url, eprint or ee fields. */ diff --git a/src/main/java/org/jabref/logic/cleanup/EprintCleanup.java b/src/main/java/org/jabref/logic/cleanup/EprintCleanup.java index 9280604f6f4..e2d9797fb88 100644 --- a/src/main/java/org/jabref/logic/cleanup/EprintCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/EprintCleanup.java @@ -1,16 +1,16 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.ArXivIdentifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + /** * Formats the DOI (e.g. removes http part) and also moves DOIs from note, url or ee field to the doi field. */ diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java index 197debd20fd..5b525b7edcb 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java @@ -1,12 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Set; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntriesEventSource; @@ -14,6 +7,8 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.InternalField; +import java.util.*; + /** * Formats a given entry field with the specified formatter. */ diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java index 6e818d27cd5..98cfe96b23f 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java @@ -1,25 +1,8 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.StringJoiner; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.formatter.Formatters; import org.jabref.logic.formatter.IdentityFormatter; -import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter; -import org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; -import org.jabref.logic.formatter.bibtexfields.OrdinalsToSuperscriptFormatter; -import org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter; +import org.jabref.logic.formatter.bibtexfields.*; import org.jabref.logic.layout.format.LatexToUnicodeFormatter; import org.jabref.logic.layout.format.ReplaceUnicodeLigaturesFormatter; import org.jabref.model.FieldChange; @@ -29,10 +12,13 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + public class FieldFormatterCleanups { public static final List DEFAULT_SAVE_ACTIONS; diff --git a/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java b/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java index fb72153186f..5f0360c2125 100644 --- a/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/FileLinksCleanup.java @@ -1,15 +1,15 @@ package org.jabref.logic.cleanup; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * Fixes the format of the file field. For example, if the file link is empty but the description wrongly contains the path. */ diff --git a/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java b/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java index 735e408b3a5..80a6c17b889 100644 --- a/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/ISSNCleanup.java @@ -1,14 +1,14 @@ package org.jabref.logic.cleanup; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.ISSN; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + public class ISSNCleanup implements CleanupJob { @Override diff --git a/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java b/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java index 0ba50ef1419..c95538c2e49 100644 --- a/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/MoveFieldCleanup.java @@ -1,13 +1,13 @@ package org.jabref.logic.cleanup; -import java.util.List; -import java.util.Optional; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.util.OptionalUtil; +import java.util.List; +import java.util.Optional; + /** * Moves the content of one field to another field. */ diff --git a/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java b/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java index 4fad8316175..14e9eafcdbd 100644 --- a/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/MoveFilesCleanup.java @@ -1,11 +1,5 @@ package org.jabref.logic.cleanup; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.externalfiles.LinkedFileHandler; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabaseContext; @@ -13,10 +7,15 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class MoveFilesCleanup implements CleanupJob { private static final Logger LOGGER = LoggerFactory.getLogger(MoveFilesCleanup.class); diff --git a/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java b/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java index 4253980832e..ae86b1b3266 100644 --- a/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/RelativePathsCleanup.java @@ -1,12 +1,5 @@ package org.jabref.logic.cleanup; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.util.io.FileUtil; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabaseContext; @@ -14,6 +7,9 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; +import java.nio.file.Path; +import java.util.*; + public class RelativePathsCleanup implements CleanupJob { private final BibDatabaseContext databaseContext; diff --git a/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java b/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java index a9cde0e409d..e0990590655 100644 --- a/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java @@ -1,12 +1,5 @@ package org.jabref.logic.cleanup; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.externalfiles.LinkedFileHandler; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabaseContext; @@ -14,10 +7,16 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.OptionalUtil; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class RenamePdfCleanup implements CleanupJob { private static final Logger LOGGER = LoggerFactory.getLogger(RenamePdfCleanup.class); diff --git a/src/main/java/org/jabref/logic/cleanup/TimeStampToCreationDate.java b/src/main/java/org/jabref/logic/cleanup/TimeStampToCreationDate.java index eedd1191410..56b4a8d3659 100644 --- a/src/main/java/org/jabref/logic/cleanup/TimeStampToCreationDate.java +++ b/src/main/java/org/jabref/logic/cleanup/TimeStampToCreationDate.java @@ -1,13 +1,5 @@ package org.jabref.logic.cleanup; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; @@ -16,6 +8,14 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * This class handles the migration from timestamp field to creationdate and modificationdate fields. *

diff --git a/src/main/java/org/jabref/logic/cleanup/TimeStampToModificationDate.java b/src/main/java/org/jabref/logic/cleanup/TimeStampToModificationDate.java index ee2f7953168..901459ed471 100644 --- a/src/main/java/org/jabref/logic/cleanup/TimeStampToModificationDate.java +++ b/src/main/java/org/jabref/logic/cleanup/TimeStampToModificationDate.java @@ -1,13 +1,5 @@ package org.jabref.logic.cleanup; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; @@ -16,6 +8,14 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * This class handles the migration from timestamp field to creationdate and modificationdate fields. *

diff --git a/src/main/java/org/jabref/logic/cleanup/URLCleanup.java b/src/main/java/org/jabref/logic/cleanup/URLCleanup.java index c1223244258..bf27fe995fd 100644 --- a/src/main/java/org/jabref/logic/cleanup/URLCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/URLCleanup.java @@ -1,10 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; @@ -12,6 +7,11 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Checks whether URL exists in note field, and stores it under url field. */ diff --git a/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java b/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java index 731a3ed6f0d..8b9d1ce1d29 100644 --- a/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/UpgradePdfPsToFileCleanup.java @@ -1,11 +1,5 @@ package org.jabref.logic.cleanup; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; @@ -13,6 +7,12 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Collects file links from the ps and pdf fields, and add them to the list contained in the file field. */ diff --git a/src/main/java/org/jabref/logic/crawler/Crawler.java b/src/main/java/org/jabref/logic/crawler/Crawler.java index e78f610d37a..98c56e7c005 100644 --- a/src/main/java/org/jabref/logic/crawler/Crawler.java +++ b/src/main/java/org/jabref/logic/crawler/Crawler.java @@ -1,9 +1,6 @@ package org.jabref.logic.crawler; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; - +import org.eclipse.jgit.api.errors.GitAPIException; import org.jabref.logic.exporter.SaveException; import org.jabref.logic.git.SlrGitHandler; import org.jabref.logic.importer.ParseException; @@ -12,7 +9,9 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; -import org.eclipse.jgit.api.errors.GitAPIException; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; /** * This class provides a service for SLR support by conducting an automated search and persistance diff --git a/src/main/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverter.java b/src/main/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverter.java index b3f0ba134e2..0c69355fce5 100644 --- a/src/main/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverter.java +++ b/src/main/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverter.java @@ -1,16 +1,16 @@ package org.jabref.logic.crawler; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.logic.importer.WebFetchers; import org.jabref.model.study.StudyDatabase; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + /** * Converts library entries from the given study into their corresponding fetchers. */ diff --git a/src/main/java/org/jabref/logic/crawler/StudyFetcher.java b/src/main/java/org/jabref/logic/crawler/StudyFetcher.java index f83ca25303e..46ce611b32f 100644 --- a/src/main/java/org/jabref/logic/crawler/StudyFetcher.java +++ b/src/main/java/org/jabref/logic/crawler/StudyFetcher.java @@ -1,10 +1,5 @@ package org.jabref.logic.crawler; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.PagedSearchBasedFetcher; import org.jabref.logic.importer.SearchBasedFetcher; @@ -12,10 +7,14 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.study.FetchResult; import org.jabref.model.study.QueryResult; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * Delegates the search of the provided set of targeted E-Libraries with the provided queries to the E-Library specific fetchers, * and aggregates the results returned by the fetchers by query and E-Library. diff --git a/src/main/java/org/jabref/logic/crawler/StudyRepository.java b/src/main/java/org/jabref/logic/crawler/StudyRepository.java index b6745a5bc0f..c8707f53028 100644 --- a/src/main/java/org/jabref/logic/crawler/StudyRepository.java +++ b/src/main/java/org/jabref/logic/crawler/StudyRepository.java @@ -1,23 +1,9 @@ package org.jabref.logic.crawler; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.charset.UnsupportedCharsetException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; -import java.util.List; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - +import org.eclipse.jgit.api.errors.GitAPIException; import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.database.DatabaseMerger; -import org.jabref.logic.exporter.AtomicFileWriter; -import org.jabref.logic.exporter.BibWriter; -import org.jabref.logic.exporter.BibtexDatabaseWriter; -import org.jabref.logic.exporter.SaveException; -import org.jabref.logic.exporter.SelfContainedSaveConfiguration; +import org.jabref.logic.exporter.*; import org.jabref.logic.git.SlrGitHandler; import org.jabref.logic.importer.OpenDatabase; import org.jabref.logic.importer.SearchBasedFetcher; @@ -29,18 +15,23 @@ import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.metadata.SaveOrder; import org.jabref.model.metadata.SelfContainedSaveOrder; -import org.jabref.model.study.FetchResult; -import org.jabref.model.study.QueryResult; -import org.jabref.model.study.Study; -import org.jabref.model.study.StudyDatabase; -import org.jabref.model.study.StudyQuery; +import org.jabref.model.study.*; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; - -import org.eclipse.jgit.api.errors.GitAPIException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; +import java.util.List; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + /** * This class manages all aspects of the study process related to the repository. * diff --git a/src/main/java/org/jabref/logic/crawler/StudyYamlParser.java b/src/main/java/org/jabref/logic/crawler/StudyYamlParser.java index d95a494a4d5..fa6e32c0b6f 100644 --- a/src/main/java/org/jabref/logic/crawler/StudyYamlParser.java +++ b/src/main/java/org/jabref/logic/crawler/StudyYamlParser.java @@ -1,16 +1,15 @@ package org.jabref.logic.crawler; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; +import org.jabref.model.study.Study; + import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; -import org.jabref.model.study.Study; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; - /** * Example use: new StudyYamlParser().parseStudyYamlFile(studyDefinitionFile); */ diff --git a/src/main/java/org/jabref/logic/database/DatabaseMerger.java b/src/main/java/org/jabref/logic/database/DatabaseMerger.java index c764a6f4239..b63dac489cf 100644 --- a/src/main/java/org/jabref/logic/database/DatabaseMerger.java +++ b/src/main/java/org/jabref/logic/database/DatabaseMerger.java @@ -1,9 +1,5 @@ package org.jabref.logic.database; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseModeDetection; @@ -15,10 +11,13 @@ import org.jabref.model.groups.GroupHierarchyType; import org.jabref.model.metadata.ContentSelector; import org.jabref.model.metadata.MetaData; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + public class DatabaseMerger { private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseMerger.class); diff --git a/src/main/java/org/jabref/logic/database/DuplicateCheck.java b/src/main/java/org/jabref/logic/database/DuplicateCheck.java index df167320b35..fe460cf6b8d 100644 --- a/src/main/java/org/jabref/logic/database/DuplicateCheck.java +++ b/src/main/java/org/jabref/logic/database/DuplicateCheck.java @@ -1,15 +1,6 @@ package org.jabref.logic.database; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - +import com.google.common.collect.Sets; import org.jabref.logic.util.OS; import org.jabref.logic.util.strings.StringSimilarity; import org.jabref.model.database.BibDatabase; @@ -18,20 +9,16 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypesManager; -import org.jabref.model.entry.field.BibField; -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.OrFields; -import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.identifier.DOI; import org.jabref.model.entry.identifier.ISBN; import org.jabref.model.strings.StringUtil; - -import com.google.common.collect.Sets; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.stream.Collectors; + /** * This class contains utility method for duplicate checking of entries. */ diff --git a/src/main/java/org/jabref/logic/exporter/AtomicFileOutputStream.java b/src/main/java/org/jabref/logic/exporter/AtomicFileOutputStream.java index 72b16db862d..d4fb19e3a5b 100644 --- a/src/main/java/org/jabref/logic/exporter/AtomicFileOutputStream.java +++ b/src/main/java/org/jabref/logic/exporter/AtomicFileOutputStream.java @@ -1,5 +1,10 @@ package org.jabref.logic.exporter; +import org.jabref.logic.util.BackupFileType; +import org.jabref.logic.util.io.FileUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; @@ -13,12 +18,6 @@ import java.util.EnumSet; import java.util.Set; -import org.jabref.logic.util.BackupFileType; -import org.jabref.logic.util.io.FileUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * A file output stream that is similar to the standard {@link FileOutputStream}, except that all writes are first * redirected to a temporary file. When the stream is closed, the temporary file (atomically) replaces the target file. diff --git a/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java b/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java index 4fe40063781..822842ed5c4 100644 --- a/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java +++ b/src/main/java/org/jabref/logic/exporter/BibDatabaseWriter.java @@ -1,27 +1,6 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -import org.jabref.logic.bibtex.comparator.BibtexStringComparator; -import org.jabref.logic.bibtex.comparator.CrossRefEntryComparator; -import org.jabref.logic.bibtex.comparator.FieldComparator; -import org.jabref.logic.bibtex.comparator.FieldComparatorStack; -import org.jabref.logic.bibtex.comparator.IdComparator; +import org.jabref.logic.bibtex.comparator.*; import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; @@ -41,9 +20,16 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.model.metadata.SelfContainedSaveOrder; import org.jabref.model.strings.StringUtil; - import org.jooq.lambda.Unchecked; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; + /** * A generic writer for our database. This is independent of the concrete serialization format. * For instance, we could also write out YAML or XML by subclassing this class. diff --git a/src/main/java/org/jabref/logic/exporter/BibWriter.java b/src/main/java/org/jabref/logic/exporter/BibWriter.java index f6931653542..e3ab19e6cf6 100644 --- a/src/main/java/org/jabref/logic/exporter/BibWriter.java +++ b/src/main/java/org/jabref/logic/exporter/BibWriter.java @@ -1,10 +1,10 @@ package org.jabref.logic.exporter; +import org.jabref.model.strings.StringUtil; + import java.io.IOException; import java.io.Writer; -import org.jabref.model.strings.StringUtil; - /** * Class to write to a .bib file. Used by {@link BibtexDatabaseWriter} */ diff --git a/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java b/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java index 823107252fb..90ed6199e61 100644 --- a/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java +++ b/src/main/java/org/jabref/logic/exporter/BibtexDatabaseWriter.java @@ -1,11 +1,5 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.io.Writer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Map; - import org.jabref.logic.bibtex.BibEntryWriter; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.bibtex.FieldWriter; @@ -21,6 +15,12 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.strings.StringUtil; +import java.io.IOException; +import java.io.Writer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Map; + /** * Writes a .bib file following the BibTeX / BibLaTeX format using the provided {@link BibWriter}. * Reading is done by {@link org.jabref.logic.importer.fileformat.BibtexImporter}. diff --git a/src/main/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporter.java b/src/main/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporter.java index 0704d4d24c7..4a4e8e60281 100644 --- a/src/main/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporter.java +++ b/src/main/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporter.java @@ -1,17 +1,11 @@ package org.jabref.logic.exporter; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.*; +import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; +import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile; +import org.apache.pdfbox.pdmodel.font.PDType1Font; +import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.jabref.logic.bibtex.BibEntryWriter; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.bibtex.FieldWriter; @@ -24,20 +18,21 @@ import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; - -import org.apache.pdfbox.Loader; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary; -import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode; -import org.apache.pdfbox.pdmodel.PDPage; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; -import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile; -import org.apache.pdfbox.pdmodel.font.PDType1Font; -import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + /** * A custom exporter to write bib entries to an embedded bib file. */ diff --git a/src/main/java/org/jabref/logic/exporter/Exporter.java b/src/main/java/org/jabref/logic/exporter/Exporter.java index eca0d0f3d4e..24963cef0eb 100644 --- a/src/main/java/org/jabref/logic/exporter/Exporter.java +++ b/src/main/java/org/jabref/logic/exporter/Exporter.java @@ -1,11 +1,5 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.util.FileType; import org.jabref.model.database.BibDatabaseContext; @@ -13,6 +7,12 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + public abstract class Exporter { private final String id; diff --git a/src/main/java/org/jabref/logic/exporter/ExporterFactory.java b/src/main/java/org/jabref/logic/exporter/ExporterFactory.java index c78854a0b8f..9ce44de48ca 100644 --- a/src/main/java/org/jabref/logic/exporter/ExporterFactory.java +++ b/src/main/java/org/jabref/logic/exporter/ExporterFactory.java @@ -1,11 +1,5 @@ package org.jabref.logic.exporter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatterPreferences; @@ -16,6 +10,8 @@ import org.jabref.model.metadata.SelfContainedSaveOrder; import org.jabref.preferences.PreferencesService; +import java.util.*; + public class ExporterFactory { private final List exporters; diff --git a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java b/src/main/java/org/jabref/logic/exporter/GroupSerializer.java index 05b2c00920e..78a05196e21 100644 --- a/src/main/java/org/jabref/logic/exporter/GroupSerializer.java +++ b/src/main/java/org/jabref/logic/exporter/GroupSerializer.java @@ -1,26 +1,15 @@ package org.jabref.logic.exporter; -import java.util.ArrayList; -import java.util.List; - import javafx.scene.paint.Color; - import org.jabref.logic.util.MetadataSerializationConfiguration; import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.AutomaticGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.KeywordGroup; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; +import org.jabref.model.groups.*; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.strings.StringUtil; +import java.util.ArrayList; +import java.util.List; + public class GroupSerializer { private static String serializeAllEntriesGroup() { return MetadataSerializationConfiguration.ALL_ENTRIES_GROUP_ID; diff --git a/src/main/java/org/jabref/logic/exporter/MSBibExporter.java b/src/main/java/org/jabref/logic/exporter/MSBibExporter.java index 54d84c39504..2fa6bd1f055 100644 --- a/src/main/java/org/jabref/logic/exporter/MSBibExporter.java +++ b/src/main/java/org/jabref/logic/exporter/MSBibExporter.java @@ -1,24 +1,19 @@ package org.jabref.logic.exporter; +import org.jabref.logic.msbib.MSBibDatabase; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; + +import javax.xml.transform.*; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.List; import java.util.Objects; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.jabref.logic.msbib.MSBibDatabase; -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; - /** * TemplateExporter for exporting in MSBIB XML format. */ diff --git a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java index cba51ab52a9..b51d620ae2c 100644 --- a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java +++ b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java @@ -1,14 +1,5 @@ package org.jabref.logic.exporter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; -import java.util.TreeMap; -import java.util.stream.Collectors; - import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.cleanup.FieldFormatterCleanups; @@ -22,6 +13,9 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.strings.StringUtil; +import java.util.*; +import java.util.stream.Collectors; + /** * Reading is done at {@link org.jabref.logic.importer.util.MetaDataParser} */ diff --git a/src/main/java/org/jabref/logic/exporter/ModsExporter.java b/src/main/java/org/jabref/logic/exporter/ModsExporter.java index 391efd656c2..dec29fc220b 100644 --- a/src/main/java/org/jabref/logic/exporter/ModsExporter.java +++ b/src/main/java/org/jabref/logic/exporter/ModsExporter.java @@ -1,18 +1,14 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.io.OutputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.math.BigInteger; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.TreeMap; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.types.EntryType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; @@ -23,17 +19,14 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; - -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.EntryType; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.OutputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.math.BigInteger; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; /** * TemplateExporter for exporting in MODS XML format. diff --git a/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java b/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java index a14236fa56e..6c578f40966 100644 --- a/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java +++ b/src/main/java/org/jabref/logic/exporter/OOCalcDatabase.java @@ -1,12 +1,5 @@ package org.jabref.logic.exporter; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.xml.parsers.DocumentBuilderFactory; - import org.jabref.logic.bibtex.comparator.FieldComparator; import org.jabref.logic.bibtex.comparator.FieldComparatorStack; import org.jabref.logic.layout.format.GetOpenOfficeType; @@ -14,18 +7,19 @@ import org.jabref.logic.layout.format.RemoveWhitespace; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.entry.field.InternalField; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; - +import org.jabref.model.entry.field.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; +import javax.xml.parsers.DocumentBuilderFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + class OOCalcDatabase { private static final Logger LOGGER = LoggerFactory.getLogger(OOCalcDatabase.class); diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java index 26f2b6a940d..d6b63516c9c 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java +++ b/src/main/java/org/jabref/logic/exporter/OpenDocumentRepresentation.java @@ -1,12 +1,5 @@ package org.jabref.logic.exporter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - import org.jabref.logic.bibtex.comparator.FieldComparator; import org.jabref.logic.bibtex.comparator.FieldComparatorStack; import org.jabref.logic.layout.format.GetOpenOfficeType; @@ -18,13 +11,18 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + class OpenDocumentRepresentation { private static final Logger LOGGER = LoggerFactory.getLogger(OpenDocumentRepresentation.class); @@ -149,26 +147,16 @@ public Document getDOMrepresentation() { 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))); + 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))); + 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)); diff --git a/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java b/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java index 36f6a53b6db..80122c95bb7 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java +++ b/src/main/java/org/jabref/logic/exporter/OpenDocumentSpreadsheetCreator.java @@ -1,15 +1,19 @@ package org.jabref.logic.exporter; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; +import org.jabref.logic.l10n.Localization; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.*; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -20,21 +24,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.jabref.logic.l10n.Localization; -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class OpenDocumentSpreadsheetCreator extends Exporter { private static final Logger LOGGER = LoggerFactory.getLogger(OpenDocumentSpreadsheetCreator.class); diff --git a/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java b/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java index b87a50b57a6..b11c8fead11 100644 --- a/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java +++ b/src/main/java/org/jabref/logic/exporter/OpenOfficeDocumentCreator.java @@ -1,15 +1,18 @@ package org.jabref.logic.exporter; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.*; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -19,20 +22,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class OpenOfficeDocumentCreator extends Exporter { private static final Logger LOGGER = LoggerFactory.getLogger(OpenOfficeDocumentCreator.class); diff --git a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java index 53745e5b966..7f7a9a4c015 100644 --- a/src/main/java/org/jabref/logic/exporter/TemplateExporter.java +++ b/src/main/java/org/jabref/logic/exporter/TemplateExporter.java @@ -1,21 +1,5 @@ package org.jabref.logic.exporter; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.Reader; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - import org.jabref.logic.journals.JournalAbbreviationLoader; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.layout.Layout; @@ -30,10 +14,20 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.metadata.SaveOrder; import org.jabref.model.metadata.SelfContainedSaveOrder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.Reader; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + /** * Base class for export formats based on templates. */ diff --git a/src/main/java/org/jabref/logic/exporter/XmpExporter.java b/src/main/java/org/jabref/logic/exporter/XmpExporter.java index 5328b10593b..0e1221483a6 100644 --- a/src/main/java/org/jabref/logic/exporter/XmpExporter.java +++ b/src/main/java/org/jabref/logic/exporter/XmpExporter.java @@ -1,12 +1,5 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.util.StandardFileType; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.logic.xmp.XmpUtilWriter; @@ -14,6 +7,13 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + /** * A custom exporter to write bib entries to a .xmp file for further processing * in other scenarios and applications. The xmp metadata are written in dublin diff --git a/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java b/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java index a213a57ad54..0b7c2e69668 100644 --- a/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java +++ b/src/main/java/org/jabref/logic/exporter/XmpPdfExporter.java @@ -1,26 +1,25 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.pdmodel.PDPageContentStream; +import org.apache.pdfbox.pdmodel.font.PDType1Font; +import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.logic.xmp.XmpUtilWriter; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; - -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDPage; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.font.PDType1Font; -import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; + public class XmpPdfExporter extends Exporter { private static final Logger LOGGER = LoggerFactory.getLogger(XmpPdfExporter.class); diff --git a/src/main/java/org/jabref/logic/externalfiles/ExternalFilesContentImporter.java b/src/main/java/org/jabref/logic/externalfiles/ExternalFilesContentImporter.java index f19b766d7f6..0cc344b38fb 100644 --- a/src/main/java/org/jabref/logic/externalfiles/ExternalFilesContentImporter.java +++ b/src/main/java/org/jabref/logic/externalfiles/ExternalFilesContentImporter.java @@ -1,14 +1,14 @@ package org.jabref.logic.externalfiles; -import java.io.IOException; -import java.nio.file.Path; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.OpenDatabase; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter; import org.jabref.model.util.FileUpdateMonitor; +import java.io.IOException; +import java.nio.file.Path; + public class ExternalFilesContentImporter { private final ImportFormatPreferences importFormatPreferences; diff --git a/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java b/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java index 9158d9e40c7..f79990c5f30 100644 --- a/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java +++ b/src/main/java/org/jabref/logic/externalfiles/LinkedFileHandler.java @@ -1,5 +1,13 @@ package org.jabref.logic.externalfiles; +import org.jabref.logic.util.io.FileUtil; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.LinkedFile; +import org.jabref.preferences.FilePreferences; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -9,15 +17,6 @@ import java.util.Optional; import java.util.stream.Stream; -import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.LinkedFile; -import org.jabref.preferences.FilePreferences; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class LinkedFileHandler { private static final Logger LOGGER = LoggerFactory.getLogger(LinkedFileHandler.class); diff --git a/src/main/java/org/jabref/logic/formatter/Formatters.java b/src/main/java/org/jabref/logic/formatter/Formatters.java index 40711f9d3ec..9e89760b10f 100644 --- a/src/main/java/org/jabref/logic/formatter/Formatters.java +++ b/src/main/java/org/jabref/logic/formatter/Formatters.java @@ -1,42 +1,16 @@ package org.jabref.logic.formatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; -import org.jabref.logic.formatter.bibtexfields.CleanupUrlFormatter; -import org.jabref.logic.formatter.bibtexfields.ClearFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeAmpersandsFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeDollarSignFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter; -import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter; -import org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter; -import org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; -import org.jabref.logic.formatter.bibtexfields.OrdinalsToSuperscriptFormatter; -import org.jabref.logic.formatter.bibtexfields.RegexFormatter; -import org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; -import org.jabref.logic.formatter.bibtexfields.ShortenDOIFormatter; -import org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter; -import org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter; -import org.jabref.logic.formatter.casechanger.CapitalizeFormatter; -import org.jabref.logic.formatter.casechanger.LowerCaseFormatter; -import org.jabref.logic.formatter.casechanger.SentenceCaseFormatter; -import org.jabref.logic.formatter.casechanger.TitleCaseFormatter; -import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; -import org.jabref.logic.formatter.casechanger.UpperCaseFormatter; +import org.jabref.logic.formatter.bibtexfields.*; +import org.jabref.logic.formatter.casechanger.*; import org.jabref.logic.formatter.minifier.MinifyNameListFormatter; import org.jabref.logic.formatter.minifier.TruncateFormatter; import org.jabref.logic.layout.format.LatexToUnicodeFormatter; import org.jabref.logic.layout.format.ReplaceUnicodeLigaturesFormatter; +import java.util.*; +import java.util.regex.Pattern; + public class Formatters { private static final Pattern TRUNCATE_PATTERN = Pattern.compile("\\Atruncate\\d+\\z"); diff --git a/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java b/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java index c5f63de22fa..fe8b65c344e 100644 --- a/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/IdentityFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + /** * It may seem useless, but is needed as a fallback option */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java index 3d787e1f28b..9f378fe2214 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/AddBracesFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + public class AddBracesFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/CleanupUrlFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/CleanupUrlFormatter.java index d9ea4f8ebb0..0e8bda04d98 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/CleanupUrlFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/CleanupUrlFormatter.java @@ -1,5 +1,8 @@ package org.jabref.logic.formatter.bibtexfields; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.logic.l10n.Localization; + import java.net.URLDecoder; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -7,9 +10,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.logic.l10n.Localization; - /** * Cleanup URL link. *

diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java index ec54760965b..bf3bef93f61 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/ClearFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + public class ClearFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java index 6473033eddc..c2196c15fd3 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeAmpersandsFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + public class EscapeAmpersandsFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatter.java index d3f53708614..91f176bb7cb 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Matcher; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Matcher; + public class EscapeDollarSignFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java index 8a5a3c1a3b4..fb6654ea154 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/EscapeUnderscoresFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + public class EscapeUnderscoresFormatter extends Formatter { private static final Pattern UNDERSCORES = Pattern.compile("_"); diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java index 36a0f9c4ee3..76961652c2c 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatter.java @@ -1,18 +1,17 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.HTMLUnicodeConversionMaps; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Objects; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + public class HtmlToLatexFormatter extends Formatter implements LayoutFormatter { private static final Logger LOGGER = LoggerFactory.getLogger(HtmlToLatexFormatter.class); 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 5ff4e95bb71..2b05b93197a 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatter.java @@ -1,12 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; +import org.apache.commons.lang3.StringEscapeUtils; import org.jabref.architecture.ApacheCommonsLang3Allowed; import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatter; -import org.apache.commons.lang3.StringEscapeUtils; - @ApacheCommonsLang3Allowed("There is no equivalent in Google's Guava") public class HtmlToUnicodeFormatter extends Formatter implements LayoutFormatter { 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 731de5c9343..10bd393db34 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/LatexCleanupFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.regex.Pattern; + /** * Simplifies LaTeX syntax. {@see org.jabref.logic.layout.format.RemoveLatexCommandsFormatter} for a formatter removing LaTeX commands completely. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java index 385b36996ca..7d6d949fb1b 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeDateFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Optional; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.Date; +import java.util.Optional; + /** * This class transforms date to the format yyyy-mm-dd or yyyy-mm.. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java index 5dcc74847d2..7b6f430a77f 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeMonthFormatter.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.Month; +import java.util.Objects; +import java.util.Optional; + public class NormalizeMonthFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java index 10383eb983d..7ff44d503f0 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.AuthorList; +import java.util.Objects; + /** * Formatter normalizing a list of person names to the BibTeX format. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java index 8bdb2aef9b4..5d6c916c96a 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatter.java @@ -1,13 +1,13 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * This class includes sensible defaults for consistent formatting of BibTeX page numbers. *

diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java index a686c3ed8aa..598e96813bb 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/OrdinalsToSuperscriptFormatter.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.logic.l10n.Localization; + import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.logic.l10n.Localization; - /** * This class transforms ordinal numbers into LaTeX superscripts. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java index 6a606407189..b8b38ab2d7c 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RegexFormatter.java @@ -1,5 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.logic.l10n.Localization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -7,12 +12,6 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.logic.l10n.Localization; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class RegexFormatter extends Formatter { public static final String KEY = "regex"; private static final Logger LOGGER = LoggerFactory.getLogger(RegexFormatter.class); diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java index 80b5d7c493e..42422f872a8 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveBracesFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + public class RemoveBracesFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveDigitsFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveDigitsFormatter.java index 124b7dc8907..9df95bb3e1f 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveDigitsFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveDigitsFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + public class RemoveDigitsFormatter extends Formatter { private static final Pattern DIGITS = Pattern.compile("[ ]\\d+"); diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java index b31099fcc1a..91f68af49b1 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveHyphenatedNewlinesFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + /** * Removes all hyphenated line breaks in the string. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java index 8f24a0aee0e..f0f75fe8e11 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveNewlinesFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + /** * Removes all line breaks in the string. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveRedundantSpacesFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveRedundantSpacesFormatter.java index 6cdd0ff373b..60eacf22a1b 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveRedundantSpacesFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/RemoveRedundantSpacesFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + /** * Finds any occurrence of consecutive spaces and replaces it with a single space */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/ReplaceTabsBySpaceFormater.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/ReplaceTabsBySpaceFormater.java index 3d42f46a68c..dcc8378fac1 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/ReplaceTabsBySpaceFormater.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/ReplaceTabsBySpaceFormater.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; +import java.util.regex.Pattern; + /** * Replaces any tab with a space */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatter.java index efb71d5396a..3676c512ec6 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatter.java @@ -1,18 +1,17 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; -import java.util.function.Predicate; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.importer.util.ShortDOIService; import org.jabref.logic.importer.util.ShortDOIServiceException; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.DOI; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Objects; +import java.util.function.Predicate; +import java.util.regex.Pattern; + public class ShortenDOIFormatter extends Formatter { private static final Logger LOGGER = LoggerFactory.getLogger(ShortenDOIFormatter.class); diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/TrimWhitespaceFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/TrimWhitespaceFormatter.java index 8f80fdfaeb5..1d11f5d4da9 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/TrimWhitespaceFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/TrimWhitespaceFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + /** * Trim all whitespace characters (as defined in Java) in the beginning and at the end of the string. */ diff --git a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java b/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java index 71825888661..adf2a00fa2c 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatter.java @@ -1,16 +1,15 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.Map; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.HTMLUnicodeConversionMaps; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Map; +import java.util.Objects; + public class UnicodeToLatexFormatter extends Formatter implements LayoutFormatter { private static final Logger LOGGER = LoggerFactory.getLogger(UnicodeToLatexFormatter.class); 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 c8f46580e5c..6ec7c7947ad 100644 --- a/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/bibtexfields/UnitsToLatexFormatter.java @@ -1,15 +1,11 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.strings.StringLengthComparator; +import java.util.*; + public class UnitsToLatexFormatter extends Formatter { private static final List UNIT_LIST = Arrays.asList( diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java b/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java index 9cd84ccb09b..4c20850c905 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatter.java @@ -1,13 +1,13 @@ package org.jabref.logic.formatter.casechanger; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.protectedterms.ProtectedTermsLoader; import org.jabref.logic.util.strings.StringLengthComparator; +import java.util.List; +import java.util.Objects; + /** * Adds {} brackets around acronyms, month names and countries to preserve their case. * diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java b/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java index cd9772e7be4..fde51f83bbb 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Collectors; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.stream.Collectors; + public class SentenceCaseFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java b/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java index b53e5573468..b41a0cd666b 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatter.java @@ -1,11 +1,11 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Collectors; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.stream.Collectors; + public class TitleCaseFormatter extends Formatter { @Override diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatter.java b/src/main/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatter.java index a00ad91a541..35402d22c81 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.casechanger; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + /** * Remove {} braces around words in case they appear balanced * diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/Word.java b/src/main/java/org/jabref/logic/formatter/casechanger/Word.java index db6c40182cc..1d3d3d9daf2 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/Word.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/Word.java @@ -1,10 +1,6 @@ package org.jabref.logic.formatter.casechanger; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; /** diff --git a/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java b/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java index 0c2ccd0ed5e..b85779f7de9 100644 --- a/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.minifier; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + /** * Replaces three or more authors with and others */ diff --git a/src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java b/src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java index 8ee8f76ffc1..274c2f38639 100644 --- a/src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.formatter.minifier; -import java.util.Objects; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; +import java.util.Objects; + public class TruncateFormatter extends Formatter { private final int TRUNCATE_AFTER; private final String KEY; diff --git a/src/main/java/org/jabref/logic/git/GitHandler.java b/src/main/java/org/jabref/logic/git/GitHandler.java index d0322295f09..43176145893 100644 --- a/src/main/java/org/jabref/logic/git/GitHandler.java +++ b/src/main/java/org/jabref/logic/git/GitHandler.java @@ -1,14 +1,5 @@ package org.jabref.logic.git; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Optional; - -import org.jabref.logic.util.io.FileUtil; - import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.RmCommand; import org.eclipse.jgit.api.Status; @@ -17,9 +8,17 @@ import org.eclipse.jgit.merge.MergeStrategy; import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; +import org.jabref.logic.util.io.FileUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + /** * This class handles the updating of the local and remote git repository that is located at the repository path * This provides an easy-to-use interface to manage a git repository diff --git a/src/main/java/org/jabref/logic/git/SlrGitHandler.java b/src/main/java/org/jabref/logic/git/SlrGitHandler.java index 8eccbcb815f..c146cf7746b 100644 --- a/src/main/java/org/jabref/logic/git/SlrGitHandler.java +++ b/src/main/java/org/jabref/logic/git/SlrGitHandler.java @@ -1,19 +1,5 @@ package org.jabref.logic.git; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.StringJoiner; - -import org.jabref.logic.crawler.StudyRepository; - import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.diff.DiffEntry; @@ -23,6 +9,14 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.treewalk.CanonicalTreeParser; +import org.jabref.logic.crawler.StudyRepository; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; public class SlrGitHandler extends GitHandler { diff --git a/src/main/java/org/jabref/logic/importer/AuthorListParser.java b/src/main/java/org/jabref/logic/importer/AuthorListParser.java index 57732dcfeb9..318d5eff69d 100644 --- a/src/main/java/org/jabref/logic/importer/AuthorListParser.java +++ b/src/main/java/org/jabref/logic/importer/AuthorListParser.java @@ -1,19 +1,11 @@ package org.jabref.logic.importer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; import org.jabref.model.strings.StringUtil; +import java.util.*; + public class AuthorListParser { // Avoid partition where these values are contained diff --git a/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java b/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java index 9246eeda857..bf790ff51df 100644 --- a/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java +++ b/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java @@ -1,8 +1,5 @@ package org.jabref.logic.importer; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.importer.fetcher.ArXivFetcher; import org.jabref.logic.importer.fetcher.DoiFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.IsbnFetcher; @@ -11,6 +8,9 @@ import org.jabref.model.entry.identifier.DOI; import org.jabref.model.entry.identifier.ISBN; +import java.util.Optional; +import java.util.stream.Stream; + public class CompositeIdFetcher { private final ImportFormatPreferences importFormatPreferences; diff --git a/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java b/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java index 2cc1544a93f..3d7f05ba3ee 100644 --- a/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java +++ b/src/main/java/org/jabref/logic/importer/EntryBasedFetcher.java @@ -1,9 +1,9 @@ package org.jabref.logic.importer; -import java.util.List; - import org.jabref.model.entry.BibEntry; +import java.util.List; + /** * Searches web resources for bibliographic information based on a {@link BibEntry}. * Useful to complete an existing entry with fetched information. diff --git a/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java index 0adef8aca44..f72a0b4311e 100644 --- a/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/EntryBasedParserFetcher.java @@ -1,5 +1,8 @@ package org.jabref.logic.importer; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.model.entry.BibEntry; + import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; @@ -10,9 +13,6 @@ import java.util.List; import java.util.Objects; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.model.entry.BibEntry; - /** * Provides a convenient interface for entry-based fetcher, which follow the usual three-step procedure: * 1. Open a URL based on the entry diff --git a/src/main/java/org/jabref/logic/importer/FetcherResult.java b/src/main/java/org/jabref/logic/importer/FetcherResult.java index 1561b7a1b12..d3a06bbb136 100644 --- a/src/main/java/org/jabref/logic/importer/FetcherResult.java +++ b/src/main/java/org/jabref/logic/importer/FetcherResult.java @@ -1,9 +1,9 @@ package org.jabref.logic.importer; -import java.net.URL; - import org.jabref.logic.importer.fetcher.TrustLevel; +import java.net.URL; + public final class FetcherResult { private final TrustLevel trust; private final URL source; diff --git a/src/main/java/org/jabref/logic/importer/FulltextFetcher.java b/src/main/java/org/jabref/logic/importer/FulltextFetcher.java index dc578db661c..65a21d67770 100644 --- a/src/main/java/org/jabref/logic/importer/FulltextFetcher.java +++ b/src/main/java/org/jabref/logic/importer/FulltextFetcher.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer; +import org.jabref.logic.importer.fetcher.TrustLevel; +import org.jabref.model.entry.BibEntry; + import java.io.IOException; import java.net.URL; import java.util.Optional; -import org.jabref.logic.importer.fetcher.TrustLevel; -import org.jabref.model.entry.BibEntry; - /** * This interface is used for classes that try to resolve a full-text PDF url for a BibTex entry. * Implementing classes should specialize on specific article sites. diff --git a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java b/src/main/java/org/jabref/logic/importer/FulltextFetchers.java index f74b58eb081..4418d56be27 100644 --- a/src/main/java/org/jabref/logic/importer/FulltextFetchers.java +++ b/src/main/java/org/jabref/logic/importer/FulltextFetchers.java @@ -1,31 +1,21 @@ package org.jabref.logic.importer; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.Callable; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; -import java.util.stream.Collectors; - import org.jabref.gui.JabRefExecutorService; import org.jabref.logic.net.URLDownload; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; +import java.util.concurrent.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; + /** * Utility class for trying to resolve URLs to full-text PDF for articles. * diff --git a/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java b/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java index 62caee59199..59758bc0483 100644 --- a/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdBasedFetcher.java @@ -1,9 +1,9 @@ package org.jabref.logic.importer; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; +import java.util.Optional; + /** * Searches web resources for bibliographic information based on an identifier. * Examples are ISBN numbers and DOIs. diff --git a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java index fb6ed9fa7b0..d5e75c3808a 100644 --- a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java @@ -1,5 +1,11 @@ package org.jabref.logic.importer; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -8,13 +14,6 @@ import java.util.List; import java.util.Optional; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.strings.StringUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Provides a convenient interface for ID-based fetcher, which follow the usual three-step procedure: * 1. Open a URL based on the search query diff --git a/src/main/java/org/jabref/logic/importer/IdFetcher.java b/src/main/java/org/jabref/logic/importer/IdFetcher.java index 110ad4b3038..b9dbee45e5b 100644 --- a/src/main/java/org/jabref/logic/importer/IdFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdFetcher.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.identifier.Identifier; +import java.util.Optional; + /** * Looks for article identifier based on already present bibliographic information. */ diff --git a/src/main/java/org/jabref/logic/importer/IdParserFetcher.java b/src/main/java/org/jabref/logic/importer/IdParserFetcher.java index b9b5ed92e44..b475f4ba144 100644 --- a/src/main/java/org/jabref/logic/importer/IdParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdParserFetcher.java @@ -1,5 +1,11 @@ package org.jabref.logic.importer; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.identifier.Identifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedInputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -11,13 +17,6 @@ import java.util.Objects; import java.util.Optional; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.identifier.Identifier; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Provides a convenient interface for {@link IdFetcher}, which follow the usual three-step procedure: * 1. Open a URL based on the search query diff --git a/src/main/java/org/jabref/logic/importer/ImportCleanup.java b/src/main/java/org/jabref/logic/importer/ImportCleanup.java index c6af4d0a2cd..236787f5b91 100644 --- a/src/main/java/org/jabref/logic/importer/ImportCleanup.java +++ b/src/main/java/org/jabref/logic/importer/ImportCleanup.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer; -import java.util.Collection; - import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; +import java.util.Collection; + public interface ImportCleanup { static ImportCleanup targeting(BibDatabaseMode mode) { diff --git a/src/main/java/org/jabref/logic/importer/ImportFormatReader.java b/src/main/java/org/jabref/logic/importer/ImportFormatReader.java index c7ade9c0708..6916423f1d5 100644 --- a/src/main/java/org/jabref/logic/importer/ImportFormatReader.java +++ b/src/main/java/org/jabref/logic/importer/ImportFormatReader.java @@ -1,42 +1,15 @@ package org.jabref.logic.importer; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.jabref.logic.importer.fileformat.BiblioscapeImporter; -import org.jabref.logic.importer.fileformat.BibtexImporter; -import org.jabref.logic.importer.fileformat.CffImporter; -import org.jabref.logic.importer.fileformat.CitaviXmlImporter; -import org.jabref.logic.importer.fileformat.CopacImporter; -import org.jabref.logic.importer.fileformat.EndnoteImporter; -import org.jabref.logic.importer.fileformat.EndnoteXmlImporter; -import org.jabref.logic.importer.fileformat.InspecImporter; -import org.jabref.logic.importer.fileformat.IsiImporter; -import org.jabref.logic.importer.fileformat.MedlineImporter; -import org.jabref.logic.importer.fileformat.MedlinePlainImporter; -import org.jabref.logic.importer.fileformat.ModsImporter; -import org.jabref.logic.importer.fileformat.MsBibImporter; -import org.jabref.logic.importer.fileformat.OvidImporter; -import org.jabref.logic.importer.fileformat.PdfContentImporter; -import org.jabref.logic.importer.fileformat.PdfEmbeddedBibFileImporter; -import org.jabref.logic.importer.fileformat.PdfGrobidImporter; -import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter; -import org.jabref.logic.importer.fileformat.PdfVerbatimBibTextImporter; -import org.jabref.logic.importer.fileformat.PdfXmpImporter; -import org.jabref.logic.importer.fileformat.RepecNepImporter; -import org.jabref.logic.importer.fileformat.RisImporter; -import org.jabref.logic.importer.fileformat.SilverPlatterImporter; +import org.jabref.logic.importer.fileformat.*; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabases; import org.jabref.model.entry.BibEntry; import org.jabref.model.util.FileUpdateMonitor; +import java.io.IOException; +import java.nio.file.Path; +import java.util.*; + public class ImportFormatReader { public static final String BIBTEX_FORMAT = "BibTeX"; diff --git a/src/main/java/org/jabref/logic/importer/Importer.java b/src/main/java/org/jabref/logic/importer/Importer.java index 451c6ccaf58..82ddc5fc976 100644 --- a/src/main/java/org/jabref/logic/importer/Importer.java +++ b/src/main/java/org/jabref/logic/importer/Importer.java @@ -1,11 +1,14 @@ package org.jabref.logic.importer; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; +import com.ibm.icu.text.CharsetDetector; +import com.ibm.icu.text.CharsetMatch; +import org.jabref.logic.util.FileType; +import org.jabref.logic.util.io.FileUtil; +import org.jabref.model.database.BibDatabaseModeDetection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -14,15 +17,6 @@ import java.util.Arrays; import java.util.Objects; -import org.jabref.logic.util.FileType; -import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.database.BibDatabaseModeDetection; - -import com.ibm.icu.text.CharsetDetector; -import com.ibm.icu.text.CharsetMatch; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Role of an importer for JabRef. */ diff --git a/src/main/java/org/jabref/logic/importer/ImporterPreferences.java b/src/main/java/org/jabref/logic/importer/ImporterPreferences.java index ddf4fe41c90..a232e62677f 100644 --- a/src/main/java/org/jabref/logic/importer/ImporterPreferences.java +++ b/src/main/java/org/jabref/logic/importer/ImporterPreferences.java @@ -1,10 +1,5 @@ package org.jabref.logic.importer; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; @@ -12,10 +7,14 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.collections.ObservableSet; - import org.jabref.logic.importer.fileformat.CustomImporter; import org.jabref.logic.preferences.FetcherApiKey; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.Set; + public class ImporterPreferences { private final BooleanProperty importerEnabled; diff --git a/src/main/java/org/jabref/logic/importer/OpenDatabase.java b/src/main/java/org/jabref/logic/importer/OpenDatabase.java index 6d987c4f84e..0a13c35c760 100644 --- a/src/main/java/org/jabref/logic/importer/OpenDatabase.java +++ b/src/main/java/org/jabref/logic/importer/OpenDatabase.java @@ -1,10 +1,5 @@ package org.jabref.logic.importer; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.List; - import org.jabref.logic.importer.fileformat.BibtexImporter; import org.jabref.migrations.ConvertLegacyExplicitGroups; import org.jabref.migrations.ConvertMarkingToGroups; @@ -12,6 +7,11 @@ import org.jabref.migrations.SpecialFieldsToSeparateFields; import org.jabref.model.util.FileUpdateMonitor; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; + public class OpenDatabase { private OpenDatabase() {} diff --git a/src/main/java/org/jabref/logic/importer/PagedSearchBasedFetcher.java b/src/main/java/org/jabref/logic/importer/PagedSearchBasedFetcher.java index bafae176485..b7186064ba2 100644 --- a/src/main/java/org/jabref/logic/importer/PagedSearchBasedFetcher.java +++ b/src/main/java/org/jabref/logic/importer/PagedSearchBasedFetcher.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.jabref.model.entry.BibEntry; -import org.jabref.model.paging.Page; - import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.paging.Page; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public interface PagedSearchBasedFetcher extends SearchBasedFetcher { diff --git a/src/main/java/org/jabref/logic/importer/PagedSearchBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/PagedSearchBasedParserFetcher.java index f21134d62da..795dbcbacf6 100644 --- a/src/main/java/org/jabref/logic/importer/PagedSearchBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/PagedSearchBasedParserFetcher.java @@ -1,5 +1,9 @@ package org.jabref.logic.importer; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.paging.Page; + import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -7,11 +11,6 @@ import java.net.URL; import java.util.List; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.paging.Page; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; - public interface PagedSearchBasedParserFetcher extends SearchBasedParserFetcher, PagedSearchBasedFetcher { @Override diff --git a/src/main/java/org/jabref/logic/importer/Parser.java b/src/main/java/org/jabref/logic/importer/Parser.java index 86674d78c1f..549e07502aa 100644 --- a/src/main/java/org/jabref/logic/importer/Parser.java +++ b/src/main/java/org/jabref/logic/importer/Parser.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer; +import org.jabref.model.entry.BibEntry; + import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.List; -import org.jabref.model.entry.BibEntry; - /** * A parser converts an {@link InputStream} into a list of {@link BibEntry}. */ diff --git a/src/main/java/org/jabref/logic/importer/ParserResult.java b/src/main/java/org/jabref/logic/importer/ParserResult.java index 703f3377d52..aaa07a23d7c 100644 --- a/src/main/java/org/jabref/logic/importer/ParserResult.java +++ b/src/main/java/org/jabref/logic/importer/ParserResult.java @@ -1,15 +1,5 @@ package org.jabref.logic.importer; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabases; @@ -17,6 +7,9 @@ import org.jabref.model.entry.BibEntryType; import org.jabref.model.metadata.MetaData; +import java.nio.file.Path; +import java.util.*; + public class ParserResult { private final Set entryTypes; private final List warnings = new ArrayList<>(); diff --git a/src/main/java/org/jabref/logic/importer/QueryParser.java b/src/main/java/org/jabref/logic/importer/QueryParser.java index 095d2532d70..1f39331c4be 100644 --- a/src/main/java/org/jabref/logic/importer/QueryParser.java +++ b/src/main/java/org/jabref/logic/importer/QueryParser.java @@ -1,19 +1,13 @@ package org.jabref.logic.importer; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - -import org.jabref.logic.importer.fetcher.ComplexSearchQuery; - import org.apache.lucene.index.Term; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.standard.StandardQueryParser; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; +import org.jabref.logic.importer.fetcher.ComplexSearchQuery; + +import java.util.*; /** * This class converts a query string written in lucene syntax into a complex query. diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java b/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java index 34858548f7e..a8aac29fa75 100644 --- a/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java +++ b/src/main/java/org/jabref/logic/importer/SearchBasedFetcher.java @@ -1,14 +1,13 @@ package org.jabref.logic.importer; -import java.util.Collections; -import java.util.List; - -import org.jabref.model.entry.BibEntry; - import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import org.jabref.model.entry.BibEntry; + +import java.util.Collections; +import java.util.List; import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java index 1d9c2882acf..418b21f2357 100644 --- a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java @@ -1,5 +1,9 @@ package org.jabref.logic.importer; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.cleanup.Formatter; +import org.jabref.model.entry.BibEntry; + import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -7,11 +11,6 @@ import java.net.URL; import java.util.List; -import org.jabref.logic.cleanup.Formatter; -import org.jabref.model.entry.BibEntry; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; - /** * Provides a convenient interface for search-based fetcher, which follows the usual three-step procedure: *

    diff --git a/src/main/java/org/jabref/logic/importer/WebFetcher.java b/src/main/java/org/jabref/logic/importer/WebFetcher.java index a1745cba6d1..267c5032707 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetcher.java +++ b/src/main/java/org/jabref/logic/importer/WebFetcher.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer; -import java.net.URL; -import java.util.Optional; - import org.jabref.logic.help.HelpFile; import org.jabref.logic.net.URLDownload; +import java.net.URL; +import java.util.Optional; + /** * Searches web resources for bibliographic information. */ diff --git a/src/main/java/org/jabref/logic/importer/WebFetchers.java b/src/main/java/org/jabref/logic/importer/WebFetchers.java index 8a3f741a452..a79c8b19754 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetchers.java +++ b/src/main/java/org/jabref/logic/importer/WebFetchers.java @@ -1,50 +1,6 @@ package org.jabref.logic.importer; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.jabref.logic.importer.fetcher.ACMPortalFetcher; -import org.jabref.logic.importer.fetcher.ACS; -import org.jabref.logic.importer.fetcher.ApsFetcher; -import org.jabref.logic.importer.fetcher.ArXivFetcher; -import org.jabref.logic.importer.fetcher.AstrophysicsDataSystem; -import org.jabref.logic.importer.fetcher.BiodiversityLibrary; -import org.jabref.logic.importer.fetcher.BvbFetcher; -import org.jabref.logic.importer.fetcher.CiteSeer; -import org.jabref.logic.importer.fetcher.CompositeSearchBasedFetcher; -import org.jabref.logic.importer.fetcher.CrossRef; -import org.jabref.logic.importer.fetcher.CustomizableKeyFetcher; -import org.jabref.logic.importer.fetcher.DBLPFetcher; -import org.jabref.logic.importer.fetcher.DOABFetcher; -import org.jabref.logic.importer.fetcher.DOAJFetcher; -import org.jabref.logic.importer.fetcher.DiVA; -import org.jabref.logic.importer.fetcher.DoiFetcher; -import org.jabref.logic.importer.fetcher.DoiResolution; -import org.jabref.logic.importer.fetcher.GvkFetcher; -import org.jabref.logic.importer.fetcher.IEEE; -import org.jabref.logic.importer.fetcher.INSPIREFetcher; -import org.jabref.logic.importer.fetcher.IacrEprintFetcher; -import org.jabref.logic.importer.fetcher.IssnFetcher; -import org.jabref.logic.importer.fetcher.LOBIDFetcher; -import org.jabref.logic.importer.fetcher.LibraryOfCongress; -import org.jabref.logic.importer.fetcher.MathSciNet; -import org.jabref.logic.importer.fetcher.MedlineFetcher; -import org.jabref.logic.importer.fetcher.Medra; -import org.jabref.logic.importer.fetcher.OpenAccessDoi; -import org.jabref.logic.importer.fetcher.ResearchGate; -import org.jabref.logic.importer.fetcher.RfcFetcher; -import org.jabref.logic.importer.fetcher.ScholarArchiveFetcher; -import org.jabref.logic.importer.fetcher.ScienceDirect; -import org.jabref.logic.importer.fetcher.SemanticScholar; -import org.jabref.logic.importer.fetcher.SpringerFetcher; -import org.jabref.logic.importer.fetcher.SpringerLink; -import org.jabref.logic.importer.fetcher.TitleFetcher; -import org.jabref.logic.importer.fetcher.ZbMATH; +import org.jabref.logic.importer.fetcher.*; import org.jabref.logic.importer.fetcher.isbntobibtex.IsbnFetcher; import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter; import org.jabref.model.database.BibDatabaseContext; @@ -54,10 +10,9 @@ import org.jabref.model.entry.identifier.Identifier; import org.jabref.preferences.FilePreferences; -import static org.jabref.model.entry.field.StandardField.DOI; -import static org.jabref.model.entry.field.StandardField.EPRINT; -import static org.jabref.model.entry.field.StandardField.ISBN; -import static org.jabref.model.entry.field.StandardField.ISSN; +import java.util.*; + +import static org.jabref.model.entry.field.StandardField.*; public class WebFetchers { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java index 5fd153a07f2..a6e1c4bbcf8 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ACMPortalFetcher.java @@ -1,12 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.Parser; @@ -14,8 +9,8 @@ import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.fileformat.ACMPortalParser; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.*; +import java.util.Optional; public class ACMPortalFetcher implements SearchBasedParserFetcher { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ACS.java b/src/main/java/org/jabref/logic/importer/fetcher/ACS.java index b2fff10f38f..3732469ba82 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ACS.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ACS.java @@ -1,21 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.importer.FulltextFetcher; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; + /** * FulltextFetcher implementation that attempts to find a PDF URL at ACS. */ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java index efa37343f95..ee75709732d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcher.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; @@ -11,6 +9,8 @@ import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.ISBN; +import java.util.Optional; + public abstract class AbstractIsbnFetcher implements IdBasedParserFetcher { protected final ImportFormatPreferences importFormatPreferences; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ApsFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/ApsFetcher.java index 3d589ffa9c7..739dc89909a 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ApsFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ApsFetcher.java @@ -1,21 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.util.Objects; -import java.util.Optional; - +import kong.unirest.Unirest; import org.jabref.logic.importer.FulltextFetcher; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - -import kong.unirest.Unirest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.Objects; +import java.util.Optional; + /** * FulltextFetcher implementation that attempts to find a PDF URL at APS. Also see the API, although it isn't currently used. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java index ec116893d89..f5ecc8afd0e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java @@ -1,36 +1,10 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.stream.Collectors; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.EprintCleanup; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.IdBasedFetcher; -import org.jabref.logic.importer.IdFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.PagedSearchBasedFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.ArXivQueryTransformer; import org.jabref.logic.util.io.XMLUtil; import org.jabref.logic.util.strings.StringSimilarity; @@ -46,15 +20,27 @@ import org.jabref.model.paging.Page; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; - -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.stream.Collectors; + /** * Fetcher for ArXiv that merges fields from arXiv-issued DOIs (and user-issued ones when applicable) to get more information overall. *

    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 edcd3be3f72..0bbbd5e7172 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -1,33 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.MoveFieldCleanup; -import org.jabref.logic.formatter.bibtexfields.ClearFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; -import org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; -import org.jabref.logic.formatter.bibtexfields.RemoveNewlinesFormatter; +import org.jabref.logic.formatter.bibtexfields.*; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.EntryBasedParserFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.PagedSearchBasedParserFetcher; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.net.URLDownload; @@ -38,11 +20,12 @@ import org.jabref.model.paging.Page; import org.jabref.model.strings.StringUtil; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; /** * Fetches data from the SAO/NASA Astrophysics Data System (https://ui.adsabs.harvard.edu/) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java b/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java index 2c739bf3e41..76c98113f0e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.net.URLDownload; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + /** * Convenience class for getting BibTeX entries from the BibSonomy scraper, from an URL pointing to an entry. */ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/BiodiversityLibrary.java b/src/main/java/org/jabref/logic/importer/fetcher/BiodiversityLibrary.java index 49470130345..1a485bae30d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/BiodiversityLibrary.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/BiodiversityLibrary.java @@ -1,19 +1,11 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.IntStream; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.BiodiversityLibraryTransformer; import org.jabref.logic.importer.util.JsonReader; import org.jabref.logic.net.URLDownload; @@ -23,14 +15,17 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.tinylog.Logger; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.IntStream; + /** * Fetches data from the Biodiversity Heritage Library * diff --git a/src/main/java/org/jabref/logic/importer/fetcher/BvbFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/BvbFetcher.java index 7c7bf1695ab..d99e50b1889 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/BvbFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/BvbFetcher.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.SearchBasedParserFetcher; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.fileformat.MarcXmlParser; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Optional; public class BvbFetcher implements SearchBasedParserFetcher { 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 fd9e540a672..96fb689c560 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CiteSeer.java @@ -1,11 +1,10 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - +import kong.unirest.JsonNode; +import kong.unirest.Unirest; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONElement; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.FulltextFetcher; @@ -16,11 +15,11 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import kong.unirest.JsonNode; -import kong.unirest.Unirest; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONElement; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.io.IOException; +import java.net.URL; +import java.util.List; +import java.util.Objects; +import java.util.Optional; public class CiteSeer implements SearchBasedFetcher, FulltextFetcher { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcher.java index 0f596ee71e6..997f2d81e40 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcher.java @@ -1,10 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Arrays; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.RemoveDigitsFormatter; import org.jabref.logic.formatter.bibtexfields.RemoveNewlinesFormatter; @@ -21,8 +18,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Arrays; public class CollectionOfComputerScienceBibliographiesFetcher implements SearchBasedParserFetcher { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParser.java b/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParser.java index 6dabd24b576..94efe6888c8 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParser.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParser.java @@ -1,13 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - import org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; @@ -16,6 +8,14 @@ import org.jabref.logic.net.URLDownload; import org.jabref.model.entry.BibEntry; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + public class CollectionOfComputerScienceBibliographiesParser implements Parser { static final Pattern REGEX_FOR_LINKS = diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ComplexSearchQuery.java b/src/main/java/org/jabref/logic/importer/fetcher/ComplexSearchQuery.java index 32790c2e884..78a0e6ab5a3 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ComplexSearchQuery.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ComplexSearchQuery.java @@ -1,15 +1,9 @@ package org.jabref.logic.importer.fetcher; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.StringJoiner; - +import org.apache.lucene.index.Term; import org.jabref.model.strings.StringUtil; -import org.apache.lucene.index.Term; +import java.util.*; public class ComplexSearchQuery { // Field for non-fielded search diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcher.java index 70a921e25fa..9445db402b6 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcher.java @@ -1,21 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.model.entry.BibEntry; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class CompositeSearchBasedFetcher implements SearchBasedFetcher { public static final String FETCHER_NAME = "Search Selected"; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java index 7c6aa940121..884b8d50459 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java @@ -1,24 +1,14 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.IntStream; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; import org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; -import org.jabref.logic.importer.EntryBasedParserFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.IdParserFetcher; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.util.JsonReader; import org.jabref.logic.util.strings.StringSimilarity; @@ -31,11 +21,14 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.OptionalUtil; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.IntStream; /** * A class for fetching DOIs from CrossRef diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java index e1c60e4324d..1122d26c073 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DBLPFetcher.java @@ -1,12 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.DoiCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanups; @@ -23,8 +18,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.List; +import java.util.Objects; +import java.util.Optional; /** * Fetches BibTeX data from DBLP (dblp.org) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DOABFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DOABFetcher.java index 7b699586bdd..a2ca7fdcc43 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOABFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DOABFetcher.java @@ -1,13 +1,10 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.StringJoiner; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.SearchBasedParserFetcher; @@ -20,11 +17,13 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; /** * fetches books from https://www.doabooks.org/ through 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 10bb8b57c09..7607d3075f6 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DOAJFetcher.java @@ -1,16 +1,9 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; @@ -23,14 +16,20 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + /** * Fetches data from the Directory of Open Access Journals (DOAJ) * diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java b/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java index d8fe06ae991..78221e5c7af 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DiVA.java @@ -1,10 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; @@ -12,7 +8,10 @@ import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.fileformat.BibtexParser; -import org.apache.http.client.utils.URIBuilder; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Optional; /* * http://www.diva-portal.org/smash/aboutdiva.jsf?dswid=-3222 diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java index d503ffd5abc..de338e0f074 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DoiFetcher.java @@ -1,25 +1,14 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLConnection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionException; -import java.util.regex.Pattern; - +import com.google.common.util.concurrent.RateLimiter; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.importer.util.MediaTypes; import org.jabref.logic.l10n.Localization; @@ -29,14 +18,20 @@ import org.jabref.model.entry.identifier.DOI; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.OptionalUtil; - -import com.google.common.util.concurrent.RateLimiter; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.regex.Pattern; + public class DoiFetcher implements IdBasedFetcher, EntryBasedFetcher { public static final String NAME = "DOI"; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java b/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java index c2d59e0b084..80a67c4c9e7 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/DoiResolution.java @@ -1,17 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.logic.importer.FulltextFetcher; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; @@ -21,7 +9,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.UnsupportedMimeTypeException; @@ -31,6 +18,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; + /** * FulltextFetcher implementation that follows the DOI resolution redirects and scans for a full-text PDF URL. * 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 5749fd202ec..904a3cc48f7 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/GoogleScholar.java @@ -1,24 +1,9 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.io.StringReader; -import java.net.HttpCookie; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.PagedSearchBasedFetcher; -import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.ScholarQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.l10n.Localization; @@ -26,15 +11,21 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.paging.Page; - -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.select.Elements; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringReader; +import java.net.HttpCookie; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * FulltextFetcher implementation that attempts to find a PDF URL at GoogleScholar. *

    diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcher.java index 50d7d8c298f..cd6b67cd994 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcher.java @@ -1,27 +1,26 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.SocketTimeoutException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.logic.importer.util.GrobidService; import org.jabref.model.entry.BibEntry; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jooq.lambda.Unchecked; import org.jooq.lambda.UncheckedException; import org.jsoup.HttpStatusException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class GrobidCitationFetcher implements SearchBasedFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(GrobidCitationFetcher.class); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java index 8839fb26eea..f6b817cdc70 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/GvkFetcher.java @@ -1,12 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Arrays; -import java.util.Collection; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; @@ -20,8 +15,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Arrays; +import java.util.Collection; +import java.util.Optional; public class GvkFetcher extends AbstractIsbnFetcher implements SearchBasedParserFetcher { 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 c46c89bf9c0..b9a20fd1735 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IEEE.java @@ -1,5 +1,23 @@ package org.jabref.logic.importer.fetcher; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.help.HelpFile; +import org.jabref.logic.importer.*; +import org.jabref.logic.importer.fetcher.transformers.IEEEQueryTransformer; +import org.jabref.logic.net.URLDownload; +import org.jabref.logic.util.BuildInfo; +import org.jabref.logic.util.OS; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.LinkedFile; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.identifier.DOI; +import org.jabref.model.entry.types.StandardEntryType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -14,30 +32,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.PagedSearchBasedParserFetcher; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.fetcher.transformers.IEEEQueryTransformer; -import org.jabref.logic.net.URLDownload; -import org.jabref.logic.util.BuildInfo; -import org.jabref.logic.util.OS; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.LinkedFile; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.types.StandardEntryType; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Class for finding PDF URLs for entries on IEEE. * Will first look for URLs of the type https://ieeexplore.ieee.org/stamp/stamp.jsp?[tp=&]arnumber=.... 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 99fcfb93a03..1ebfd5f4355 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java @@ -1,24 +1,12 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; import org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultLuceneQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.importer.util.MediaTypes; @@ -28,8 +16,14 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; /** * Fetches data from the INSPIRE database. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java index f6c80017b68..7a0b3904dca 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IacrEprintFetcher.java @@ -1,17 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.regex.Pattern; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.IdBasedFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.l10n.Localization; import org.jabref.logic.net.URLDownload; @@ -19,6 +8,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; +import java.io.IOException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.regex.Pattern; + public class IacrEprintFetcher implements FulltextFetcher, IdBasedFetcher { public static final String NAME = "IACR eprints"; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java index 36411d4e7af..9b89db95d99 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IssnFetcher.java @@ -1,9 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.EntryBasedFetcher; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedFetcher; @@ -11,6 +7,10 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * Fetcher to generate the BibTex entry from an ISSN. * As an ISSN ist just a journal identifier, so we only return journal title and publisher diff --git a/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java index 154616e0571..1512173f019 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/JournalInformationFetcher.java @@ -1,30 +1,23 @@ package org.jabref.logic.importer.fetcher; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Pattern; - import javafx.util.Pair; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.WebFetcher; -import org.jabref.logic.journals.JournalInformation; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.identifier.ISSN; - import kong.unirest.HttpResponse; import kong.unirest.JsonNode; import kong.unirest.Unirest; import kong.unirest.json.JSONArray; import kong.unirest.json.JSONException; import kong.unirest.json.JSONObject; +import org.jabref.logic.importer.FetcherException; +import org.jabref.logic.importer.WebFetcher; +import org.jabref.logic.journals.JournalInformation; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.entry.identifier.ISSN; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.regex.Pattern; + /** * Fetches journal information from the JabRef Web API */ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/JstorFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/JstorFetcher.java index 30a78a6351d..66642f4485e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/JstorFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/JstorFetcher.java @@ -1,5 +1,17 @@ package org.jabref.logic.importer.fetcher; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.importer.*; +import org.jabref.logic.importer.fetcher.transformers.JstorQueryTransformer; +import org.jabref.logic.importer.fileformat.BibtexParser; +import org.jabref.logic.net.URLDownload; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -12,25 +24,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; -import org.jabref.logic.importer.fetcher.transformers.JstorQueryTransformer; -import org.jabref.logic.importer.fileformat.BibtexParser; -import org.jabref.logic.net.URLDownload; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; - -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; - /** * Fetcher for jstor.org **/ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java index ea9e326d538..3a41a516bcf 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/LOBIDFetcher.java @@ -1,17 +1,9 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedParserFetcher; @@ -23,14 +15,21 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + /** * Fetches data from the LOBID API * diff --git a/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java b/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java index 3b4c7f71263..35b86acd7db 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/LibraryOfCongress.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.fileformat.ModsImporter; -import org.apache.http.client.utils.URIBuilder; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; /** * Fetcher for the Library of Congress Control Number (LCCN) using https://lccn.loc.gov/ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java b/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java index cabb40895ee..c38f08da615 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java @@ -1,27 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.DoiCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.MoveFieldCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; -import org.jabref.logic.importer.EntryBasedParserFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.util.OS; @@ -30,16 +18,21 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.util.DummyFileUpdateMonitor; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jbibtex.TokenMgrException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + /** * Fetches data from the MathSciNet (http://www.ams.org/mathscinet) */ 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 3085d500d27..02bcd70d5d9 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java @@ -1,45 +1,39 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLConnection; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.ClearFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import org.jabref.logic.help.HelpFile; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.MedlineQueryTransformer; import org.jabref.logic.importer.fileformat.MedlineImporter; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * Fetch or search from PubMed www.ncbi.nlm.nih.gov * The MedlineFetcher fetches the entries from the PubMed database. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/Medra.java b/src/main/java/org/jabref/logic/importer/fetcher/Medra.java index 47fdbde82e2..11ca0db653d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/Medra.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/Medra.java @@ -1,12 +1,8 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.Optional; -import java.util.stream.IntStream; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; import org.jabref.logic.cleanup.DoiCleanup; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; @@ -22,9 +18,12 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.Optional; +import java.util.stream.IntStream; /** * A class for fetching DOIs from Medra 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 6423af91959..4b16e0bae4b 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MrDLibFetcher.java @@ -1,13 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.EntryBasedFetcher; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ParserResult; @@ -19,11 +12,17 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.MrDlibPreferences; - -import org.apache.http.client.utils.URIBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Optional; + /** * This class is responsible for getting the recommendations from Mr. DLib */ diff --git a/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java b/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java index 32a8af79b5c..92b00e8afc1 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/OpenAccessDoi.java @@ -1,23 +1,22 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; - -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.identifier.DOI; - import kong.unirest.HttpResponse; import kong.unirest.JsonNode; import kong.unirest.Unirest; import kong.unirest.UnirestException; +import org.jabref.logic.importer.FulltextFetcher; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.identifier.DOI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; + /** * A fulltext fetcher that uses oaDOI. * diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ResearchGate.java b/src/main/java/org/jabref/logic/importer/fetcher/ResearchGate.java index c112b2a0bda..fafb1e7257e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ResearchGate.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ResearchGate.java @@ -1,22 +1,8 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.SearchBasedFetcher; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.layout.format.RTFChars; @@ -25,9 +11,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -35,6 +18,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + public class ResearchGate implements FulltextFetcher, EntryBasedFetcher, SearchBasedFetcher { private static final Logger LOGGER = LoggerFactory.getLogger(ResearchGate.class); 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 311642ccfce..8c571c0c710 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/RfcFetcher.java @@ -1,11 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Locale; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedParserFetcher; @@ -13,7 +8,11 @@ import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.fileformat.BibtexParser; -import org.apache.http.client.utils.URIBuilder; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Locale; +import java.util.Optional; /* * https://datatracker.ietf.org diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcher.java index c4cd857fa30..a3b00ba3259 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcher.java @@ -1,13 +1,11 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.IntStream; - +import jakarta.ws.rs.core.MediaType; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.PagedSearchBasedParserFetcher; import org.jabref.logic.importer.ParseException; @@ -20,16 +18,17 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; - -import jakarta.ws.rs.core.MediaType; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.IntStream; + public class ScholarArchiveFetcher implements PagedSearchBasedParserFetcher { public static final String FETCHER_NAME = "ScholarArchive"; 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 00b0023b9f3..87dadf51549 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ScienceDirect.java @@ -1,20 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.net.URLDownload; -import org.jabref.logic.util.BuildInfo; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.identifier.DOI; - import kong.unirest.HttpResponse; import kong.unirest.JsonNode; import kong.unirest.Unirest; @@ -22,6 +7,13 @@ import kong.unirest.json.JSONArray; import kong.unirest.json.JSONException; import kong.unirest.json.JSONObject; +import org.jabref.logic.importer.FulltextFetcher; +import org.jabref.logic.importer.ImporterPreferences; +import org.jabref.logic.net.URLDownload; +import org.jabref.logic.util.BuildInfo; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.identifier.DOI; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Node; @@ -29,6 +21,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + /** * FulltextFetcher implementation that attempts to find a PDF URL at ScienceDirect. * See https://dev.elsevier.com/. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SemanticScholar.java b/src/main/java/org/jabref/logic/importer/fetcher/SemanticScholar.java index e3933661b08..39fdfde9eb1 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SemanticScholar.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SemanticScholar.java @@ -1,24 +1,11 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.FulltextFetcher; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.PagedSearchBasedParserFetcher; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer; import org.jabref.logic.importer.util.JsonReader; import org.jabref.logic.net.URLDownload; @@ -27,18 +14,20 @@ import org.jabref.model.entry.identifier.ArXivIdentifier; import org.jabref.model.entry.identifier.DOI; import org.jabref.model.entry.types.StandardEntryType; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.select.Elements; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + public class SemanticScholar implements FulltextFetcher, PagedSearchBasedParserFetcher, EntryBasedFetcher, CustomizableKeyFetcher { 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 98df2850c0f..a88b352f6c2 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerFetcher.java @@ -1,15 +1,9 @@ package org.jabref.logic.importer.fetcher; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImporterPreferences; @@ -24,14 +18,19 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + /** * Fetches data from the Springer * diff --git a/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java b/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java index a7e7e4d5268..379ce271d0f 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/SpringerLink.java @@ -1,25 +1,24 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; - +import kong.unirest.HttpResponse; +import kong.unirest.JsonNode; +import kong.unirest.Unirest; +import kong.unirest.UnirestException; +import kong.unirest.json.JSONObject; import org.jabref.logic.importer.FulltextFetcher; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.util.BuildInfo; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; - -import kong.unirest.HttpResponse; -import kong.unirest.JsonNode; -import kong.unirest.Unirest; -import kong.unirest.UnirestException; -import kong.unirest.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; + /** * FulltextFetcher implementation that attempts to find a PDF URL at SpringerLink. *

    diff --git a/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java index 04bde616060..bb9a9872e0b 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/TitleFetcher.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.IdBasedFetcher; @@ -12,6 +10,8 @@ import org.jabref.model.entry.identifier.DOI; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class TitleFetcher implements IdBasedFetcher { private final ImportFormatPreferences preferences; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java b/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java index 0d2a0fb43db..800a77a6897 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/ZbMATH.java @@ -1,21 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import kong.unirest.HttpResponse; +import kong.unirest.JsonNode; +import kong.unirest.Unirest; +import kong.unirest.json.JSONArray; +import org.apache.http.client.utils.URIBuilder; +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.MoveFieldCleanup; import org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter; -import org.jabref.logic.importer.EntryBasedParserFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.IdBasedParserFetcher; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.SearchBasedParserFetcher; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.transformers.ZbMathQueryTransformer; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.model.entry.AuthorList; @@ -24,12 +18,12 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; -import kong.unirest.HttpResponse; -import kong.unirest.JsonNode; -import kong.unirest.Unirest; -import kong.unirest.json.JSONArray; -import org.apache.http.client.utils.URIBuilder; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; /** * Fetches data from the Zentralblatt Math (https://www.zbmath.org/) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcher.java index 33734780581..ee30fe375cb 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcher.java @@ -1,13 +1,9 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.stream.IntStream; -import java.util.stream.Stream; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; @@ -19,10 +15,13 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.stream.IntStream; +import java.util.stream.Stream; /** * Fetcher for ISBN using doi-to-bibtex-converter.herokuapp. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcher.java index 6f365d3c699..47194afcfa0 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcher.java @@ -1,9 +1,6 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; @@ -13,7 +10,9 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.apache.http.client.utils.URIBuilder; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; /** * Fetcher for ISBN using https://www.ebook.de. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java index e3ec2dc7b4f..1b49856189c 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcher.java @@ -1,13 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.logic.help.HelpFile; import org.jabref.logic.importer.EntryBasedFetcher; import org.jabref.logic.importer.FetcherException; @@ -19,10 +11,12 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.ISBN; import org.jabref.model.util.OptionalUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.regex.Pattern; + /** * Fetcher to generate the Bibtex entry from an ISBN. * The default fetcher is the {@link OpenLibraryIsbnFetcher}. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcher.java index 77abfde034f..3c4add3345d 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcher.java @@ -1,20 +1,12 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; - -import org.jabref.logic.importer.AuthorListParser; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; +import kong.unirest.JsonNode; +import kong.unirest.Unirest; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.AbstractIsbnFetcher; import org.jabref.logic.importer.util.JsonReader; import org.jabref.model.entry.Author; @@ -24,16 +16,19 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - -import kong.unirest.JsonNode; -import kong.unirest.Unirest; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + /** * Fetcher for OpenLibrary. * API documentation. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/transformers/AbstractQueryTransformer.java b/src/main/java/org/jabref/logic/importer/fetcher/transformers/AbstractQueryTransformer.java index 78cbb1bf358..327d16d2737 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/transformers/AbstractQueryTransformer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/transformers/AbstractQueryTransformer.java @@ -1,20 +1,14 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; -import java.util.StringJoiner; -import java.util.stream.Collectors; - +import org.apache.lucene.queryparser.flexible.core.nodes.*; import org.jabref.model.strings.StringUtil; - -import org.apache.lucene.queryparser.flexible.core.nodes.BooleanQueryNode; -import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; -import org.apache.lucene.queryparser.flexible.core.nodes.GroupQueryNode; -import org.apache.lucene.queryparser.flexible.core.nodes.ModifierQueryNode; -import org.apache.lucene.queryparser.flexible.core.nodes.OrQueryNode; -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; +import java.util.StringJoiner; +import java.util.stream.Collectors; + /** * In case the transformer contains state for a query transformation (such as the {@link IEEEQueryTransformer}), it has to be noted at the JavaDoc. * Otherwise, a single instance QueryTransformer can be used. diff --git a/src/main/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformer.java b/src/main/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformer.java index d7f4c7daa86..a8259194969 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformer.java @@ -1,12 +1,11 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Calendar; -import java.util.Optional; - -import org.jabref.model.strings.StringUtil; - import kong.unirest.json.JSONArray; import kong.unirest.json.JSONObject; +import org.jabref.model.strings.StringUtil; + +import java.util.Calendar; +import java.util.Optional; public class CiteSeerQueryTransformer extends AbstractQueryTransformer { diff --git a/src/main/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformer.java b/src/main/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformer.java index 0c7878c5935..e5ce7d3b31b 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformer.java @@ -1,7 +1,6 @@ package org.jabref.logic.importer.fetcher.transformers; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformer.java b/src/main/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformer.java index 7b649a89078..30af8443e9e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformer.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; + public class GVKQueryTransformer extends YearRangeByFilteringQueryTransformer { private static final Logger LOGGER = LoggerFactory.getLogger(GVKQueryTransformer.class); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformer.java b/src/main/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformer.java index a5015a82fab..eaa02666e7f 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformer.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformer.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer.fetcher.transformers; +import org.jabref.model.strings.StringUtil; + import java.util.List; import java.util.Objects; import java.util.Optional; -import org.jabref.model.strings.StringUtil; - /** * Needs to be instantiated for each new query */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/ACMPortalParser.java b/src/main/java/org/jabref/logic/importer/fileformat/ACMPortalParser.java index bbe9cd738f2..139c191b28a 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ACMPortalParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/ACMPortalParser.java @@ -1,19 +1,12 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - +import com.google.common.base.CaseFormat; +import com.google.common.base.Enums; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.Parser; @@ -23,19 +16,21 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - -import com.google.common.base.CaseFormat; -import com.google.common.base.Enums; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.http.client.utils.URIBuilder; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; +import java.io.IOException; +import java.io.InputStream; +import java.net.*; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + public class ACMPortalParser implements Parser { private static final String HOST = "https://dl.acm.org"; 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 6c388f876db..ece72132a2c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -18,6 +9,10 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; + /** * Imports a Biblioscape Tag File. The format is described on * http://www.biblioscape.com/download/Biblioscape8.pdf Several 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 c4e0ab61cda..027e888c493 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java @@ -1,18 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CodingErrorAction; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.exporter.SaveConfiguration; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; @@ -20,10 +7,18 @@ import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseModeDetection; import org.jabref.model.util.FileUpdateMonitor; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Objects; +import java.util.Optional; + /** * This is a full class to read .bib files. It is used for --import and --importToOpen , too. */ 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 54e81037353..a4c81236e1e 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexParser.java @@ -1,32 +1,10 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.io.PushbackReader; -import java.io.Reader; -import java.io.StringWriter; -import java.util.Collection; -import java.util.Deque; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Pattern; - import org.jabref.logic.bibtex.FieldContentFormatter; import org.jabref.logic.bibtex.FieldWriter; import org.jabref.logic.exporter.BibtexDatabaseWriter; import org.jabref.logic.exporter.SaveConfiguration; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.util.MetaDataParser; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.OS; @@ -43,10 +21,13 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateMonitor; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.*; +import java.util.*; +import java.util.regex.Pattern; + /** * Class for importing BibTeX-files. *

    diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java index 366ddace10b..5093349d348 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java @@ -1,13 +1,9 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -20,10 +16,13 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class CffImporter extends Importer { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java index a9dad33e067..0de6b98be62 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java @@ -1,36 +1,8 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.PushbackInputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.StandardOpenOption; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.StringJoiner; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; import org.jabref.logic.importer.Importer; @@ -41,23 +13,30 @@ import org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData.KnowledgeItems.KnowledgeItem; import org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData.Persons.Person; import org.jabref.logic.util.StandardFileType; -import org.jabref.model.entry.Author; -import org.jabref.model.entry.AuthorList; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.Keyword; -import org.jabref.model.entry.KeywordList; +import org.jabref.model.entry.*; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - -import jakarta.xml.bind.JAXBContext; -import jakarta.xml.bind.JAXBException; -import jakarta.xml.bind.Unmarshaller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + public class CitaviXmlImporter extends Importer implements Parser { private static final Logger LOGGER = LoggerFactory.getLogger(CitaviXmlImporter.class); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CiteSeerParser.java b/src/main/java/org/jabref/logic/importer/fileformat/CiteSeerParser.java index 8c3119b84fe..682f506d6d7 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CiteSeerParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CiteSeerParser.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fileformat; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; import org.jabref.logic.importer.AuthorListParser; import org.jabref.logic.importer.ParseException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; +import java.net.CookieHandler; +import java.net.CookieManager; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; public class CiteSeerParser { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java b/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java index 8d1e410fe05..463670d6507 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CoinsParser.java @@ -1,5 +1,13 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.importer.ParseException; +import org.jabref.logic.importer.Parser; +import org.jabref.logic.util.OS; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.types.StandardEntryType; + import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; @@ -10,14 +18,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.util.OS; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.StandardEntryType; - /** * implemented by reverse-engineering the implementation by CiteSeerX */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java index 6f339b7c570..bee8541c7a1 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java @@ -1,12 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -17,6 +10,13 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import java.util.regex.Pattern; + /** * Importer for COPAC format. *

    diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java index 46fa6a5dec4..51cb1c456a6 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CustomImporter.java @@ -1,5 +1,10 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.importer.ImportException; +import org.jabref.logic.importer.Importer; +import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.util.FileType; + import java.io.BufferedReader; import java.io.IOException; import java.net.URL; @@ -9,11 +14,6 @@ import java.util.List; import java.util.Objects; -import org.jabref.logic.importer.ImportException; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.util.FileType; - /** * Object with data for a custom importer. * 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 2dd92a7844c..9e03e0cae6c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java @@ -1,13 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; @@ -20,6 +12,14 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + /** * Importer for the Refer/Endnote format. * modified to use article number for pages if pages are missing (some diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java index 9e2ef32e206..bbd11052ac8 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java @@ -1,30 +1,7 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.events.XMLEvent; - -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.ParserResult; +import com.google.common.base.Joiner; +import org.jabref.logic.importer.*; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.KeywordList; @@ -36,11 +13,22 @@ import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - -import com.google.common.base.Joiner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.*; + /** * Importer for the Endnote XML format. *

    diff --git a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java index 6df4f86278f..30cf3ee950c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java @@ -1,13 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -19,6 +11,14 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + /** * INSPEC format importer. */ 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 34ac8456a69..94be31146d0 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java @@ -1,17 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.formatter.casechanger.TitleCaseFormatter; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; @@ -24,10 +12,15 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** *

    * Importer for the ISI Web of Science, INSPEC and Medline format. diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MarcXmlParser.java b/src/main/java/org/jabref/logic/importer/fileformat/MarcXmlParser.java index 06dcfae68d0..3a68ae2fee9 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MarcXmlParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MarcXmlParser.java @@ -1,20 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.time.DateTimeException; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - import org.jabref.logic.importer.AuthorListParser; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.Parser; @@ -25,7 +10,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -34,6 +18,20 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.time.DateTimeException; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + /** * A parser for the bavarian flavour (Bibliotheksverbund Bayern) of the marc xml standard *

    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 0fae143357b..ad0c22603e0 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -1,33 +1,10 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.events.XMLEvent; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.importer.fileformat.medline.ArticleId; -import org.jabref.logic.importer.fileformat.medline.Investigator; -import org.jabref.logic.importer.fileformat.medline.MeshHeading; -import org.jabref.logic.importer.fileformat.medline.OtherId; -import org.jabref.logic.importer.fileformat.medline.PersonalNameSubject; +import org.jabref.logic.importer.fileformat.medline.*; import org.jabref.logic.importer.util.MathMLParser; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; @@ -39,10 +16,20 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.*; + /** * Importer for the Medline/Pubmed format. *

    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 3ad6c8c2bcd..22f4861f7e8 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.OS; @@ -21,6 +12,11 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; +import java.util.regex.Pattern; + /** * Importer for the MEDLINE Plain format. *

    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 6c62f0729a2..a2e64a92ff2 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java @@ -1,32 +1,7 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.events.XMLEvent; - -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.Parser; -import org.jabref.logic.importer.ParserResult; +import com.google.common.base.Joiner; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fileformat.mods.Identifier; import org.jabref.logic.importer.fileformat.mods.Name; import org.jabref.logic.importer.fileformat.mods.RecordInfo; @@ -38,11 +13,22 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.EntryTypeFactory; - -import com.google.common.base.Joiner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + /** * Importer for the MODS format.
    * More details about the format can be found here http://www.loc.gov/standards/mods/.
    diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java index dcf10e52a7e..387dd7d063c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java @@ -3,25 +3,24 @@ */ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; - +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; + /** * Handles importing of recommended articles to be displayed in the Related Articles tab. */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java index 0602b9cfe1c..e55506967b0 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java @@ -1,18 +1,9 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.Objects; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.msbib.MSBibDatabase; import org.jabref.logic.util.StandardFileType; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -21,6 +12,13 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.Objects; + /** * Importer for the MS Office 2007 XML bibliography format */ 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 e3de154dfaf..a1dbed1a847 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -22,6 +13,15 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Imports an Ovid file. */ 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 ac140282957..eb2d9ba1483 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java @@ -1,16 +1,8 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringWriter; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import com.google.common.base.Strings; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; @@ -25,9 +17,16 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; -import com.google.common.base.Strings; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.text.PDFTextStripper; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * PdfContentImporter parses data of the first page of the PDF and creates a BibTeX entry. diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java index 6d721ed5d11..efbfa4c7cea 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java @@ -1,13 +1,14 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary; +import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode; +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.pdmodel.common.PDNameTreeNode; +import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; +import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile; +import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; +import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationFileAttachment; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParseException; @@ -19,15 +20,13 @@ import org.jabref.logic.xmp.XmpUtilReader; import org.jabref.model.entry.BibEntry; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary; -import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode; -import org.apache.pdfbox.pdmodel.PDPage; -import org.apache.pdfbox.pdmodel.common.PDNameTreeNode; -import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; -import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile; -import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; -import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationFileAttachment; +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** * PdfEmbeddedBibFileImporter imports an embedded Bib-File from the PDF. diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java index e932bd59eb7..4122332483d 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java @@ -1,12 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; @@ -16,6 +9,13 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + /** * Wraps the GrobidService function to be used as an Importer. */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java index 817931c57a2..46550d8d5fb 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java @@ -1,20 +1,6 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - -import org.jabref.logic.importer.EntryBasedFetcher; -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.importer.*; import org.jabref.logic.importer.fetcher.DoiFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.IsbnFetcher; import org.jabref.logic.importer.util.FileFieldParser; @@ -25,10 +11,14 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.file.Path; +import java.util.*; + /** * PdfEmbeddedBibFileImporter imports an embedded Bib-File from the PDF. */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java index 3ccfbb4398e..a05be045f93 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java @@ -1,12 +1,7 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringWriter; -import java.nio.file.Path; -import java.util.List; -import java.util.Objects; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParseException; @@ -18,8 +13,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.text.PDFTextStripper; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; /** * This importer imports a verbatim BibTeX entry from the first page of the PDF. 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 63fbd861e73..e237213a942 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java @@ -1,10 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Objects; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; @@ -13,6 +8,11 @@ import org.jabref.logic.xmp.XmpUtilReader; import org.jabref.logic.xmp.XmpUtilShared; +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Objects; + /** * Wraps the XMPUtility function to be used as an Importer. */ diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java b/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java index f82165b36bc..d4eb3f02acc 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PicaXmlParser.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.Parser; import org.jabref.model.entry.BibEntry; @@ -17,7 +8,6 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -26,6 +16,14 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + public class PicaXmlParser implements Parser { private static final Logger LOGGER = LoggerFactory.getLogger(PicaXmlParser.class); 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 853c9e28785..4db6b55d5a5 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java @@ -1,13 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; @@ -17,10 +9,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; + /** * Imports a New Economics Papers-Message from the REPEC-NEP Service. *

    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 20fd64e640f..670df7cb9af 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -1,18 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.time.Year; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.OS; @@ -28,6 +15,14 @@ import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.time.Year; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.*; +import java.util.regex.Pattern; + public class RisImporter extends Importer { private static final Pattern RECOGNIZED_FORMAT_PATTERN = Pattern.compile("TY {2}- .*"); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java index 3da5b52de6e..f058251d928 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/SilverPlatterImporter.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Pattern; - import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -20,6 +11,11 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.entry.types.StandardEntryType; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; +import java.util.regex.Pattern; + /** * Imports a SilverPlatter exported file. This is a poor format to parse, so it currently doesn't handle everything correctly. */ diff --git a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java index a7b9efa88c2..5f1068b7a00 100644 --- a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java +++ b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java @@ -1,5 +1,9 @@ package org.jabref.logic.importer.util; +import org.jabref.model.entry.LinkedFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.MalformedURLException; import java.net.URL; import java.nio.file.InvalidPathException; @@ -7,11 +11,6 @@ import java.util.ArrayList; import java.util.List; -import org.jabref.model.entry.LinkedFile; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FileFieldParser { private static final Logger LOGGER = LoggerFactory.getLogger(FileFieldParser.class); 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 8ec7954ec20..9cb65e76231 100644 --- a/src/main/java/org/jabref/logic/importer/util/GrobidService.java +++ b/src/main/java/org/jabref/logic/importer/util/GrobidService.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.util; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.fetcher.GrobidPreferences; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.model.entry.BibEntry; - import org.jsoup.Connection; import org.jsoup.Jsoup; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + /** * Implements an API to a GROBID server, as described at * https://grobid.readthedocs.io/en/latest/Grobid-service/#grobid-web-services diff --git a/src/main/java/org/jabref/logic/importer/util/GroupsParser.java b/src/main/java/org/jabref/logic/importer/util/GroupsParser.java index 053fcf078e1..d1613d1c310 100644 --- a/src/main/java/org/jabref/logic/importer/util/GroupsParser.java +++ b/src/main/java/org/jabref/logic/importer/util/GroupsParser.java @@ -1,11 +1,5 @@ package org.jabref.logic.importer.util; -import java.io.IOException; -import java.nio.file.InvalidPathException; -import java.nio.file.Path; -import java.util.EnumSet; -import java.util.List; - import org.jabref.logic.auxparser.DefaultAuxParser; import org.jabref.logic.groups.DefaultGroupsFactory; import org.jabref.logic.importer.ParseException; @@ -15,25 +9,20 @@ import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.KeywordGroup; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.MetaData; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.FileUpdateMonitor; - import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.util.EnumSet; +import java.util.List; + /** * Converts string representation of groups to a parsed {@link GroupTreeNode}. */ diff --git a/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java b/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java index f6ca61e7b55..b5a80e4c3dc 100644 --- a/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java +++ b/src/main/java/org/jabref/logic/importer/util/IdentifierParser.java @@ -1,19 +1,14 @@ package org.jabref.logic.importer.util; -import java.util.Objects; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.identifier.ARK; -import org.jabref.model.entry.identifier.ArXivIdentifier; -import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.identifier.ISBN; -import org.jabref.model.entry.identifier.Identifier; -import org.jabref.model.entry.identifier.MathSciNetId; +import org.jabref.model.entry.identifier.*; import org.jabref.model.strings.StringUtil; +import java.util.Objects; +import java.util.Optional; + public class IdentifierParser { private final BibEntry entry; diff --git a/src/main/java/org/jabref/logic/importer/util/JsonReader.java b/src/main/java/org/jabref/logic/importer/util/JsonReader.java index cfa8d352c9e..ac1346e4e62 100644 --- a/src/main/java/org/jabref/logic/importer/util/JsonReader.java +++ b/src/main/java/org/jabref/logic/importer/util/JsonReader.java @@ -1,14 +1,13 @@ package org.jabref.logic.importer.util; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; - -import org.jabref.logic.importer.ParseException; - import kong.unirest.json.JSONArray; import kong.unirest.json.JSONException; import kong.unirest.json.JSONObject; +import org.jabref.logic.importer.ParseException; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; /** * Converts an {@link InputStream} into a {@link JSONObject}. diff --git a/src/main/java/org/jabref/logic/importer/util/MathMLParser.java b/src/main/java/org/jabref/logic/importer/util/MathMLParser.java index 5969a7dbf10..b419d02db98 100644 --- a/src/main/java/org/jabref/logic/importer/util/MathMLParser.java +++ b/src/main/java/org/jabref/logic/importer/util/MathMLParser.java @@ -1,5 +1,13 @@ package org.jabref.logic.importer.util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.transform.*; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; @@ -7,19 +15,6 @@ import java.net.URL; import java.util.Objects; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class MathMLParser { private static final Logger LOGGER = LoggerFactory.getLogger(MathMLParser.class); private static final String XSLT_FILE_PATH = "/xslt/mathml_latex/mmltex.xsl"; diff --git a/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java b/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java index 9c3a471f7f1..ce149811bc1 100644 --- a/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java +++ b/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java @@ -1,18 +1,5 @@ package org.jabref.logic.importer.util; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.FieldFormatterCleanups; import org.jabref.logic.importer.ParseException; import org.jabref.model.database.BibDatabaseMode; @@ -26,10 +13,16 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.FileUpdateMonitor; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.nio.file.Path; +import java.util.*; +import java.util.regex.Pattern; + /** * Writing is done at {@link org.jabref.logic.exporter.MetaDataSerializer}. */ 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 f18ed4e5ac0..7361f111976 100644 --- a/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java +++ b/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.util; +import kong.unirest.json.JSONException; +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; +import org.jabref.logic.importer.ParseException; +import org.jabref.logic.net.URLDownload; +import org.jabref.model.entry.identifier.DOI; + import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import org.jabref.logic.importer.ParseException; -import org.jabref.logic.net.URLDownload; -import org.jabref.model.entry.identifier.DOI; - -import kong.unirest.json.JSONException; -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; - /** * Class for obtaining shortened DOI names. See https://shortdoi.org. */ diff --git a/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java b/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java index e4e17c6cb65..038cb12faa2 100644 --- a/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java +++ b/src/main/java/org/jabref/logic/integrity/ASCIICharacterChecker.java @@ -1,14 +1,13 @@ package org.jabref.logic.integrity; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - +import com.google.common.base.CharMatcher; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; -import com.google.common.base.CharMatcher; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; public class ASCIICharacterChecker implements EntryChecker { diff --git a/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java b/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java index e04068f1e55..742f7d0cef7 100644 --- a/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java +++ b/src/main/java/org/jabref/logic/integrity/AbbreviationChecker.java @@ -1,16 +1,16 @@ package org.jabref.logic.integrity; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Set; + public class AbbreviationChecker implements EntryChecker { private final JournalAbbreviationRepository abbreviationRepository; diff --git a/src/main/java/org/jabref/logic/integrity/AmpersandChecker.java b/src/main/java/org/jabref/logic/integrity/AmpersandChecker.java index 786445bc2b8..6155c3bb2f0 100644 --- a/src/main/java/org/jabref/logic/integrity/AmpersandChecker.java +++ b/src/main/java/org/jabref/logic/integrity/AmpersandChecker.java @@ -1,19 +1,17 @@ package org.jabref.logic.integrity; -import java.util.List; -import java.util.Map; -import java.util.regex.MatchResult; -import java.util.regex.Pattern; -import java.util.stream.Stream; - +import com.google.common.base.CharMatcher; import javafx.util.Pair; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; -import com.google.common.base.CharMatcher; +import java.util.List; +import java.util.Map; +import java.util.regex.MatchResult; +import java.util.regex.Pattern; +import java.util.stream.Stream; /** * Checks if the BibEntry contains unescaped ampersands. diff --git a/src/main/java/org/jabref/logic/integrity/BibStringChecker.java b/src/main/java/org/jabref/logic/integrity/BibStringChecker.java index 8f85020fe93..94c209c137e 100644 --- a/src/main/java/org/jabref/logic/integrity/BibStringChecker.java +++ b/src/main/java/org/jabref/logic/integrity/BibStringChecker.java @@ -1,17 +1,17 @@ package org.jabref.logic.integrity; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.logic.bibtex.FieldWriter; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Checks, if there is an even number of unescaped # (FieldWriter.BIBTEX_STRING_START_END_SYMBOL) */ diff --git a/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java b/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java index 528ee5d1dce..77509ed4bfa 100644 --- a/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java +++ b/src/main/java/org/jabref/logic/integrity/BibTeXEntryTypeChecker.java @@ -1,13 +1,13 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.types.EntryTypeFactory; +import java.util.Collections; +import java.util.List; + /** * BibTeX mode only checker */ diff --git a/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java b/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java index 3ed8b36a6e7..54e871fd6f0 100644 --- a/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java +++ b/src/main/java/org/jabref/logic/integrity/BooktitleChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Locale; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.Locale; +import java.util.Optional; + public class BooktitleChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/BracketChecker.java b/src/main/java/org/jabref/logic/integrity/BracketChecker.java index bff56b03770..8cf2c7265a9 100644 --- a/src/main/java/org/jabref/logic/integrity/BracketChecker.java +++ b/src/main/java/org/jabref/logic/integrity/BracketChecker.java @@ -1,10 +1,10 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class BracketChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/CitationKeyChecker.java b/src/main/java/org/jabref/logic/integrity/CitationKeyChecker.java index 931bdd1a52e..a8e21da2b5c 100644 --- a/src/main/java/org/jabref/logic/integrity/CitationKeyChecker.java +++ b/src/main/java/org/jabref/logic/integrity/CitationKeyChecker.java @@ -1,15 +1,15 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + /** * Currently only checks the key if there is an author, year, and title present. */ diff --git a/src/main/java/org/jabref/logic/integrity/CitationKeyDeviationChecker.java b/src/main/java/org/jabref/logic/integrity/CitationKeyDeviationChecker.java index b5d08d0a73c..14f0b5f9402 100644 --- a/src/main/java/org/jabref/logic/integrity/CitationKeyDeviationChecker.java +++ b/src/main/java/org/jabref/logic/integrity/CitationKeyDeviationChecker.java @@ -1,10 +1,5 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.l10n.Localization; @@ -12,6 +7,11 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class CitationKeyDeviationChecker implements EntryChecker { private final BibDatabaseContext bibDatabaseContext; diff --git a/src/main/java/org/jabref/logic/integrity/CitationKeyDuplicationChecker.java b/src/main/java/org/jabref/logic/integrity/CitationKeyDuplicationChecker.java index ae222225e26..9633b344d27 100644 --- a/src/main/java/org/jabref/logic/integrity/CitationKeyDuplicationChecker.java +++ b/src/main/java/org/jabref/logic/integrity/CitationKeyDuplicationChecker.java @@ -1,15 +1,15 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class CitationKeyDuplicationChecker implements EntryChecker { private final BibDatabase database; diff --git a/src/main/java/org/jabref/logic/integrity/DatabaseChecker.java b/src/main/java/org/jabref/logic/integrity/DatabaseChecker.java index 0f03cccce63..e9285733d9c 100644 --- a/src/main/java/org/jabref/logic/integrity/DatabaseChecker.java +++ b/src/main/java/org/jabref/logic/integrity/DatabaseChecker.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.List; - import org.jabref.model.database.BibDatabase; +import java.util.List; + @FunctionalInterface public interface DatabaseChecker { List check(BibDatabase database); diff --git a/src/main/java/org/jabref/logic/integrity/DateChecker.java b/src/main/java/org/jabref/logic/integrity/DateChecker.java index 83f0077b8aa..8ae9240890a 100644 --- a/src/main/java/org/jabref/logic/integrity/DateChecker.java +++ b/src/main/java/org/jabref/logic/integrity/DateChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.Date; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class DateChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/DoiDuplicationChecker.java b/src/main/java/org/jabref/logic/integrity/DoiDuplicationChecker.java index bf01dbafd39..41bdd0a9afa 100644 --- a/src/main/java/org/jabref/logic/integrity/DoiDuplicationChecker.java +++ b/src/main/java/org/jabref/logic/integrity/DoiDuplicationChecker.java @@ -1,19 +1,17 @@ package org.jabref.logic.integrity; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import javafx.collections.ObservableList; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.identifier.DOI; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; public class DoiDuplicationChecker implements DatabaseChecker { diff --git a/src/main/java/org/jabref/logic/integrity/DoiValidityChecker.java b/src/main/java/org/jabref/logic/integrity/DoiValidityChecker.java index a78c8b4d0ea..1d841cd01d1 100644 --- a/src/main/java/org/jabref/logic/integrity/DoiValidityChecker.java +++ b/src/main/java/org/jabref/logic/integrity/DoiValidityChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.DOI; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class DoiValidityChecker implements ValueChecker { @Override public Optional checkValue(String value) { diff --git a/src/main/java/org/jabref/logic/integrity/EditionChecker.java b/src/main/java/org/jabref/logic/integrity/EditionChecker.java index 80252570edc..c6297a81969 100644 --- a/src/main/java/org/jabref/logic/integrity/EditionChecker.java +++ b/src/main/java/org/jabref/logic/integrity/EditionChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.strings.StringUtil; + import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.strings.StringUtil; - public class EditionChecker implements ValueChecker { private static final Predicate FIRST_LETTER_CAPITALIZED = diff --git a/src/main/java/org/jabref/logic/integrity/EntryChecker.java b/src/main/java/org/jabref/logic/integrity/EntryChecker.java index bcbe0e79769..67e911bd2e9 100644 --- a/src/main/java/org/jabref/logic/integrity/EntryChecker.java +++ b/src/main/java/org/jabref/logic/integrity/EntryChecker.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.List; - import org.jabref.model.entry.BibEntry; +import java.util.List; + @FunctionalInterface public interface EntryChecker { List check(BibEntry entry); diff --git a/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java b/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java index 3837f9c0e33..4a849037778 100644 --- a/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java +++ b/src/main/java/org/jabref/logic/integrity/EntryLinkChecker.java @@ -1,18 +1,14 @@ package org.jabref.logic.integrity; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; +import java.util.*; +import java.util.Map.Entry; + public class EntryLinkChecker implements EntryChecker { private final BibDatabase database; diff --git a/src/main/java/org/jabref/logic/integrity/FieldChecker.java b/src/main/java/org/jabref/logic/integrity/FieldChecker.java index 0564eca6df6..f0eac08fc0b 100644 --- a/src/main/java/org/jabref/logic/integrity/FieldChecker.java +++ b/src/main/java/org/jabref/logic/integrity/FieldChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.util.OptionalUtil; + import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.util.OptionalUtil; - /** * This is a "proxy" to use a {@link ValueChecker} as {@link EntryChecker}. * The "proxy" is configured using the field to handle and the value checker to apply. diff --git a/src/main/java/org/jabref/logic/integrity/FieldCheckers.java b/src/main/java/org/jabref/logic/integrity/FieldCheckers.java index 918d38b6b93..0f6846e959e 100644 --- a/src/main/java/org/jabref/logic/integrity/FieldCheckers.java +++ b/src/main/java/org/jabref/logic/integrity/FieldCheckers.java @@ -1,9 +1,7 @@ package org.jabref.logic.integrity; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.field.Field; @@ -12,8 +10,9 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.FilePreferences; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; public class FieldCheckers { diff --git a/src/main/java/org/jabref/logic/integrity/FileChecker.java b/src/main/java/org/jabref/logic/integrity/FileChecker.java index 640cb3f79a8..6b856239e88 100644 --- a/src/main/java/org/jabref/logic/integrity/FileChecker.java +++ b/src/main/java/org/jabref/logic/integrity/FileChecker.java @@ -1,11 +1,5 @@ package org.jabref.logic.integrity; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.logic.importer.util.FileFieldParser; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; @@ -13,6 +7,12 @@ import org.jabref.model.strings.StringUtil; import org.jabref.preferences.FilePreferences; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + public class FileChecker implements ValueChecker { private final BibDatabaseContext context; diff --git a/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java b/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java index 40628ad74a0..06d94a19ae9 100644 --- a/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java +++ b/src/main/java/org/jabref/logic/integrity/HTMLCharacterChecker.java @@ -1,12 +1,12 @@ package org.jabref.logic.integrity; -import java.util.List; -import java.util.regex.Pattern; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.FieldProperty; +import java.util.List; +import java.util.regex.Pattern; + /** * Checks, if there are any HTML encoded characters in nonverbatim fields. */ diff --git a/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java b/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java index f074443385f..ef51df312f3 100644 --- a/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java +++ b/src/main/java/org/jabref/logic/integrity/HowPublishedChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.strings.StringUtil; + import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.strings.StringUtil; - public class HowPublishedChecker implements ValueChecker { private static final Predicate FIRST_LETTER_CAPITALIZED = diff --git a/src/main/java/org/jabref/logic/integrity/ISBNChecker.java b/src/main/java/org/jabref/logic/integrity/ISBNChecker.java index c774dc9148a..b454a75b82c 100644 --- a/src/main/java/org/jabref/logic/integrity/ISBNChecker.java +++ b/src/main/java/org/jabref/logic/integrity/ISBNChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.ISBN; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class ISBNChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/ISSNChecker.java b/src/main/java/org/jabref/logic/integrity/ISSNChecker.java index f7205d195b5..0338b57b371 100644 --- a/src/main/java/org/jabref/logic/integrity/ISSNChecker.java +++ b/src/main/java/org/jabref/logic/integrity/ISSNChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.identifier.ISSN; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class ISSNChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java b/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java index c8e2bc23c11..a88e70fc113 100644 --- a/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java +++ b/src/main/java/org/jabref/logic/integrity/IntegrityCheck.java @@ -1,9 +1,5 @@ package org.jabref.logic.integrity; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; @@ -12,6 +8,10 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.FilePreferences; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + public class IntegrityCheck { private final BibDatabaseContext bibDatabaseContext; diff --git a/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java b/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java index 5dc8e0d0b9a..5a950c301a8 100644 --- a/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java +++ b/src/main/java/org/jabref/logic/integrity/IntegrityMessage.java @@ -1,10 +1,10 @@ package org.jabref.logic.integrity; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; +import java.util.Objects; + public final class IntegrityMessage implements Cloneable { private final BibEntry entry; private final Field field; diff --git a/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java b/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java index 4cca97cf860..23bbf9eba00 100644 --- a/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java +++ b/src/main/java/org/jabref/logic/integrity/JournalInAbbreviationListChecker.java @@ -1,15 +1,15 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class JournalInAbbreviationListChecker implements EntryChecker { private final Field field; diff --git a/src/main/java/org/jabref/logic/integrity/LatexIntegrityChecker.java b/src/main/java/org/jabref/logic/integrity/LatexIntegrityChecker.java index 806cda8414d..7229c03ebbc 100644 --- a/src/main/java/org/jabref/logic/integrity/LatexIntegrityChecker.java +++ b/src/main/java/org/jabref/logic/integrity/LatexIntegrityChecker.java @@ -1,32 +1,21 @@ package org.jabref.logic.integrity; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.stream.Stream; - import javafx.util.Pair; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldProperty; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import uk.ac.ed.ph.snuggletex.ErrorCode; -import uk.ac.ed.ph.snuggletex.InputError; -import uk.ac.ed.ph.snuggletex.SnuggleEngine; -import uk.ac.ed.ph.snuggletex.SnuggleInput; -import uk.ac.ed.ph.snuggletex.SnugglePackage; -import uk.ac.ed.ph.snuggletex.SnuggleSession; +import uk.ac.ed.ph.snuggletex.*; import uk.ac.ed.ph.snuggletex.definitions.CoreErrorCode; import uk.ac.ed.ph.snuggletex.definitions.CoreErrorGroup; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.*; +import java.util.stream.Stream; + import static uk.ac.ed.ph.snuggletex.definitions.Globals.TEXT_MODE_ONLY; /** diff --git a/src/main/java/org/jabref/logic/integrity/MonthChecker.java b/src/main/java/org/jabref/logic/integrity/MonthChecker.java index 73a2d57903f..32c3f1d3f62 100644 --- a/src/main/java/org/jabref/logic/integrity/MonthChecker.java +++ b/src/main/java/org/jabref/logic/integrity/MonthChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.strings.StringUtil; + import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.strings.StringUtil; - public class MonthChecker implements ValueChecker { private static final Predicate ONLY_AN_INTEGER = diff --git a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java index adeb9de69b6..dc07dbe47fc 100644 --- a/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoBibtexFieldChecker.java @@ -1,9 +1,5 @@ package org.jabref.logic.integrity; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.BibField; @@ -12,6 +8,10 @@ import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions; import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + /** * This checker checks whether the entry does not contain any field appearing only in biblatex (and not in BibTeX) */ diff --git a/src/main/java/org/jabref/logic/integrity/NoteChecker.java b/src/main/java/org/jabref/logic/integrity/NoteChecker.java index 693640da256..7ba2a7bfc0d 100644 --- a/src/main/java/org/jabref/logic/integrity/NoteChecker.java +++ b/src/main/java/org/jabref/logic/integrity/NoteChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.strings.StringUtil; + import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.strings.StringUtil; - public class NoteChecker implements ValueChecker { private static final Predicate FIRST_LETTER_CAPITALIZED = diff --git a/src/main/java/org/jabref/logic/integrity/PagesChecker.java b/src/main/java/org/jabref/logic/integrity/PagesChecker.java index 4b1290d7907..bb11d620453 100644 --- a/src/main/java/org/jabref/logic/integrity/PagesChecker.java +++ b/src/main/java/org/jabref/logic/integrity/PagesChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.strings.StringUtil; + import java.util.Arrays; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.strings.StringUtil; - public class PagesChecker implements ValueChecker { private static final String PAGES_EXP_BIBTEX = "" diff --git a/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java b/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java index 2adc64825b9..4c5a1f18ac7 100644 --- a/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java +++ b/src/main/java/org/jabref/logic/integrity/PersonNamesChecker.java @@ -1,8 +1,5 @@ package org.jabref.logic.integrity; -import java.util.Locale; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.format.RemoveBrackets; import org.jabref.model.database.BibDatabaseContext; @@ -10,6 +7,9 @@ import org.jabref.model.entry.AuthorList; import org.jabref.model.strings.StringUtil; +import java.util.Locale; +import java.util.Optional; + public class PersonNamesChecker implements ValueChecker { private final BibDatabaseMode bibMode; diff --git a/src/main/java/org/jabref/logic/integrity/TitleChecker.java b/src/main/java/org/jabref/logic/integrity/TitleChecker.java index 4b3858a452f..fe1eb55cab6 100644 --- a/src/main/java/org/jabref/logic/integrity/TitleChecker.java +++ b/src/main/java/org/jabref/logic/integrity/TitleChecker.java @@ -1,13 +1,13 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.regex.Pattern; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.strings.StringUtil; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.regex.Pattern; + public class TitleChecker implements ValueChecker { private static final Pattern INSIDE_CURLY_BRAKETS = Pattern.compile("\\{[^}\\{]*\\}"); diff --git a/src/main/java/org/jabref/logic/integrity/TypeChecker.java b/src/main/java/org/jabref/logic/integrity/TypeChecker.java index a22663e53bf..b9862ffd2af 100644 --- a/src/main/java/org/jabref/logic/integrity/TypeChecker.java +++ b/src/main/java/org/jabref/logic/integrity/TypeChecker.java @@ -1,14 +1,14 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + public class TypeChecker implements EntryChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/UTF8Checker.java b/src/main/java/org/jabref/logic/integrity/UTF8Checker.java index b13c47bd25f..a53dcacda42 100644 --- a/src/main/java/org/jabref/logic/integrity/UTF8Checker.java +++ b/src/main/java/org/jabref/logic/integrity/UTF8Checker.java @@ -1,5 +1,9 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; + import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; @@ -9,10 +13,6 @@ import java.util.List; import java.util.Map; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; - public class UTF8Checker implements EntryChecker { private final Charset charset; diff --git a/src/main/java/org/jabref/logic/integrity/UrlChecker.java b/src/main/java/org/jabref/logic/integrity/UrlChecker.java index 8d99968ac96..ac02f15a9dc 100644 --- a/src/main/java/org/jabref/logic/integrity/UrlChecker.java +++ b/src/main/java/org/jabref/logic/integrity/UrlChecker.java @@ -1,10 +1,10 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + public class UrlChecker implements ValueChecker { @Override diff --git a/src/main/java/org/jabref/logic/integrity/ValidCitationKeyChecker.java b/src/main/java/org/jabref/logic/integrity/ValidCitationKeyChecker.java index e23fcb2b41e..61890502f34 100644 --- a/src/main/java/org/jabref/logic/integrity/ValidCitationKeyChecker.java +++ b/src/main/java/org/jabref/logic/integrity/ValidCitationKeyChecker.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + /** * Makes sure the key is legal */ diff --git a/src/main/java/org/jabref/logic/integrity/YearChecker.java b/src/main/java/org/jabref/logic/integrity/YearChecker.java index 0c6102da650..dd9339c00b3 100644 --- a/src/main/java/org/jabref/logic/integrity/YearChecker.java +++ b/src/main/java/org/jabref/logic/integrity/YearChecker.java @@ -1,12 +1,12 @@ package org.jabref.logic.integrity; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.strings.StringUtil; + import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -import org.jabref.logic.l10n.Localization; -import org.jabref.model.strings.StringUtil; - public class YearChecker implements ValueChecker { private static final Predicate CONTAINS_FOUR_DIGIT = diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationParser.java b/src/main/java/org/jabref/logic/journals/AbbreviationParser.java index b0f0d205f9b..31406f94678 100644 --- a/src/main/java/org/jabref/logic/journals/AbbreviationParser.java +++ b/src/main/java/org/jabref/logic/journals/AbbreviationParser.java @@ -1,5 +1,8 @@ package org.jabref.logic.journals; +import org.apache.commons.csv.CSVParser; +import org.apache.commons.csv.CSVRecord; + import java.io.BufferedReader; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -9,9 +12,6 @@ import java.util.Collection; import java.util.LinkedHashSet; -import org.apache.commons.csv.CSVParser; -import org.apache.commons.csv.CSVRecord; - /** * Reads abbreviation files (CSV format) into a list of Abbreviations. */ diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java b/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java index 38735c33177..f85390141a0 100644 --- a/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java +++ b/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java @@ -1,5 +1,7 @@ package org.jabref.logic.journals; +import org.apache.commons.csv.CSVPrinter; + import java.io.IOException; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; @@ -7,8 +9,6 @@ import java.nio.file.Path; import java.util.List; -import org.apache.commons.csv.CSVPrinter; - /** * This class provides handy static methods to save abbreviations to the file system. */ diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java b/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java index 41302d902e5..9ee15722d71 100644 --- a/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java +++ b/src/main/java/org/jabref/logic/journals/JournalAbbreviationLoader.java @@ -1,5 +1,8 @@ package org.jabref.logic.journals; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; @@ -8,9 +11,6 @@ import java.util.Collections; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** *

    * This class loads abbreviations from a CSV file and stores them into a MV file ({@link #readAbbreviationsFromCsvFile(Path)} diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java b/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java index 70d59254d91..26230ebbf7d 100644 --- a/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java +++ b/src/main/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java @@ -1,12 +1,12 @@ package org.jabref.logic.journals; -import java.util.List; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class JournalAbbreviationPreferences { private final ObservableList externalJournalLists; diff --git a/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java b/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java index 9df82886d22..96b047cc4ca 100644 --- a/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java +++ b/src/main/java/org/jabref/logic/journals/JournalAbbreviationRepository.java @@ -1,19 +1,13 @@ package org.jabref.logic.journals; +import org.h2.mvstore.MVMap; +import org.h2.mvstore.MVStore; + import java.nio.file.Path; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.h2.mvstore.MVMap; -import org.h2.mvstore.MVStore; - /** * A repository for all journal abbreviations, including add and find methods. */ diff --git a/src/main/java/org/jabref/logic/journals/JournalInformation.java b/src/main/java/org/jabref/logic/journals/JournalInformation.java index 8df73506309..531596b2746 100644 --- a/src/main/java/org/jabref/logic/journals/JournalInformation.java +++ b/src/main/java/org/jabref/logic/journals/JournalInformation.java @@ -1,9 +1,9 @@ package org.jabref.logic.journals; -import java.util.List; - import javafx.util.Pair; +import java.util.List; + public record JournalInformation( String title, String publisher, diff --git a/src/main/java/org/jabref/logic/l10n/Localization.java b/src/main/java/org/jabref/logic/l10n/Localization.java index 6a3e42333fe..5baba31188a 100644 --- a/src/main/java/org/jabref/logic/l10n/Localization.java +++ b/src/main/java/org/jabref/logic/l10n/Localization.java @@ -1,23 +1,11 @@ package org.jabref.logic.l10n; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.Objects; -import java.util.Optional; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.architecture.AllowedToUseStandardStreams; - import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.stream.Collectors; + /** * Provides handling for messages and menu entries in the preferred language of the user. *

    diff --git a/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java b/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java index 90034e8440a..9a749a92345 100644 --- a/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java +++ b/src/main/java/org/jabref/logic/l10n/LocalizationLocator.java @@ -1,9 +1,9 @@ package org.jabref.logic.l10n; -import java.util.ResourceBundle; - import com.airhacks.afterburner.views.ResourceLocator; +import java.util.ResourceBundle; + public class LocalizationLocator implements ResourceLocator { @Override public ResourceBundle getResourceBundle(String s) { diff --git a/src/main/java/org/jabref/logic/layout/Layout.java b/src/main/java/org/jabref/logic/layout/Layout.java index 5a4555a4baa..901096e305c 100644 --- a/src/main/java/org/jabref/logic/layout/Layout.java +++ b/src/main/java/org/jabref/logic/layout/Layout.java @@ -1,19 +1,18 @@ package org.jabref.logic.layout; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + public class Layout { private static final Logger LOGGER = LoggerFactory.getLogger(Layout.class); diff --git a/src/main/java/org/jabref/logic/layout/LayoutEntry.java b/src/main/java/org/jabref/logic/layout/LayoutEntry.java index 25114d9ac57..9d95aad188a 100644 --- a/src/main/java/org/jabref/logic/layout/LayoutEntry.java +++ b/src/main/java/org/jabref/logic/layout/LayoutEntry.java @@ -1,89 +1,10 @@ package org.jabref.logic.layout; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter; import org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter; import org.jabref.logic.journals.JournalAbbreviationRepository; -import org.jabref.logic.layout.format.AuthorAbbreviator; -import org.jabref.logic.layout.format.AuthorAndToSemicolonReplacer; -import org.jabref.logic.layout.format.AuthorAndsCommaReplacer; -import org.jabref.logic.layout.format.AuthorAndsReplacer; -import org.jabref.logic.layout.format.AuthorFirstAbbrLastCommas; -import org.jabref.logic.layout.format.AuthorFirstAbbrLastOxfordCommas; -import org.jabref.logic.layout.format.AuthorFirstFirst; -import org.jabref.logic.layout.format.AuthorFirstFirstCommas; -import org.jabref.logic.layout.format.AuthorFirstLastCommas; -import org.jabref.logic.layout.format.AuthorFirstLastOxfordCommas; -import org.jabref.logic.layout.format.AuthorLF_FF; -import org.jabref.logic.layout.format.AuthorLF_FFAbbr; -import org.jabref.logic.layout.format.AuthorLastFirst; -import org.jabref.logic.layout.format.AuthorLastFirstAbbrCommas; -import org.jabref.logic.layout.format.AuthorLastFirstAbbrOxfordCommas; -import org.jabref.logic.layout.format.AuthorLastFirstAbbreviator; -import org.jabref.logic.layout.format.AuthorLastFirstCommas; -import org.jabref.logic.layout.format.AuthorLastFirstOxfordCommas; -import org.jabref.logic.layout.format.AuthorNatBib; -import org.jabref.logic.layout.format.AuthorOrgSci; -import org.jabref.logic.layout.format.Authors; -import org.jabref.logic.layout.format.CSLType; -import org.jabref.logic.layout.format.CompositeFormat; -import org.jabref.logic.layout.format.CreateBibORDFAuthors; -import org.jabref.logic.layout.format.CreateDocBook4Authors; -import org.jabref.logic.layout.format.CreateDocBook4Editors; -import org.jabref.logic.layout.format.CreateDocBook5Authors; -import org.jabref.logic.layout.format.CreateDocBook5Editors; -import org.jabref.logic.layout.format.CurrentDate; -import org.jabref.logic.layout.format.DOICheck; -import org.jabref.logic.layout.format.DOIStrip; -import org.jabref.logic.layout.format.DateFormatter; -import org.jabref.logic.layout.format.Default; -import org.jabref.logic.layout.format.EntryTypeFormatter; -import org.jabref.logic.layout.format.FileLink; -import org.jabref.logic.layout.format.FirstPage; -import org.jabref.logic.layout.format.FormatPagesForHTML; -import org.jabref.logic.layout.format.FormatPagesForXML; -import org.jabref.logic.layout.format.GetOpenOfficeType; -import org.jabref.logic.layout.format.HTMLChars; -import org.jabref.logic.layout.format.HTMLParagraphs; -import org.jabref.logic.layout.format.HayagrivaType; -import org.jabref.logic.layout.format.IfPlural; -import org.jabref.logic.layout.format.Iso690FormatDate; -import org.jabref.logic.layout.format.Iso690NamesAuthors; -import org.jabref.logic.layout.format.JournalAbbreviator; -import org.jabref.logic.layout.format.LastPage; -import org.jabref.logic.layout.format.LatexToUnicodeFormatter; -import org.jabref.logic.layout.format.MarkdownFormatter; -import org.jabref.logic.layout.format.NameFormatter; -import org.jabref.logic.layout.format.NoSpaceBetweenAbbreviations; -import org.jabref.logic.layout.format.NotFoundFormatter; import org.jabref.logic.layout.format.Number; -import org.jabref.logic.layout.format.Ordinal; -import org.jabref.logic.layout.format.RTFChars; -import org.jabref.logic.layout.format.RemoveBrackets; -import org.jabref.logic.layout.format.RemoveBracketsAddComma; -import org.jabref.logic.layout.format.RemoveLatexCommandsFormatter; -import org.jabref.logic.layout.format.RemoveTilde; -import org.jabref.logic.layout.format.RemoveWhitespace; -import org.jabref.logic.layout.format.Replace; -import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes; -import org.jabref.logic.layout.format.RisAuthors; -import org.jabref.logic.layout.format.RisKeywords; -import org.jabref.logic.layout.format.RisMonth; -import org.jabref.logic.layout.format.ShortMonthFormatter; -import org.jabref.logic.layout.format.ToLowerCase; -import org.jabref.logic.layout.format.ToUpperCase; -import org.jabref.logic.layout.format.WrapContent; -import org.jabref.logic.layout.format.WrapFileLinks; -import org.jabref.logic.layout.format.XMLChars; +import org.jabref.logic.layout.format.*; import org.jabref.logic.openoffice.style.OOPreFormatter; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; @@ -92,10 +13,13 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.util.*; + class LayoutEntry { private static final Logger LOGGER = LoggerFactory.getLogger(LayoutEntry.class); diff --git a/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java b/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java index e067b8f4546..3e925d84b72 100644 --- a/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java +++ b/src/main/java/org/jabref/logic/layout/LayoutFormatterPreferences.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout; +import javafx.beans.property.StringProperty; +import org.jabref.logic.layout.format.NameFormatterPreferences; + import java.util.HashMap; import java.util.Map; import java.util.Optional; -import javafx.beans.property.StringProperty; - -import org.jabref.logic.layout.format.NameFormatterPreferences; - public class LayoutFormatterPreferences { private final NameFormatterPreferences nameFormatterPreferences; diff --git a/src/main/java/org/jabref/logic/layout/LayoutHelper.java b/src/main/java/org/jabref/logic/layout/LayoutHelper.java index 0d96605af82..a19a3b6764e 100644 --- a/src/main/java/org/jabref/logic/layout/LayoutHelper.java +++ b/src/main/java/org/jabref/logic/layout/LayoutHelper.java @@ -1,16 +1,12 @@ package org.jabref.logic.layout; +import org.jabref.logic.journals.JournalAbbreviationRepository; + import java.io.IOException; import java.io.PushbackReader; import java.io.Reader; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Objects; - -import org.jabref.logic.journals.JournalAbbreviationRepository; +import java.util.*; /** * Helper class to get a Layout object. diff --git a/src/main/java/org/jabref/logic/layout/TextBasedPreviewLayout.java b/src/main/java/org/jabref/logic/layout/TextBasedPreviewLayout.java index c3210f292bb..393ace2928e 100644 --- a/src/main/java/org/jabref/logic/layout/TextBasedPreviewLayout.java +++ b/src/main/java/org/jabref/logic/layout/TextBasedPreviewLayout.java @@ -1,17 +1,16 @@ package org.jabref.logic.layout; -import java.io.IOException; -import java.io.StringReader; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.l10n.Localization; import org.jabref.logic.preview.PreviewLayout; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.StringReader; + /** * Implements the preview based JabRef's Custom export filters. */ 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 03f830bdec3..d118288bd73 100644 --- a/src/main/java/org/jabref/logic/layout/format/Authors.java +++ b/src/main/java/org/jabref/logic/layout/format/Authors.java @@ -1,14 +1,14 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.AbstractParamLayoutFormatter; +import org.jabref.model.entry.Author; +import org.jabref.model.entry.AuthorList; + import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.regex.Pattern; -import org.jabref.logic.layout.AbstractParamLayoutFormatter; -import org.jabref.model.entry.Author; -import org.jabref.model.entry.AuthorList; - /** * Versatile author name formatter that takes arguments to control the formatting style. */ 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 f54ca3a8939..be28c22e47c 100644 --- a/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java +++ b/src/main/java/org/jabref/logic/layout/format/CompositeFormat.java @@ -1,11 +1,11 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.LayoutFormatter; + import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.jabref.logic.layout.LayoutFormatter; - /** * A layout formatter that is the composite of the given Formatters executed in order. */ diff --git a/src/main/java/org/jabref/logic/layout/format/CurrentDate.java b/src/main/java/org/jabref/logic/layout/format/CurrentDate.java index 6388ec67770..0d17b20ea19 100644 --- a/src/main/java/org/jabref/logic/layout/format/CurrentDate.java +++ b/src/main/java/org/jabref/logic/layout/format/CurrentDate.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.LayoutFormatter; + import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; -import org.jabref.logic.layout.LayoutFormatter; - /** * Inserts the current date (the time a database is being exported). * diff --git a/src/main/java/org/jabref/logic/layout/format/DateFormatter.java b/src/main/java/org/jabref/logic/layout/format/DateFormatter.java index e53a3f7dd95..2d58b928d17 100644 --- a/src/main/java/org/jabref/logic/layout/format/DateFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/DateFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.ParamLayoutFormatter; + import java.time.LocalDate; import java.time.format.DateTimeFormatter; -import org.jabref.logic.layout.ParamLayoutFormatter; - public class DateFormatter implements ParamLayoutFormatter { private String formatString = "yyyy-MM-dd"; // Use ISO-format as default diff --git a/src/main/java/org/jabref/logic/layout/format/FileLink.java b/src/main/java/org/jabref/logic/layout/format/FileLink.java index c05b1966989..6222f5f4631 100644 --- a/src/main/java/org/jabref/logic/layout/format/FileLink.java +++ b/src/main/java/org/jabref/logic/layout/format/FileLink.java @@ -1,13 +1,13 @@ package org.jabref.logic.layout.format; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.importer.util.FileFieldParser; import org.jabref.logic.layout.ParamLayoutFormatter; import org.jabref.model.entry.LinkedFile; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + /** * Export formatter that handles the file link list of JabRef 2.3 and later, by * selecting the first file link, if any, specified by the field. 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 53179c3b193..7bd49719ca9 100644 --- a/src/main/java/org/jabref/logic/layout/format/HTMLChars.java +++ b/src/main/java/org/jabref/logic/layout/format/HTMLChars.java @@ -1,12 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.Map; -import java.util.Objects; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.HTMLUnicodeConversionMaps; import org.jabref.model.strings.StringUtil; +import java.util.Map; +import java.util.Objects; + /** * This formatter escapes characters so they are suitable for HTML. */ diff --git a/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java b/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java index e14028519bd..44919fa3adb 100644 --- a/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java +++ b/src/main/java/org/jabref/logic/layout/format/HTMLParagraphs.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.LayoutFormatter; + import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.logic.layout.LayoutFormatter; - /** * Will interpret two consecutive newlines as the start of a new paragraph and thus * wrap the paragraph in HTML-p-tags. diff --git a/src/main/java/org/jabref/logic/layout/format/IfPlural.java b/src/main/java/org/jabref/logic/layout/format/IfPlural.java index 7d276074cd1..74e602ca8ca 100644 --- a/src/main/java/org/jabref/logic/layout/format/IfPlural.java +++ b/src/main/java/org/jabref/logic/layout/format/IfPlural.java @@ -1,9 +1,9 @@ package org.jabref.logic.layout.format; -import java.util.List; - import org.jabref.logic.layout.AbstractParamLayoutFormatter; +import java.util.List; + /** * This formatter takes two arguments and examines the field text. * If the field text represents multiple individuals, that is it contains the string "and" 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 1e54d8eca44..bfdd6d97eac 100644 --- a/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java +++ b/src/main/java/org/jabref/logic/layout/format/Iso690NamesAuthors.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; -import java.util.Locale; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.model.strings.StringUtil; +import java.util.Locale; + public class Iso690NamesAuthors implements LayoutFormatter { @Override diff --git a/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java b/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java index b1dc46b7aba..e7d3bafc007 100644 --- a/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java +++ b/src/main/java/org/jabref/logic/layout/format/JournalAbbreviator.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; -import java.util.Objects; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.layout.LayoutFormatter; +import java.util.Objects; + /** * JournalAbbreviator formats the given text in an abbreviated form according to the journal abbreviation lists. * diff --git a/src/main/java/org/jabref/logic/layout/format/MarkdownFormatter.java b/src/main/java/org/jabref/logic/layout/format/MarkdownFormatter.java index 39accb95b8c..f5075739643 100644 --- a/src/main/java/org/jabref/logic/layout/format/MarkdownFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/MarkdownFormatter.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.Objects; - -import org.jabref.logic.layout.LayoutFormatter; - import com.vladsch.flexmark.html.HtmlRenderer; import com.vladsch.flexmark.parser.Parser; import com.vladsch.flexmark.util.ast.Node; import com.vladsch.flexmark.util.data.MutableDataSet; +import org.jabref.logic.layout.LayoutFormatter; + +import java.util.Objects; public class MarkdownFormatter implements LayoutFormatter { 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 eb42b6149ac..986b2dae425 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatter.java @@ -1,14 +1,14 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.bst.util.BstNameFormatter; +import org.jabref.logic.layout.LayoutFormatter; +import org.jabref.model.entry.AuthorList; + import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import org.jabref.logic.bst.util.BstNameFormatter; -import org.jabref.logic.layout.LayoutFormatter; -import org.jabref.model.entry.AuthorList; - /** * This layout formatter uses the Bibtex name.format$ method and provides ultimate flexibility: * 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 09f614f04e9..e4dd4e18028 100644 --- a/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java +++ b/src/main/java/org/jabref/logic/layout/format/NameFormatterPreferences.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class NameFormatterPreferences { private final ObservableList nameFormatterKey; 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 70ccd35279e..820f6ff224d 100644 --- a/src/main/java/org/jabref/logic/layout/format/Ordinal.java +++ b/src/main/java/org/jabref/logic/layout/format/Ordinal.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; +import org.jabref.logic.layout.LayoutFormatter; + import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.logic.layout.LayoutFormatter; - /** * Converts number to ordinal */ 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 a6798b0df86..6ffd10b6a29 100644 --- a/src/main/java/org/jabref/logic/layout/format/RTFChars.java +++ b/src/main/java/org/jabref/logic/layout/format/RTFChars.java @@ -4,7 +4,6 @@ import org.jabref.logic.layout.StringInt; import org.jabref.logic.util.strings.RtfCharMap; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/layout/format/Replace.java b/src/main/java/org/jabref/logic/layout/format/Replace.java index dfbf1a1a90d..d41cc2fbb62 100644 --- a/src/main/java/org/jabref/logic/layout/format/Replace.java +++ b/src/main/java/org/jabref/logic/layout/format/Replace.java @@ -1,9 +1,9 @@ package org.jabref.logic.layout.format; -import java.util.List; - import org.jabref.logic.layout.AbstractParamLayoutFormatter; +import java.util.List; + /** * Formatter that does regexp replacement. * diff --git a/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java b/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java index 1d2db81c090..56dfb5bfa1f 100644 --- a/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatter.java @@ -1,14 +1,14 @@ package org.jabref.logic.layout.format; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Pattern; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.UnicodeLigaturesMap; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; + public class ReplaceUnicodeLigaturesFormatter extends Formatter implements LayoutFormatter { private final Map ligaturesMap; diff --git a/src/main/java/org/jabref/logic/layout/format/RisMonth.java b/src/main/java/org/jabref/logic/layout/format/RisMonth.java index 02927f9d5bb..e3713aba007 100644 --- a/src/main/java/org/jabref/logic/layout/format/RisMonth.java +++ b/src/main/java/org/jabref/logic/layout/format/RisMonth.java @@ -1,11 +1,11 @@ package org.jabref.logic.layout.format; -import java.util.Locale; -import java.util.Optional; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.model.entry.Month; +import java.util.Locale; +import java.util.Optional; + public class RisMonth implements LayoutFormatter { @Override diff --git a/src/main/java/org/jabref/logic/layout/format/ShortMonthFormatter.java b/src/main/java/org/jabref/logic/layout/format/ShortMonthFormatter.java index 63bef135801..3e018fd0f67 100644 --- a/src/main/java/org/jabref/logic/layout/format/ShortMonthFormatter.java +++ b/src/main/java/org/jabref/logic/layout/format/ShortMonthFormatter.java @@ -1,10 +1,10 @@ package org.jabref.logic.layout.format; -import java.util.Optional; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.model.entry.Month; +import java.util.Optional; + public class ShortMonthFormatter implements LayoutFormatter { @Override diff --git a/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java b/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java index 8dc61700ddf..26610be6c11 100644 --- a/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java +++ b/src/main/java/org/jabref/logic/layout/format/ToLowerCase.java @@ -1,9 +1,9 @@ package org.jabref.logic.layout.format; -import java.util.Locale; - import org.jabref.logic.layout.LayoutFormatter; +import java.util.Locale; + /** * Convert the contents to lower case. */ diff --git a/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java b/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java index 419eef5f118..05464c385e0 100644 --- a/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java +++ b/src/main/java/org/jabref/logic/layout/format/ToUpperCase.java @@ -1,9 +1,9 @@ package org.jabref.logic.layout.format; -import java.util.Locale; - import org.jabref.logic.layout.LayoutFormatter; +import java.util.Locale; + /** * Convert the contents to upper case. */ diff --git a/src/main/java/org/jabref/logic/layout/format/WrapContent.java b/src/main/java/org/jabref/logic/layout/format/WrapContent.java index 10152395390..0bbaf31b0b5 100644 --- a/src/main/java/org/jabref/logic/layout/format/WrapContent.java +++ b/src/main/java/org/jabref/logic/layout/format/WrapContent.java @@ -1,9 +1,9 @@ package org.jabref.logic.layout.format; -import java.util.List; - import org.jabref.logic.layout.AbstractParamLayoutFormatter; +import java.util.List; + /** * This formatter outputs the input value after adding a prefix and a postfix, * as long as the input value is non-empty. If the input value is empty, an 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 a39930b5324..67dbf6b5b2c 100644 --- a/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java +++ b/src/main/java/org/jabref/logic/layout/format/WrapFileLinks.java @@ -1,17 +1,13 @@ package org.jabref.logic.layout.format; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.jabref.logic.importer.util.FileFieldParser; import org.jabref.logic.layout.AbstractParamLayoutFormatter; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.entry.LinkedFile; +import java.nio.file.Path; +import java.util.*; + /** * This formatter iterates over all file links, or all file links of a specified * type, outputting a format string given as the first argument. The format string diff --git a/src/main/java/org/jabref/logic/layout/format/XMLChars.java b/src/main/java/org/jabref/logic/layout/format/XMLChars.java index b7c9f9136e0..06ece8888de 100644 --- a/src/main/java/org/jabref/logic/layout/format/XMLChars.java +++ b/src/main/java/org/jabref/logic/layout/format/XMLChars.java @@ -1,11 +1,11 @@ package org.jabref.logic.layout.format; -import java.util.HashMap; -import java.util.Map; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.XmlCharsMap; +import java.util.HashMap; +import java.util.Map; + /** * Changes {\^o} or {\^{o}} to ? */ diff --git a/src/main/java/org/jabref/logic/logging/LogMessages.java b/src/main/java/org/jabref/logic/logging/LogMessages.java index 7af5b8fd462..b379a231e1e 100644 --- a/src/main/java/org/jabref/logic/logging/LogMessages.java +++ b/src/main/java/org/jabref/logic/logging/LogMessages.java @@ -2,7 +2,6 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.tinylog.core.LogEntry; /** diff --git a/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java b/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java index 4bcc949c895..3fb27c7fbc4 100644 --- a/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java +++ b/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java @@ -1,5 +1,12 @@ package org.jabref.logic.msbib; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.Month; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.types.EntryType; + import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,13 +15,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.Month; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; -import org.jabref.model.entry.types.EntryType; - public class BibTeXConverter { private static final String MSBIB_PREFIX = "msbib-"; diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index 6d3791689d6..ce8b2afda75 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -1,8 +1,5 @@ package org.jabref.logic.msbib; -import java.util.ArrayList; -import java.util.List; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -13,6 +10,9 @@ import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.entry.types.StandardEntryType; +import java.util.ArrayList; +import java.util.List; + public class MSBibConverter { private static final String MSBIB_PREFIX = "msbib-"; diff --git a/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java b/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java index 4832d5af34c..6ab3c91a361 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibDatabase.java @@ -1,20 +1,7 @@ package org.jabref.logic.msbib; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -24,6 +11,13 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.BufferedReader; +import java.io.IOException; +import java.util.*; + /** * Microsoft Word bibliography. * The class is uesed both for import and export diff --git a/src/main/java/org/jabref/logic/msbib/MSBibEntry.java b/src/main/java/org/jabref/logic/msbib/MSBibEntry.java index 2353037b4ac..8980be6befa 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibEntry.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibEntry.java @@ -1,24 +1,19 @@ package org.jabref.logic.msbib; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.Date; import org.jabref.model.entry.Month; import org.jabref.model.strings.StringUtil; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * MSBib entry representation * diff --git a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java index 768fa51ebb0..2fb1b31f372 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java @@ -1,8 +1,7 @@ package org.jabref.logic.msbib; -import java.util.HashMap; -import java.util.Map; - +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; @@ -11,8 +10,8 @@ import org.jabref.model.entry.types.IEEETranEntryType; import org.jabref.model.entry.types.StandardEntryType; -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; +import java.util.HashMap; +import java.util.Map; /** * Mapping between Msbib and biblatex All Fields: List diff --git a/src/main/java/org/jabref/logic/msbib/PageNumbers.java b/src/main/java/org/jabref/logic/msbib/PageNumbers.java index 54daca52fd9..6b076e854e9 100644 --- a/src/main/java/org/jabref/logic/msbib/PageNumbers.java +++ b/src/main/java/org/jabref/logic/msbib/PageNumbers.java @@ -1,12 +1,12 @@ package org.jabref.logic.msbib; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + public class PageNumbers { private static final Pattern PAGE_PATTERN = Pattern.compile("\\s*(\\d+)\\s*-{1,2}\\s*(\\d+)\\s*"); private String freeform; diff --git a/src/main/java/org/jabref/logic/net/ProgressInputStream.java b/src/main/java/org/jabref/logic/net/ProgressInputStream.java index d114cbbe6cb..c166b26e1b2 100644 --- a/src/main/java/org/jabref/logic/net/ProgressInputStream.java +++ b/src/main/java/org/jabref/logic/net/ProgressInputStream.java @@ -1,12 +1,12 @@ package org.jabref.logic.net; +import javafx.beans.property.LongProperty; +import javafx.beans.property.SimpleLongProperty; + import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; -import javafx.beans.property.LongProperty; -import javafx.beans.property.SimpleLongProperty; - /** * An input stream that keeps track of the amount of bytes already read. * Code based on http://stackoverflow.com/a/1339589/873661, but converted to use JavaFX properties instead of listeners diff --git a/src/main/java/org/jabref/logic/net/ProxyPreferences.java b/src/main/java/org/jabref/logic/net/ProxyPreferences.java index 40d293744b6..990e1945070 100644 --- a/src/main/java/org/jabref/logic/net/ProxyPreferences.java +++ b/src/main/java/org/jabref/logic/net/ProxyPreferences.java @@ -1,12 +1,12 @@ package org.jabref.logic.net; -import java.util.Objects; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import java.util.Objects; + public class ProxyPreferences { private final BooleanProperty useProxy; diff --git a/src/main/java/org/jabref/logic/net/URLDownload.java b/src/main/java/org/jabref/logic/net/URLDownload.java index 7e9f54b997e..15da8f83137 100644 --- a/src/main/java/org/jabref/logic/net/URLDownload.java +++ b/src/main/java/org/jabref/logic/net/URLDownload.java @@ -1,24 +1,18 @@ package org.jabref.logic.net; -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringWriter; -import java.io.Writer; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.net.HttpCookie; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLConnection; +import kong.unirest.Unirest; +import kong.unirest.UnirestException; +import kong.unirest.apache.ApacheClient; +import org.apache.http.client.config.RequestConfig; +import org.jabref.logic.importer.FetcherClientException; +import org.jabref.logic.importer.FetcherServerException; +import org.jabref.logic.util.io.FileUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.net.ssl.*; +import java.io.*; +import java.net.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -33,24 +27,6 @@ import java.util.Map; import java.util.Map.Entry; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import org.jabref.logic.importer.FetcherClientException; -import org.jabref.logic.importer.FetcherServerException; -import org.jabref.logic.util.io.FileUtil; - -import kong.unirest.Unirest; -import kong.unirest.UnirestException; -import kong.unirest.apache.ApacheClient; -import org.apache.http.client.config.RequestConfig; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * URL download to a string. *

    diff --git a/src/main/java/org/jabref/logic/net/ssl/SSLCertificate.java b/src/main/java/org/jabref/logic/net/ssl/SSLCertificate.java index 795678d7135..1f0a9d0ffef 100644 --- a/src/main/java/org/jabref/logic/net/ssl/SSLCertificate.java +++ b/src/main/java/org/jabref/logic/net/ssl/SSLCertificate.java @@ -1,5 +1,9 @@ package org.jabref.logic.net.ssl; +import com.google.common.hash.Hashing; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.FileInputStream; import java.io.FileNotFoundException; import java.nio.file.Path; @@ -12,10 +16,6 @@ import java.util.Objects; import java.util.Optional; -import com.google.common.hash.Hashing; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class SSLCertificate { private static final Logger LOGGER = LoggerFactory.getLogger(SSLCertificate.class); 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 315124d734c..9dfecc74239 100644 --- a/src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java +++ b/src/main/java/org/jabref/logic/net/ssl/TrustStoreManager.java @@ -1,5 +1,9 @@ package org.jabref.logic.net.ssl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.net.ssl.*; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -19,15 +23,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class TrustStoreManager { private static final Logger LOGGER = LoggerFactory.getLogger(TrustStoreManager.class); diff --git a/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java b/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java index c2677a0d296..00da3c513f4 100644 --- a/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java +++ b/src/main/java/org/jabref/logic/openoffice/OpenOfficeFileSearch.java @@ -1,24 +1,19 @@ package org.jabref.logic.openoffice; +import org.jabref.logic.util.OS; +import org.jabref.logic.util.io.FileUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Locale; +import java.util.*; import java.util.function.BiPredicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.logic.util.OS; -import org.jabref.logic.util.io.FileUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class OpenOfficeFileSearch { private static final Logger LOGGER = LoggerFactory.getLogger(OpenOfficeFileSearch.class); diff --git a/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java b/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java index 03f7934434b..a5d0177afab 100644 --- a/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java +++ b/src/main/java/org/jabref/logic/openoffice/OpenOfficePreferences.java @@ -1,7 +1,5 @@ package org.jabref.logic.openoffice; -import java.util.List; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; @@ -9,6 +7,8 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class OpenOfficePreferences { public static final String DEFAULT_WIN_EXEC_PATH = "C:\\Program Files\\LibreOffice 5\\program"; diff --git a/src/main/java/org/jabref/logic/openoffice/action/EditInsert.java b/src/main/java/org/jabref/logic/openoffice/action/EditInsert.java index 0d8f0476533..8065230f11c 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/EditInsert.java +++ b/src/main/java/org/jabref/logic/openoffice/action/EditInsert.java @@ -1,33 +1,28 @@ package org.jabref.logic.openoffice.action; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.logic.openoffice.frontend.UpdateCitationMarkers; import org.jabref.logic.openoffice.style.OOBibStyle; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.Citation; -import org.jabref.model.openoffice.style.CitationMarkerEntry; -import org.jabref.model.openoffice.style.CitationType; -import org.jabref.model.openoffice.style.NonUniqueCitationMarker; -import org.jabref.model.openoffice.style.OODataModel; +import org.jabref.model.openoffice.style.*; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoScreenRefresh; import org.jabref.model.openoffice.util.OOListUtil; import org.jabref.model.strings.StringUtil; -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; public class EditInsert { diff --git a/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java b/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java index f0501ad7f92..f9018d75f2b 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java +++ b/src/main/java/org/jabref/logic/openoffice/action/EditMerge.java @@ -1,11 +1,12 @@ package org.jabref.logic.openoffice.action; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.logic.openoffice.frontend.UpdateCitationMarkers; import org.jabref.logic.openoffice.style.OOBibStyle; @@ -18,17 +19,15 @@ import org.jabref.model.openoffice.uno.UnoScreenRefresh; import org.jabref.model.openoffice.uno.UnoTextRange; import org.jabref.model.openoffice.util.OOListUtil; - -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + public class EditMerge { private static final Logger LOGGER = LoggerFactory.getLogger(EditMerge.class); diff --git a/src/main/java/org/jabref/logic/openoffice/action/EditSeparate.java b/src/main/java/org/jabref/logic/openoffice/action/EditSeparate.java index 914c8b4e593..ce96ccba06a 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/EditSeparate.java +++ b/src/main/java/org/jabref/logic/openoffice/action/EditSeparate.java @@ -1,7 +1,12 @@ package org.jabref.logic.openoffice.action; -import java.util.List; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.logic.openoffice.frontend.UpdateCitationMarkers; import org.jabref.logic.openoffice.style.OOBibStyle; @@ -14,13 +19,7 @@ import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoScreenRefresh; -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; +import java.util.List; public class EditSeparate { diff --git a/src/main/java/org/jabref/logic/openoffice/action/ExportCited.java b/src/main/java/org/jabref/logic/openoffice/action/ExportCited.java index 6d425733f07..981e29a3d81 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/ExportCited.java +++ b/src/main/java/org/jabref/logic/openoffice/action/ExportCited.java @@ -1,10 +1,7 @@ package org.jabref.logic.openoffice.action; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextDocument; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; @@ -13,8 +10,10 @@ import org.jabref.model.openoffice.style.CitedKeys; import org.jabref.model.openoffice.uno.NoDocumentException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextDocument; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; public class ExportCited { diff --git a/src/main/java/org/jabref/logic/openoffice/action/ManageCitations.java b/src/main/java/org/jabref/logic/openoffice/action/ManageCitations.java index b1bac3889fc..e89b48d2b0f 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/ManageCitations.java +++ b/src/main/java/org/jabref/logic/openoffice/action/ManageCitations.java @@ -1,15 +1,14 @@ package org.jabref.logic.openoffice.action; -import java.util.List; - -import org.jabref.logic.openoffice.frontend.OOFrontend; -import org.jabref.model.openoffice.CitationEntry; -import org.jabref.model.openoffice.uno.NoDocumentException; - import com.sun.star.beans.IllegalTypeException; import com.sun.star.beans.PropertyVetoException; import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextDocument; +import org.jabref.logic.openoffice.frontend.OOFrontend; +import org.jabref.model.openoffice.CitationEntry; +import org.jabref.model.openoffice.uno.NoDocumentException; + +import java.util.List; public class ManageCitations { diff --git a/src/main/java/org/jabref/logic/openoffice/action/Update.java b/src/main/java/org/jabref/logic/openoffice/action/Update.java index d67326b5409..c6cfb171447 100644 --- a/src/main/java/org/jabref/logic/openoffice/action/Update.java +++ b/src/main/java/org/jabref/logic/openoffice/action/Update.java @@ -1,7 +1,7 @@ package org.jabref.logic.openoffice.action; -import java.util.List; - +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextDocument; import org.jabref.logic.openoffice.frontend.OOFrontend; import org.jabref.logic.openoffice.frontend.UpdateBibliography; import org.jabref.logic.openoffice.frontend.UpdateCitationMarkers; @@ -13,8 +13,7 @@ import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoScreenRefresh; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextDocument; +import java.util.List; /** * Update document: citation marks and bibliography diff --git a/src/main/java/org/jabref/logic/openoffice/backend/Backend52.java b/src/main/java/org/jabref/logic/openoffice/backend/Backend52.java index 950d3a2b761..3fd9fbe1d56 100644 --- a/src/main/java/org/jabref/logic/openoffice/backend/Backend52.java +++ b/src/main/java/org/jabref/logic/openoffice/backend/Backend52.java @@ -1,41 +1,27 @@ package org.jabref.logic.openoffice.backend; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; import org.jabref.model.openoffice.CitationEntry; import org.jabref.model.openoffice.backend.NamedRange; import org.jabref.model.openoffice.backend.NamedRangeManager; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.Citation; -import org.jabref.model.openoffice.style.CitationGroup; -import org.jabref.model.openoffice.style.CitationGroupId; -import org.jabref.model.openoffice.style.CitationGroups; -import org.jabref.model.openoffice.style.CitationType; -import org.jabref.model.openoffice.style.OODataModel; -import org.jabref.model.openoffice.style.PageInfo; +import org.jabref.model.openoffice.style.*; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoUserDefinedProperty; import org.jabref.model.openoffice.util.OOListUtil; - -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.stream.Collectors; + /** * Backend52, Codec52 and OODataModel.JabRef52 refer to the mode of storage, encoding and what-is-stored in the document under JabRef version 5.2. These basically did not change up to JabRef 5.4. */ diff --git a/src/main/java/org/jabref/logic/openoffice/backend/Codec52.java b/src/main/java/org/jabref/logic/openoffice/backend/Codec52.java index 00461d5ee2d..ede42f40bf4 100644 --- a/src/main/java/org/jabref/logic/openoffice/backend/Codec52.java +++ b/src/main/java/org/jabref/logic/openoffice/backend/Codec52.java @@ -1,16 +1,12 @@ package org.jabref.logic.openoffice.backend; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; +import org.jabref.model.openoffice.style.CitationType; + +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.jabref.model.openoffice.style.CitationType; - /** * How and what is encoded in reference mark names under JabRef 5.2. *

    diff --git a/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeManagerReferenceMark.java b/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeManagerReferenceMark.java index 63c67ea0495..8ab2f2d3922 100644 --- a/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeManagerReferenceMark.java +++ b/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeManagerReferenceMark.java @@ -1,17 +1,16 @@ package org.jabref.logic.openoffice.backend; -import java.util.List; -import java.util.Optional; - +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; import org.jabref.model.openoffice.backend.NamedRange; import org.jabref.model.openoffice.backend.NamedRangeManager; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoReferenceMark; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; +import java.util.List; +import java.util.Optional; public class NamedRangeManagerReferenceMark implements NamedRangeManager { diff --git a/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeReferenceMark.java b/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeReferenceMark.java index bc41e82406a..f32be872822 100644 --- a/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeReferenceMark.java +++ b/src/main/java/org/jabref/logic/openoffice/backend/NamedRangeReferenceMark.java @@ -1,22 +1,17 @@ package org.jabref.logic.openoffice.backend; -import java.util.Optional; - +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.*; import org.jabref.model.openoffice.backend.NamedRange; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoCursor; import org.jabref.model.openoffice.uno.UnoReferenceMark; - -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XText; -import com.sun.star.text.XTextContent; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; + class NamedRangeReferenceMark implements NamedRange { private static final String ZERO_WIDTH_SPACE = "\u200b"; diff --git a/src/main/java/org/jabref/logic/openoffice/frontend/OOFrontend.java b/src/main/java/org/jabref/logic/openoffice/frontend/OOFrontend.java index f430290d0c6..b4d8127596c 100644 --- a/src/main/java/org/jabref/logic/openoffice/frontend/OOFrontend.java +++ b/src/main/java/org/jabref/logic/openoffice/frontend/OOFrontend.java @@ -1,31 +1,19 @@ package org.jabref.logic.openoffice.frontend; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; import org.jabref.logic.JabRefException; import org.jabref.logic.l10n.Localization; import org.jabref.logic.openoffice.backend.Backend52; import org.jabref.model.openoffice.CitationEntry; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.rangesort.FunctionalTextViewCursor; -import org.jabref.model.openoffice.rangesort.RangeOverlap; -import org.jabref.model.openoffice.rangesort.RangeOverlapBetween; -import org.jabref.model.openoffice.rangesort.RangeOverlapWithin; -import org.jabref.model.openoffice.rangesort.RangeSort; -import org.jabref.model.openoffice.rangesort.RangeSortEntry; -import org.jabref.model.openoffice.rangesort.RangeSortVisual; -import org.jabref.model.openoffice.rangesort.RangeSortable; -import org.jabref.model.openoffice.style.CitationGroup; -import org.jabref.model.openoffice.style.CitationGroupId; -import org.jabref.model.openoffice.style.CitationGroups; -import org.jabref.model.openoffice.style.CitationType; -import org.jabref.model.openoffice.style.OODataModel; +import org.jabref.model.openoffice.rangesort.*; +import org.jabref.model.openoffice.style.*; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; import org.jabref.model.openoffice.uno.UnoCursor; @@ -33,13 +21,8 @@ import org.jabref.model.openoffice.util.OOListUtil; import org.jabref.model.openoffice.util.OOVoidResult; -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; +import java.util.*; +import java.util.stream.Collectors; public class OOFrontend { diff --git a/src/main/java/org/jabref/logic/openoffice/frontend/RangeForOverlapCheck.java b/src/main/java/org/jabref/logic/openoffice/frontend/RangeForOverlapCheck.java index 743dcb6c7c0..223c748c2df 100644 --- a/src/main/java/org/jabref/logic/openoffice/frontend/RangeForOverlapCheck.java +++ b/src/main/java/org/jabref/logic/openoffice/frontend/RangeForOverlapCheck.java @@ -1,8 +1,7 @@ package org.jabref.logic.openoffice.frontend; -import org.jabref.model.openoffice.rangesort.RangeHolder; - import com.sun.star.text.XTextRange; +import org.jabref.model.openoffice.rangesort.RangeHolder; /** * Describe a protected range for overlap checking and reporting. diff --git a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateBibliography.java b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateBibliography.java index ab4e01d9e76..68443797613 100644 --- a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateBibliography.java +++ b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateBibliography.java @@ -1,7 +1,9 @@ package org.jabref.logic.openoffice.frontend; -import java.util.Optional; - +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; import org.jabref.logic.openoffice.style.OOBibStyle; import org.jabref.logic.openoffice.style.OOFormatBibliography; import org.jabref.model.openoffice.ootext.OOText; @@ -12,10 +14,7 @@ import org.jabref.model.openoffice.uno.UnoBookmark; import org.jabref.model.openoffice.uno.UnoTextSection; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; +import java.util.Optional; public class UpdateBibliography { diff --git a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java index 96f56c10ff8..90dda3f66f7 100644 --- a/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java +++ b/src/main/java/org/jabref/logic/openoffice/frontend/UpdateCitationMarkers.java @@ -1,9 +1,11 @@ package org.jabref.logic.openoffice.frontend; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - +import com.sun.star.beans.IllegalTypeException; +import com.sun.star.beans.NotRemoveableException; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextDocument; import org.jabref.logic.openoffice.style.OOBibStyle; import org.jabref.model.openoffice.ootext.OOText; import org.jabref.model.openoffice.ootext.OOTextIntoOO; @@ -12,16 +14,13 @@ import org.jabref.model.openoffice.style.CitationType; import org.jabref.model.openoffice.uno.CreationException; import org.jabref.model.openoffice.uno.NoDocumentException; - -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + public class UpdateCitationMarkers { private static final Logger LOGGER = LoggerFactory.getLogger(UpdateCitationMarkers.class); diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java index debdd754e14..4874930e14b 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyle.java @@ -1,24 +1,5 @@ package org.jabref.logic.openoffice.style; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.regex.Pattern; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.layout.Layout; import org.jabref.logic.layout.LayoutFormatter; @@ -31,15 +12,17 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.openoffice.ootext.OOFormat; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.CitationMarkerEntry; -import org.jabref.model.openoffice.style.CitationMarkerNormEntry; -import org.jabref.model.openoffice.style.CitationMarkerNumericBibEntry; -import org.jabref.model.openoffice.style.CitationMarkerNumericEntry; -import org.jabref.model.openoffice.style.NonUniqueCitationMarker; - +import org.jabref.model.openoffice.style.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.regex.Pattern; + /** * This class embodies a bibliography formatting for OpenOffice, which is composed * of the following elements: diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetCitationMarker.java b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetCitationMarker.java index 6466209233c..3e0eeb68010 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetCitationMarker.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetCitationMarker.java @@ -1,11 +1,5 @@ package org.jabref.logic.openoffice.style; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; @@ -13,13 +7,11 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.OrFields; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.CitationLookupResult; -import org.jabref.model.openoffice.style.CitationMarkerEntry; -import org.jabref.model.openoffice.style.CitationMarkerNormEntry; -import org.jabref.model.openoffice.style.NonUniqueCitationMarker; -import org.jabref.model.openoffice.style.PageInfo; +import org.jabref.model.openoffice.style.*; import org.jabref.model.strings.StringUtil; +import java.util.*; + class OOBibStyleGetCitationMarker { private OOBibStyleGetCitationMarker() {} diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetNumCitationMarker.java b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetNumCitationMarker.java index a04885ad072..ae4ba0cba22 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetNumCitationMarker.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOBibStyleGetNumCitationMarker.java @@ -1,15 +1,15 @@ package org.jabref.logic.openoffice.style; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; import org.jabref.model.openoffice.style.CitationMarkerNumericBibEntry; import org.jabref.model.openoffice.style.CitationMarkerNumericEntry; import org.jabref.model.openoffice.style.PageInfo; import org.jabref.model.openoffice.util.OOListUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + class OOBibStyleGetNumCitationMarker { // The number encoding "this entry is unresolved" diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOFormatBibliography.java b/src/main/java/org/jabref/logic/openoffice/style/OOFormatBibliography.java index c8554f3967c..e89cd87b258 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOFormatBibliography.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOFormatBibliography.java @@ -1,9 +1,5 @@ package org.jabref.logic.openoffice.style; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.logic.layout.Layout; import org.jabref.model.database.BibDatabase; @@ -12,12 +8,11 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.openoffice.ootext.OOFormat; import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.CitationGroup; -import org.jabref.model.openoffice.style.CitationGroupId; -import org.jabref.model.openoffice.style.CitationGroups; -import org.jabref.model.openoffice.style.CitationPath; -import org.jabref.model.openoffice.style.CitedKey; -import org.jabref.model.openoffice.style.CitedKeys; +import org.jabref.model.openoffice.style.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; public class OOFormatBibliography { private static final OOPreFormatter POSTFORMATTER = new OOPreFormatter(); diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java b/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java index 6c6a3147a88..9d99d087c63 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOPreFormatter.java @@ -1,12 +1,12 @@ package org.jabref.logic.openoffice.style; -import java.util.Map; -import java.util.Objects; - import org.jabref.logic.layout.LayoutFormatter; import org.jabref.logic.util.strings.HTMLUnicodeConversionMaps; import org.jabref.model.strings.StringUtil; +import java.util.Map; +import java.util.Objects; + /** * This formatter preprocesses JabRef fields before they are run through the layout of the bibliography style. It handles translation of LaTeX italic/bold commands into HTML tags. */ diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java b/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java index 23bdfe4261a..0df30754271 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOProcess.java @@ -1,8 +1,5 @@ package org.jabref.logic.openoffice.style; -import java.util.Comparator; -import java.util.List; - import org.jabref.logic.bibtex.comparator.FieldComparator; import org.jabref.logic.bibtex.comparator.FieldComparatorStack; import org.jabref.model.database.BibDatabase; @@ -10,6 +7,9 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.openoffice.style.CitationGroups; +import java.util.Comparator; +import java.util.List; + public class OOProcess { static final Comparator AUTHOR_YEAR_TITLE_COMPARATOR = makeAuthorYearTitleComparator(); diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java b/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java index daeba043506..c36ae953838 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOProcessAuthorYearMarkers.java @@ -1,24 +1,11 @@ package org.jabref.logic.openoffice.style; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.style.Citation; -import org.jabref.model.openoffice.style.CitationGroup; -import org.jabref.model.openoffice.style.CitationGroups; -import org.jabref.model.openoffice.style.CitationMarkerEntry; -import org.jabref.model.openoffice.style.CitationType; -import org.jabref.model.openoffice.style.CitedKey; -import org.jabref.model.openoffice.style.CitedKeys; -import org.jabref.model.openoffice.style.NonUniqueCitationMarker; +import org.jabref.model.openoffice.style.*; import org.jabref.model.openoffice.util.OOListUtil; +import java.util.*; + class OOProcessAuthorYearMarkers { private OOProcessAuthorYearMarkers() {} diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOProcessCitationKeyMarkers.java b/src/main/java/org/jabref/logic/openoffice/style/OOProcessCitationKeyMarkers.java index aa1e9c4baff..f9482abc035 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOProcessCitationKeyMarkers.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOProcessCitationKeyMarkers.java @@ -1,13 +1,13 @@ package org.jabref.logic.openoffice.style; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; import org.jabref.model.openoffice.style.Citation; import org.jabref.model.openoffice.style.CitationGroup; import org.jabref.model.openoffice.style.CitationGroups; import org.jabref.model.openoffice.util.OOListUtil; +import java.util.Optional; + class OOProcessCitationKeyMarkers { private OOProcessCitationKeyMarkers() {} diff --git a/src/main/java/org/jabref/logic/openoffice/style/OOProcessNumericMarkers.java b/src/main/java/org/jabref/logic/openoffice/style/OOProcessNumericMarkers.java index 2ae084a372e..1fb030db414 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/OOProcessNumericMarkers.java +++ b/src/main/java/org/jabref/logic/openoffice/style/OOProcessNumericMarkers.java @@ -1,14 +1,14 @@ package org.jabref.logic.openoffice.style; -import java.util.List; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; import org.jabref.model.openoffice.style.CitationGroup; import org.jabref.model.openoffice.style.CitationGroups; import org.jabref.model.openoffice.style.CitationMarkerNumericEntry; import org.jabref.model.openoffice.util.OOListUtil; +import java.util.List; +import java.util.Optional; + class OOProcessNumericMarkers { private OOProcessNumericMarkers() {} diff --git a/src/main/java/org/jabref/logic/openoffice/style/StyleLoader.java b/src/main/java/org/jabref/logic/openoffice/style/StyleLoader.java index 13b67569324..34a043e32f6 100644 --- a/src/main/java/org/jabref/logic/openoffice/style/StyleLoader.java +++ b/src/main/java/org/jabref/logic/openoffice/style/StyleLoader.java @@ -1,5 +1,11 @@ package org.jabref.logic.openoffice.style; +import org.jabref.logic.journals.JournalAbbreviationRepository; +import org.jabref.logic.layout.LayoutFormatterPreferences; +import org.jabref.logic.openoffice.OpenOfficePreferences; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Path; @@ -8,13 +14,6 @@ import java.util.List; import java.util.Objects; -import org.jabref.logic.journals.JournalAbbreviationRepository; -import org.jabref.logic.layout.LayoutFormatterPreferences; -import org.jabref.logic.openoffice.OpenOfficePreferences; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class StyleLoader { public static final String DEFAULT_AUTHORYEAR_STYLE_PATH = "/resource/openoffice/default_authoryear.jstyle"; diff --git a/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java index 647bde6d181..ec287678531 100644 --- a/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/AnnotationImporter.java @@ -1,10 +1,10 @@ package org.jabref.logic.pdf; +import org.jabref.model.pdf.FileAnnotation; + import java.nio.file.Path; import java.util.List; -import org.jabref.model.pdf.FileAnnotation; - public interface AnnotationImporter { List importAnnotations(final Path path); diff --git a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java index 7ac081d508d..bb0800243cf 100644 --- a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java @@ -1,17 +1,17 @@ package org.jabref.logic.pdf; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.pdf.FileAnnotation; import org.jabref.preferences.FilePreferences; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + /** * Here all PDF files attached to a BibEntry are scanned for annotations using a PdfAnnotationImporter. */ diff --git a/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java b/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java index 36b8f1e949f..58db52b86e3 100644 --- a/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java +++ b/src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java @@ -1,20 +1,19 @@ package org.jabref.logic.pdf; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; - +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.pdf.FileAnnotation; import org.jabref.preferences.FilePreferences; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; + public class FileAnnotationCache { private static final Logger LOGGER = LoggerFactory.getLogger(FileAnnotation.class); diff --git a/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java index ea671cd5986..46f4d517302 100644 --- a/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/PdfAnnotationImporter.java @@ -1,19 +1,5 @@ package org.jabref.logic.pdf; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import org.jabref.model.pdf.FileAnnotation; -import org.jabref.model.pdf.FileAnnotationType; - import org.apache.pdfbox.Loader; import org.apache.pdfbox.cos.COSArray; import org.apache.pdfbox.cos.COSName; @@ -21,9 +7,16 @@ import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPageTree; import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; +import org.jabref.model.pdf.FileAnnotation; +import org.jabref.model.pdf.FileAnnotationType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + public class PdfAnnotationImporter implements AnnotationImporter { private static final Logger LOGGER = LoggerFactory.getLogger(PdfAnnotationImporter.class); diff --git a/src/main/java/org/jabref/logic/pdf/TextExtractor.java b/src/main/java/org/jabref/logic/pdf/TextExtractor.java index ae2cde72176..07949bc441c 100644 --- a/src/main/java/org/jabref/logic/pdf/TextExtractor.java +++ b/src/main/java/org/jabref/logic/pdf/TextExtractor.java @@ -1,17 +1,16 @@ package org.jabref.logic.pdf; -import java.awt.geom.Rectangle2D; -import java.io.IOException; -import java.util.Objects; - -import org.jabref.architecture.AllowedToUseAwt; - import org.apache.pdfbox.cos.COSArray; import org.apache.pdfbox.cos.COSFloat; import org.apache.pdfbox.cos.COSInteger; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.common.PDRectangle; import org.apache.pdfbox.text.PDFTextStripperByArea; +import org.jabref.architecture.AllowedToUseAwt; + +import java.awt.geom.Rectangle2D; +import java.io.IOException; +import java.util.Objects; /** * Extracts the text of marked annotations using bounding boxes. diff --git a/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java b/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java index 8f9ba53f601..e867c8b8924 100644 --- a/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java +++ b/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java @@ -1,23 +1,5 @@ package org.jabref.logic.pdf.search.indexing; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.TimeUnit; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import org.jabref.gui.LibraryTab; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.LinkedFile; -import org.jabref.model.strings.StringUtil; -import org.jabref.preferences.FilePreferences; - import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; @@ -27,14 +9,27 @@ import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; import org.apache.pdfbox.text.PDFTextStripper; +import org.jabref.gui.LibraryTab; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.LinkedFile; +import org.jabref.model.strings.StringUtil; +import org.jabref.preferences.FilePreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.jabref.model.pdf.search.SearchFieldConstants.ANNOTATIONS; -import static org.jabref.model.pdf.search.SearchFieldConstants.CONTENT; -import static org.jabref.model.pdf.search.SearchFieldConstants.MODIFIED; -import static org.jabref.model.pdf.search.SearchFieldConstants.PAGE_NUMBER; -import static org.jabref.model.pdf.search.SearchFieldConstants.PATH; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static org.jabref.model.pdf.search.SearchFieldConstants.*; /** * Utility class for reading the data from LinkedFiles of a BibEntry for Lucene. diff --git a/src/main/java/org/jabref/logic/pdf/search/indexing/IndexingTaskManager.java b/src/main/java/org/jabref/logic/pdf/search/indexing/IndexingTaskManager.java index f974a1f5e92..22ccb266c01 100644 --- a/src/main/java/org/jabref/logic/pdf/search/indexing/IndexingTaskManager.java +++ b/src/main/java/org/jabref/logic/pdf/search/indexing/IndexingTaskManager.java @@ -1,10 +1,5 @@ package org.jabref.logic.pdf.search.indexing; -import java.util.List; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; - import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.gui.util.TaskExecutor; @@ -13,6 +8,11 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; +import java.util.List; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.ConcurrentLinkedQueue; + /** * Wrapper around {@link PdfIndexer} to execute all operations in the background. */ diff --git a/src/main/java/org/jabref/logic/pdf/search/indexing/PdfIndexer.java b/src/main/java/org/jabref/logic/pdf/search/indexing/PdfIndexer.java index c5217450c0c..6427c7d78cf 100644 --- a/src/main/java/org/jabref/logic/pdf/search/indexing/PdfIndexer.java +++ b/src/main/java/org/jabref/logic/pdf/search/indexing/PdfIndexer.java @@ -1,15 +1,10 @@ package org.jabref.logic.pdf.search.indexing; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.TimeUnit; - +import org.apache.lucene.document.Document; +import org.apache.lucene.index.*; +import org.apache.lucene.search.*; +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.NIOFSDirectory; import org.jabref.gui.LibraryTab; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; @@ -18,24 +13,19 @@ import org.jabref.model.pdf.search.EnglishStemAnalyzer; import org.jabref.model.pdf.search.SearchFieldConstants; import org.jabref.preferences.FilePreferences; - -import org.apache.lucene.document.Document; -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexNotFoundException; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.MatchAllDocsQuery; -import org.apache.lucene.search.ScoreDoc; -import org.apache.lucene.search.TermQuery; -import org.apache.lucene.search.TopDocs; -import org.apache.lucene.store.Directory; -import org.apache.lucene.store.NIOFSDirectory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.TimeUnit; + /** * Indexes the text of PDF files and adds it into the lucene search index. */ diff --git a/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java b/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java index 4a3a07f41bf..6f207c6afdb 100644 --- a/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java +++ b/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java @@ -1,17 +1,5 @@ package org.jabref.logic.pdf.search.retrieval; -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; - -import org.jabref.gui.LibraryTab; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.pdf.search.EnglishStemAnalyzer; -import org.jabref.model.pdf.search.PdfSearchResults; -import org.jabref.model.pdf.search.SearchResult; -import org.jabref.model.strings.StringUtil; - import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.queryparser.classic.MultiFieldQueryParser; @@ -22,9 +10,20 @@ import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; import org.apache.lucene.store.NIOFSDirectory; +import org.jabref.gui.LibraryTab; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.pdf.search.EnglishStemAnalyzer; +import org.jabref.model.pdf.search.PdfSearchResults; +import org.jabref.model.pdf.search.SearchResult; +import org.jabref.model.strings.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; + import static org.jabref.model.pdf.search.SearchFieldConstants.PDF_FIELDS; public final class PdfSearcher { diff --git a/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java b/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java index 8dc120a3625..a916f23f0ef 100644 --- a/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java +++ b/src/main/java/org/jabref/logic/preferences/TimestampPreferences.java @@ -1,14 +1,13 @@ package org.jabref.logic.preferences; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; - import org.jabref.model.entry.field.Field; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; + public class TimestampPreferences { private final BooleanProperty addCreationDate; private final BooleanProperty addModificationDate; diff --git a/src/main/java/org/jabref/logic/preview/PreviewLayout.java b/src/main/java/org/jabref/logic/preview/PreviewLayout.java index de3f327782c..c1258f03786 100644 --- a/src/main/java/org/jabref/logic/preview/PreviewLayout.java +++ b/src/main/java/org/jabref/logic/preview/PreviewLayout.java @@ -1,10 +1,10 @@ package org.jabref.logic.preview; -import java.util.Locale; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; +import java.util.Locale; + /** * Used for displaying a rendered entry in the UI. Due to historical reasons, "rendering" is called "layout". */ diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java index d8be5d0b2cb..e30b6771158 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsList.java @@ -1,5 +1,9 @@ package org.jabref.logic.protectedterms; +import org.jabref.logic.util.OS; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -9,11 +13,6 @@ import java.util.List; import java.util.Objects; -import org.jabref.logic.util.OS; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class ProtectedTermsList implements Comparable { private static final Logger LOGGER = LoggerFactory.getLogger(ProtectedTermsList.class); diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java index 2eb15b38661..8ec23f6ab65 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsLoader.java @@ -1,21 +1,14 @@ package org.jabref.logic.protectedterms; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.function.Supplier; - import org.jabref.logic.l10n.Localization; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.function.Supplier; + public class ProtectedTermsLoader { private static final Map> INTERNAL_LISTS = new HashMap<>(); diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java index 653f3e5ad3d..c5bf7954ccb 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsParser.java @@ -1,5 +1,9 @@ package org.jabref.logic.protectedterms; +import org.jabref.logic.l10n.Localization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; @@ -11,11 +15,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.logic.l10n.Localization; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Reads abbreviation files (property files using NAME = ABBREVIATION as a format) into a list of Abbreviations. */ diff --git a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java index 65ad5a3025d..b1608852143 100644 --- a/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java +++ b/src/main/java/org/jabref/logic/protectedterms/ProtectedTermsPreferences.java @@ -1,10 +1,10 @@ package org.jabref.logic.protectedterms; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.List; + public class ProtectedTermsPreferences { private final ObservableList enabledInternalTermLists; diff --git a/src/main/java/org/jabref/logic/remote/Protocol.java b/src/main/java/org/jabref/logic/remote/Protocol.java index eb610e17ec7..10b1b063091 100644 --- a/src/main/java/org/jabref/logic/remote/Protocol.java +++ b/src/main/java/org/jabref/logic/remote/Protocol.java @@ -1,5 +1,9 @@ package org.jabref.logic.remote; +import javafx.util.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -8,11 +12,6 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import javafx.util.Pair; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * @implNote The first byte of every message identifies its type as a {@link RemoteMessage}. * Every message is terminated with '\0'. diff --git a/src/main/java/org/jabref/logic/remote/RemotePreferences.java b/src/main/java/org/jabref/logic/remote/RemotePreferences.java index 5d06d28261b..6f4f61c56d0 100644 --- a/src/main/java/org/jabref/logic/remote/RemotePreferences.java +++ b/src/main/java/org/jabref/logic/remote/RemotePreferences.java @@ -1,13 +1,13 @@ package org.jabref.logic.remote; -import java.net.InetAddress; -import java.net.UnknownHostException; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleIntegerProperty; +import java.net.InetAddress; +import java.net.UnknownHostException; + /** * Place for handling the preferences for the remote communication */ diff --git a/src/main/java/org/jabref/logic/remote/client/RemoteClient.java b/src/main/java/org/jabref/logic/remote/client/RemoteClient.java index 65577a58442..f5b408f45ae 100644 --- a/src/main/java/org/jabref/logic/remote/client/RemoteClient.java +++ b/src/main/java/org/jabref/logic/remote/client/RemoteClient.java @@ -1,19 +1,17 @@ package org.jabref.logic.remote.client; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.Socket; - import javafx.util.Pair; - import org.jabref.logic.l10n.Localization; import org.jabref.logic.remote.Protocol; import org.jabref.logic.remote.RemoteMessage; import org.jabref.logic.remote.RemotePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; + public class RemoteClient { private static final Logger LOGGER = LoggerFactory.getLogger(RemoteClient.class); 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 492ca6ab24b..25c0a11025c 100644 --- a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java +++ b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServer.java @@ -1,19 +1,17 @@ package org.jabref.logic.remote.server; -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.SocketException; - import javafx.util.Pair; - import org.jabref.logic.remote.Protocol; import org.jabref.logic.remote.RemoteMessage; import org.jabref.logic.remote.RemotePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; + public class RemoteListenerServer implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(RemoteListenerServer.class); diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerManager.java b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerManager.java index 9f7a484b8c8..5a3cce949ef 100644 --- a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerManager.java +++ b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerManager.java @@ -1,13 +1,12 @@ package org.jabref.logic.remote.server; -import java.io.IOException; -import java.net.BindException; - import org.jabref.gui.JabRefExecutorService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.BindException; + /** * Manages the TeleServerThread through typical life cycle methods. *

    diff --git a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java index 431a45b0727..8c918aafdaf 100644 --- a/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java +++ b/src/main/java/org/jabref/logic/remote/server/RemoteListenerServerThread.java @@ -1,10 +1,10 @@ package org.jabref.logic.remote.server; -import java.io.IOException; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; + /** * This thread wrapper is required to be able to interrupt the remote listener server, e.g. when JabRef is closing down the server should shutdown as well. */ diff --git a/src/main/java/org/jabref/logic/search/DatabaseSearcher.java b/src/main/java/org/jabref/logic/search/DatabaseSearcher.java index 7e4bc10e75b..a7b21c13831 100644 --- a/src/main/java/org/jabref/logic/search/DatabaseSearcher.java +++ b/src/main/java/org/jabref/logic/search/DatabaseSearcher.java @@ -1,17 +1,16 @@ package org.jabref.logic.search; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabases; import org.jabref.model.entry.BibEntry; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + public class DatabaseSearcher { private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseSearcher.class); diff --git a/src/main/java/org/jabref/logic/search/SearchQuery.java b/src/main/java/org/jabref/logic/search/SearchQuery.java index 6452b749172..ce28ef3baa4 100644 --- a/src/main/java/org/jabref/logic/search/SearchQuery.java +++ b/src/main/java/org/jabref/logic/search/SearchQuery.java @@ -1,22 +1,14 @@ package org.jabref.logic.search; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.search.SearchMatcher; -import org.jabref.model.search.rules.ContainsBasedSearchRule; -import org.jabref.model.search.rules.GrammarBasedSearchRule; -import org.jabref.model.search.rules.SearchRule; -import org.jabref.model.search.rules.SearchRules; -import org.jabref.model.search.rules.SentenceAnalyzer; +import org.jabref.model.search.rules.*; + +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; public class SearchQuery implements SearchMatcher { diff --git a/src/main/java/org/jabref/logic/shared/DBMSConnection.java b/src/main/java/org/jabref/logic/shared/DBMSConnection.java index e0b19aa37a4..66bf9324528 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSConnection.java +++ b/src/main/java/org/jabref/logic/shared/DBMSConnection.java @@ -1,17 +1,16 @@ package org.jabref.logic.shared; +import org.jabref.logic.l10n.Localization; +import org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.HashSet; import java.util.Set; -import org.jabref.logic.l10n.Localization; -import org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class DBMSConnection implements DatabaseConnection { private static final Logger LOGGER = LoggerFactory.getLogger(DBMSConnection.class); diff --git a/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java b/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java index b79a19a9271..0f179787b1b 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java +++ b/src/main/java/org/jabref/logic/shared/DBMSConnectionProperties.java @@ -1,17 +1,16 @@ package org.jabref.logic.shared; +import org.jabref.logic.shared.prefs.SharedDatabasePreferences; +import org.jabref.logic.shared.security.Password; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; import java.util.Objects; import java.util.Optional; import java.util.Properties; -import org.jabref.logic.shared.prefs.SharedDatabasePreferences; -import org.jabref.logic.shared.security.Password; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Keeps all essential data for establishing a new connection to a DBMS using {@link DBMSConnection}. */ diff --git a/src/main/java/org/jabref/logic/shared/DBMSProcessor.java b/src/main/java/org/jabref/logic/shared/DBMSProcessor.java index 57ad276c15c..049a577132b 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSProcessor.java +++ b/src/main/java/org/jabref/logic/shared/DBMSProcessor.java @@ -1,23 +1,6 @@ package org.jabref.logic.shared; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.stream.Collectors; - +import com.google.common.collect.Lists; import org.jabref.logic.shared.exception.OfflineLockException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.SharedBibEntryData; @@ -26,11 +9,13 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.metadata.MetaData; - -import com.google.common.collect.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.sql.*; +import java.util.*; +import java.util.stream.Collectors; + /** * Processes all incoming or outgoing bib data to external SQL Database and manages its structure. */ diff --git a/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java b/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java index 605cc016ec2..e44bccbfcbd 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java +++ b/src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java @@ -1,15 +1,7 @@ package org.jabref.logic.shared; -import java.sql.Connection; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.exporter.BibDatabaseWriter; import org.jabref.logic.exporter.MetaDataSerializer; @@ -30,12 +22,14 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.metadata.event.MetaDataChangedEvent; import org.jabref.model.util.FileUpdateMonitor; - -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + /** * Synchronizes the shared or local databases with their opposite side. Local changes are pushed by {@link EntriesEvent} * using Google's Guava EventBus. diff --git a/src/main/java/org/jabref/logic/shared/MySQLProcessor.java b/src/main/java/org/jabref/logic/shared/MySQLProcessor.java index e2d6e233ba8..b27d50d2cc4 100644 --- a/src/main/java/org/jabref/logic/shared/MySQLProcessor.java +++ b/src/main/java/org/jabref/logic/shared/MySQLProcessor.java @@ -1,10 +1,10 @@ package org.jabref.logic.shared; +import org.jabref.model.metadata.MetaData; + import java.sql.SQLException; import java.util.Map; -import org.jabref.model.metadata.MetaData; - /** * Processes all incoming or outgoing bib data to MySQL Database and manages its structure. */ diff --git a/src/main/java/org/jabref/logic/shared/OracleProcessor.java b/src/main/java/org/jabref/logic/shared/OracleProcessor.java index d6034b56112..30fc6c6526d 100644 --- a/src/main/java/org/jabref/logic/shared/OracleProcessor.java +++ b/src/main/java/org/jabref/logic/shared/OracleProcessor.java @@ -1,5 +1,13 @@ package org.jabref.logic.shared; +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OracleStatement; +import oracle.jdbc.dcn.DatabaseChangeRegistration; +import org.jabref.logic.shared.listener.OracleNotificationListener; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.metadata.MetaData; + import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -10,15 +18,6 @@ import java.util.Properties; import java.util.stream.Collectors; -import org.jabref.logic.shared.listener.OracleNotificationListener; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.metadata.MetaData; - -import oracle.jdbc.OracleConnection; -import oracle.jdbc.OracleStatement; -import oracle.jdbc.dcn.DatabaseChangeRegistration; - /** * Processes all incoming or outgoing bib data to Oracle database and manages its structure. */ diff --git a/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java b/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java index c8f30d36621..c8dc8ec8819 100644 --- a/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java +++ b/src/main/java/org/jabref/logic/shared/PostgreSQLProcessor.java @@ -1,5 +1,11 @@ package org.jabref.logic.shared; +import org.jabref.gui.JabRefExecutorService; +import org.jabref.logic.shared.listener.PostgresSQLNotificationListener; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.metadata.MetaData; +import org.postgresql.PGConnection; + import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -7,13 +13,6 @@ import java.util.List; import java.util.Map; -import org.jabref.gui.JabRefExecutorService; -import org.jabref.logic.shared.listener.PostgresSQLNotificationListener; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.metadata.MetaData; - -import org.postgresql.PGConnection; - /** * Processes all incoming or outgoing bib data to PostgreSQL database and manages its structure. */ diff --git a/src/main/java/org/jabref/logic/shared/event/SharedEntriesNotPresentEvent.java b/src/main/java/org/jabref/logic/shared/event/SharedEntriesNotPresentEvent.java index 6972e60e90d..fd600616f51 100644 --- a/src/main/java/org/jabref/logic/shared/event/SharedEntriesNotPresentEvent.java +++ b/src/main/java/org/jabref/logic/shared/event/SharedEntriesNotPresentEvent.java @@ -1,9 +1,9 @@ package org.jabref.logic.shared.event; -import java.util.List; - import org.jabref.model.entry.BibEntry; +import java.util.List; + /** * This event is fired when the user tries to push changes of one or more obsolete * {@link BibEntry} to the server. 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 51aec6ddaaa..4f365bd7b5b 100644 --- a/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java +++ b/src/main/java/org/jabref/logic/shared/listener/OracleNotificationListener.java @@ -1,9 +1,8 @@ package org.jabref.logic.shared.listener; -import org.jabref.logic.shared.DBMSSynchronizer; - import oracle.jdbc.dcn.DatabaseChangeEvent; import oracle.jdbc.dcn.DatabaseChangeListener; +import org.jabref.logic.shared.DBMSSynchronizer; /** * A listener for Oracle database notifications. 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 96b8b7ccaf6..3db31c57d9a 100644 --- a/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java +++ b/src/main/java/org/jabref/logic/shared/listener/PostgresSQLNotificationListener.java @@ -1,15 +1,14 @@ package org.jabref.logic.shared.listener; -import java.sql.SQLException; - import org.jabref.logic.shared.DBMSProcessor; import org.jabref.logic.shared.DBMSSynchronizer; - import org.postgresql.PGConnection; import org.postgresql.PGNotification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.sql.SQLException; + /** * A listener for PostgreSQL database notifications. */ diff --git a/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java b/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java index 90cdc9aed80..2830ab744a3 100644 --- a/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java +++ b/src/main/java/org/jabref/logic/shared/prefs/SharedDatabasePreferences.java @@ -1,17 +1,16 @@ package org.jabref.logic.shared.prefs; +import org.jabref.logic.shared.DatabaseConnectionProperties; +import org.jabref.logic.shared.security.Password; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; import java.util.Optional; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; -import org.jabref.logic.shared.DatabaseConnectionProperties; -import org.jabref.logic.shared.security.Password; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class SharedDatabasePreferences { private static final Logger LOGGER = LoggerFactory.getLogger(SharedDatabasePreferences.class); 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 7d858e5b8f6..26822488c7c 100644 --- a/src/main/java/org/jabref/logic/shared/security/Password.java +++ b/src/main/java/org/jabref/logic/shared/security/Password.java @@ -1,5 +1,9 @@ package org.jabref.logic.shared.security; +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; @@ -8,11 +12,6 @@ import java.util.Arrays; import java.util.Base64; -import javax.crypto.Cipher; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; - /** * {@link Password} contains methods which are useful to encrypt and decrypt passwords using symetric algorithms. */ diff --git a/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java b/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java index 3e1ef545fda..a7d94b45895 100644 --- a/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java +++ b/src/main/java/org/jabref/logic/texparser/DefaultLatexParser.java @@ -1,11 +1,10 @@ package org.jabref.logic.texparser; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.LineNumberReader; -import java.io.Reader; -import java.io.UncheckedIOException; +import org.jabref.model.texparser.LatexParserResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; import java.nio.channels.ClosedChannelException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -16,11 +15,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.texparser.LatexParserResult; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class DefaultLatexParser implements LatexParser { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultLatexParser.class); diff --git a/src/main/java/org/jabref/logic/texparser/LatexParser.java b/src/main/java/org/jabref/logic/texparser/LatexParser.java index 9c64ff9a810..80f281576c9 100644 --- a/src/main/java/org/jabref/logic/texparser/LatexParser.java +++ b/src/main/java/org/jabref/logic/texparser/LatexParser.java @@ -1,10 +1,10 @@ package org.jabref.logic.texparser; +import org.jabref.model.texparser.LatexParserResult; + import java.nio.file.Path; import java.util.List; -import org.jabref.model.texparser.LatexParserResult; - /** * Parses a LaTeX file */ diff --git a/src/main/java/org/jabref/logic/texparser/TexBibEntriesResolver.java b/src/main/java/org/jabref/logic/texparser/TexBibEntriesResolver.java index 1ae74d4ae71..23df59e4be5 100644 --- a/src/main/java/org/jabref/logic/texparser/TexBibEntriesResolver.java +++ b/src/main/java/org/jabref/logic/texparser/TexBibEntriesResolver.java @@ -1,13 +1,5 @@ package org.jabref.logic.texparser; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.OpenDatabase; import org.jabref.logic.importer.ParserResult; @@ -18,10 +10,17 @@ import org.jabref.model.texparser.LatexParserResult; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.LibraryPreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class TexBibEntriesResolver { private static final Logger LOGGER = LoggerFactory.getLogger(TexBibEntriesResolver.class); diff --git a/src/main/java/org/jabref/logic/util/CoarseChangeFilter.java b/src/main/java/org/jabref/logic/util/CoarseChangeFilter.java index ca8694366b4..4a7f6abf521 100644 --- a/src/main/java/org/jabref/logic/util/CoarseChangeFilter.java +++ b/src/main/java/org/jabref/logic/util/CoarseChangeFilter.java @@ -1,15 +1,14 @@ package org.jabref.logic.util; -import java.util.Optional; - +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.event.BibDatabaseContextChangedEvent; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.FieldChangedEvent; import org.jabref.model.entry.field.Field; -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; +import java.util.Optional; /** * Filters change events and only relays major changes. diff --git a/src/main/java/org/jabref/logic/util/DelayTaskThrottler.java b/src/main/java/org/jabref/logic/util/DelayTaskThrottler.java index 4a5e7422edb..ab37e3b34cc 100644 --- a/src/main/java/org/jabref/logic/util/DelayTaskThrottler.java +++ b/src/main/java/org/jabref/logic/util/DelayTaskThrottler.java @@ -1,16 +1,11 @@ package org.jabref.logic.util; -import java.util.concurrent.Callable; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - import org.jabref.gui.JabRefExecutorService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.concurrent.*; + /** * This class allows to throttle a list of tasks. * Use case: you have an event that occurs often, and every time you want to invoke the same task. diff --git a/src/main/java/org/jabref/logic/util/ExternalLinkCreator.java b/src/main/java/org/jabref/logic/util/ExternalLinkCreator.java index 8e98318b544..cffe7cbdb42 100644 --- a/src/main/java/org/jabref/logic/util/ExternalLinkCreator.java +++ b/src/main/java/org/jabref/logic/util/ExternalLinkCreator.java @@ -1,12 +1,11 @@ package org.jabref.logic.util; -import java.net.URISyntaxException; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.apache.http.client.utils.URIBuilder; +import java.net.URISyntaxException; +import java.util.Optional; public class ExternalLinkCreator { private static final String SHORTSCIENCE_SEARCH_URL = "https://www.shortscience.org/internalsearch"; diff --git a/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java b/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java index cb28d4bc0a8..4d7fd90e2ed 100644 --- a/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java +++ b/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java @@ -1,13 +1,6 @@ package org.jabref.logic.util; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; /** * Specifies how metadata is read and written. diff --git a/src/main/java/org/jabref/logic/util/OS.java b/src/main/java/org/jabref/logic/util/OS.java index dbfb784f5bf..e0918f68908 100644 --- a/src/main/java/org/jabref/logic/util/OS.java +++ b/src/main/java/org/jabref/logic/util/OS.java @@ -1,18 +1,13 @@ package org.jabref.logic.util; -import java.util.Locale; - -import org.jabref.gui.desktop.os.DefaultDesktop; -import org.jabref.gui.desktop.os.Linux; -import org.jabref.gui.desktop.os.NativeDesktop; -import org.jabref.gui.desktop.os.OSX; -import org.jabref.gui.desktop.os.Windows; - import com.github.javakeyring.BackendNotSupportedException; import com.github.javakeyring.Keyring; import com.github.javakeyring.PasswordAccessException; +import org.jabref.gui.desktop.os.*; import org.slf4j.LoggerFactory; +import java.util.Locale; + /** * Operating system (OS) detection * diff --git a/src/main/java/org/jabref/logic/util/StandardFileType.java b/src/main/java/org/jabref/logic/util/StandardFileType.java index 27959d24280..b75f977da95 100644 --- a/src/main/java/org/jabref/logic/util/StandardFileType.java +++ b/src/main/java/org/jabref/logic/util/StandardFileType.java @@ -1,10 +1,10 @@ package org.jabref.logic.util; +import org.jabref.model.util.OptionalUtil; + import java.util.Arrays; import java.util.List; -import org.jabref.model.util.OptionalUtil; - /** * @implNote Enter the extensions in lowercase without a dot! The dot is added implicitly. */ diff --git a/src/main/java/org/jabref/logic/util/TestEntry.java b/src/main/java/org/jabref/logic/util/TestEntry.java index 7116c03d0a1..ee36799f833 100644 --- a/src/main/java/org/jabref/logic/util/TestEntry.java +++ b/src/main/java/org/jabref/logic/util/TestEntry.java @@ -1,11 +1,11 @@ package org.jabref.logic.util; -import java.util.Arrays; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; +import java.util.Arrays; + public class TestEntry { private TestEntry() {} diff --git a/src/main/java/org/jabref/logic/util/UnknownFileType.java b/src/main/java/org/jabref/logic/util/UnknownFileType.java index a2b7453d261..14b1ef677ec 100644 --- a/src/main/java/org/jabref/logic/util/UnknownFileType.java +++ b/src/main/java/org/jabref/logic/util/UnknownFileType.java @@ -1,10 +1,6 @@ package org.jabref.logic.util; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Objects; +import java.util.*; public class UnknownFileType implements FileType { diff --git a/src/main/java/org/jabref/logic/util/UpdateField.java b/src/main/java/org/jabref/logic/util/UpdateField.java index 2d270cc6833..46f10b3321e 100644 --- a/src/main/java/org/jabref/logic/util/UpdateField.java +++ b/src/main/java/org/jabref/logic/util/UpdateField.java @@ -1,8 +1,5 @@ package org.jabref.logic.util; -import java.util.Collection; -import java.util.Optional; - import org.jabref.logic.preferences.OwnerPreferences; import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.FieldChange; @@ -10,6 +7,9 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; +import java.util.Collection; +import java.util.Optional; + public class UpdateField { private UpdateField() {} diff --git a/src/main/java/org/jabref/logic/util/Version.java b/src/main/java/org/jabref/logic/util/Version.java index d853d7646ab..f33ac722db7 100644 --- a/src/main/java/org/jabref/logic/util/Version.java +++ b/src/main/java/org/jabref/logic/util/Version.java @@ -1,5 +1,10 @@ package org.jabref.logic.util; +import kong.unirest.json.JSONArray; +import kong.unirest.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -12,11 +17,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import kong.unirest.json.JSONArray; -import kong.unirest.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Represents the Application Version with the major and minor number, the full Version String and if it's a developer version */ diff --git a/src/main/java/org/jabref/logic/util/WebViewStore.java b/src/main/java/org/jabref/logic/util/WebViewStore.java index 55d26962e00..e8e1f1f3498 100644 --- a/src/main/java/org/jabref/logic/util/WebViewStore.java +++ b/src/main/java/org/jabref/logic/util/WebViewStore.java @@ -1,14 +1,13 @@ package org.jabref.logic.util; -import java.util.ArrayDeque; -import java.util.Queue; - import javafx.application.Platform; import javafx.scene.web.WebView; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayDeque; +import java.util.Queue; + /** * A dynamic web view store. This is used primarily to prevent UI freezes while constructing web view instances. */ diff --git a/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java b/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java index 5386d40b4fd..c1322626507 100644 --- a/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java +++ b/src/main/java/org/jabref/logic/util/io/AutoLinkPreferences.java @@ -1,12 +1,6 @@ package org.jabref.logic.util.io; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.ReadOnlyObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; public class AutoLinkPreferences { diff --git a/src/main/java/org/jabref/logic/util/io/BackupFileUtil.java b/src/main/java/org/jabref/logic/util/io/BackupFileUtil.java index 85603f803cf..0ce2403de89 100644 --- a/src/main/java/org/jabref/logic/util/io/BackupFileUtil.java +++ b/src/main/java/org/jabref/logic/util/io/BackupFileUtil.java @@ -1,5 +1,10 @@ package org.jabref.logic.util.io; +import org.jabref.gui.autosaveandbackup.BackupManager; +import org.jabref.logic.util.BackupFileType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.nio.ByteBuffer; import java.nio.file.Files; @@ -9,12 +14,6 @@ import java.util.HexFormat; import java.util.Optional; -import org.jabref.gui.autosaveandbackup.BackupManager; -import org.jabref.logic.util.BackupFileType; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BackupFileUtil { private static final Logger LOGGER = LoggerFactory.getLogger(BackupFileUtil.class); diff --git a/src/main/java/org/jabref/logic/util/io/CitationKeyBasedFileFinder.java b/src/main/java/org/jabref/logic/util/io/CitationKeyBasedFileFinder.java index db629fb457f..e66a77a9b6e 100644 --- a/src/main/java/org/jabref/logic/util/io/CitationKeyBasedFileFinder.java +++ b/src/main/java/org/jabref/logic/util/io/CitationKeyBasedFileFinder.java @@ -1,26 +1,20 @@ package org.jabref.logic.util.io; +import org.jabref.logic.citationkeypattern.CitationKeyGenerator; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; + import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.FileVisitOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.function.BiPredicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.logic.citationkeypattern.CitationKeyGenerator; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.strings.StringUtil; - class CitationKeyBasedFileFinder implements FileFinder { private final boolean exactKeyOnly; 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 a2145450587..0d1d870757b 100644 --- a/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java +++ b/src/main/java/org/jabref/logic/util/io/DatabaseFileLookup.java @@ -1,20 +1,15 @@ package org.jabref.logic.util.io; -import java.io.File; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.FilePreferences; +import java.io.File; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + /** * Search class for files.
    *
    diff --git a/src/main/java/org/jabref/logic/util/io/FileFinder.java b/src/main/java/org/jabref/logic/util/io/FileFinder.java index e449b796e0c..6a6ff79a74e 100644 --- a/src/main/java/org/jabref/logic/util/io/FileFinder.java +++ b/src/main/java/org/jabref/logic/util/io/FileFinder.java @@ -1,11 +1,11 @@ package org.jabref.logic.util.io; +import org.jabref.model.entry.BibEntry; + import java.io.IOException; import java.nio.file.Path; import java.util.List; -import org.jabref.model.entry.BibEntry; - public interface FileFinder { /** diff --git a/src/main/java/org/jabref/logic/util/io/FileHistory.java b/src/main/java/org/jabref/logic/util/io/FileHistory.java index 4281c36306e..90c58bd7ab6 100644 --- a/src/main/java/org/jabref/logic/util/io/FileHistory.java +++ b/src/main/java/org/jabref/logic/util/io/FileHistory.java @@ -1,11 +1,11 @@ package org.jabref.logic.util.io; +import javafx.collections.ModifiableObservableListBase; + import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import javafx.collections.ModifiableObservableListBase; - public class FileHistory extends ModifiableObservableListBase { private static final int HISTORY_SIZE = 8; diff --git a/src/main/java/org/jabref/logic/util/io/FileNameUniqueness.java b/src/main/java/org/jabref/logic/util/io/FileNameUniqueness.java index 8830788e9a3..675639ec65f 100644 --- a/src/main/java/org/jabref/logic/util/io/FileNameUniqueness.java +++ b/src/main/java/org/jabref/logic/util/io/FileNameUniqueness.java @@ -1,5 +1,8 @@ package org.jabref.logic.util.io; +import org.jabref.gui.DialogService; +import org.jabref.logic.l10n.Localization; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -8,9 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.gui.DialogService; -import org.jabref.logic.l10n.Localization; - public class FileNameUniqueness { private static final Pattern DUPLICATE_MARK_PATTERN = Pattern.compile("(.*) \\(\\d+\\)"); 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 76c7e3393d5..dc530d3f44a 100644 --- a/src/main/java/org/jabref/logic/util/io/FileUtil.java +++ b/src/main/java/org/jabref/logic/util/io/FileUtil.java @@ -1,37 +1,23 @@ package org.jabref.logic.util.io; -import java.io.File; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.InvalidPathException; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.Deque; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.logic.citationkeypattern.BracketedPattern; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.*; +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; + /** * The idea of this class is to add general functionality that could possibly even in the *
    Java NIO package, diff --git a/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java b/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java index a4aa4994e00..5031dd9638f 100644 --- a/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java +++ b/src/main/java/org/jabref/logic/util/io/RegExpBasedFileFinder.java @@ -1,5 +1,9 @@ package org.jabref.logic.util.io; +import org.jabref.logic.citationkeypattern.BracketedPattern; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; + import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; @@ -17,10 +21,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.logic.citationkeypattern.BracketedPattern; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.strings.StringUtil; - class RegExpBasedFileFinder implements FileFinder { private static final String EXT_MARKER = "__EXTENSION__"; diff --git a/src/main/java/org/jabref/logic/util/io/XMLUtil.java b/src/main/java/org/jabref/logic/util/io/XMLUtil.java index 6ce97fe76c6..7a909e60506 100644 --- a/src/main/java/org/jabref/logic/util/io/XMLUtil.java +++ b/src/main/java/org/jabref/logic/util/io/XMLUtil.java @@ -1,11 +1,9 @@ package org.jabref.logic.util.io; -import java.io.StringWriter; -import java.util.AbstractList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.RandomAccess; +import org.jabref.architecture.AllowedToUseStandardStreams; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.*; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; @@ -13,16 +11,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; - -import org.jabref.architecture.AllowedToUseStandardStreams; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import java.io.StringWriter; +import java.util.*; /** * Currently used for debugging only diff --git a/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java b/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java index 2b83e2b9a8d..50171f90afa 100644 --- a/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java +++ b/src/main/java/org/jabref/logic/util/strings/StringSimilarity.java @@ -1,9 +1,9 @@ package org.jabref.logic.util.strings; -import java.util.Locale; - import info.debatty.java.stringsimilarity.Levenshtein; +import java.util.Locale; + public class StringSimilarity { private final Levenshtein METRIC_DISTANCE = new Levenshtein(); // edit distance threshold for entry title comparison diff --git a/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java b/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java index 9c6ce27e82f..dc53d1c0948 100644 --- a/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java +++ b/src/main/java/org/jabref/logic/xmp/DocumentInformationExtractor.java @@ -1,8 +1,9 @@ package org.jabref.logic.xmp; -import java.util.Map; -import java.util.Optional; - +import org.apache.pdfbox.cos.COSBase; +import org.apache.pdfbox.cos.COSDictionary; +import org.apache.pdfbox.cos.COSName; +import org.apache.pdfbox.pdmodel.PDDocumentInformation; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; @@ -10,10 +11,8 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryTypeFactory; -import org.apache.pdfbox.cos.COSBase; -import org.apache.pdfbox.cos.COSDictionary; -import org.apache.pdfbox.cos.COSName; -import org.apache.pdfbox.pdmodel.PDDocumentInformation; +import java.util.Map; +import java.util.Optional; public class DocumentInformationExtractor { diff --git a/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java b/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java index 1b15e0cd282..f961424cde2 100644 --- a/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java +++ b/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java @@ -1,36 +1,27 @@ package org.jabref.logic.xmp; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.function.Consumer; -import java.util.function.Predicate; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.xmpbox.schema.DublinCoreSchema; +import org.apache.xmpbox.type.BadFieldValueException; import org.jabref.logic.TypedBibEntry; import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseMode; -import org.jabref.model.entry.Author; -import org.jabref.model.entry.AuthorList; -import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; -import org.jabref.model.entry.Month; +import org.jabref.model.entry.*; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.strings.StringUtil; - -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.xmpbox.schema.DublinCoreSchema; -import org.apache.xmpbox.type.BadFieldValueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; + /** * This class is used for both conversion from Dublin Core to BibTeX and conversion form BibTeX to Dublin Core */ diff --git a/src/main/java/org/jabref/logic/xmp/XmpPreferences.java b/src/main/java/org/jabref/logic/xmp/XmpPreferences.java index 5b02c3681ac..a635959fbfe 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpPreferences.java +++ b/src/main/java/org/jabref/logic/xmp/XmpPreferences.java @@ -1,15 +1,14 @@ package org.jabref.logic.xmp; -import java.util.Set; - import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableSet; - import org.jabref.model.entry.field.Field; +import java.util.Set; + public class XmpPreferences { private final BooleanProperty useXmpPrivacyFilter; diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java index 67b2f56e180..09d6babd016 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilReader.java @@ -1,17 +1,5 @@ package org.jabref.logic.xmp; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; - -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.LinkedFile; -import org.jabref.model.schema.DublinCoreSchemaCustom; - import org.apache.pdfbox.Loader; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocumentCatalog; @@ -19,9 +7,20 @@ import org.apache.pdfbox.pdmodel.common.PDMetadata; import org.apache.xmpbox.XMPMetadata; import org.apache.xmpbox.schema.DublinCoreSchema; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.LinkedFile; +import org.jabref.model.schema.DublinCoreSchemaCustom; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; + public class XmpUtilReader { private static final Logger LOGGER = LoggerFactory.getLogger(XmpUtilReader.class); diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java b/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java index a50fc107fc2..b136f0aca06 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilShared.java @@ -1,17 +1,16 @@ package org.jabref.logic.xmp; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Path; -import java.util.List; - -import org.jabref.model.entry.BibEntry; - import org.apache.xmpbox.XMPMetadata; import org.apache.xmpbox.xml.DomXmpParser; +import org.jabref.model.entry.BibEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; +import java.util.List; + /** * XMPUtilShared provides support for reading (@link XMPUtilReader) and writing (@link XMPUtilWriter) BibTex data as XMP metadata * in PDF-documents. diff --git a/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java b/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java index 9ce0ff99266..8bfe1d32144 100644 --- a/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java +++ b/src/main/java/org/jabref/logic/xmp/XmpUtilWriter.java @@ -1,5 +1,25 @@ package org.jabref.logic.xmp; +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDDocumentCatalog; +import org.apache.pdfbox.pdmodel.PDDocumentInformation; +import org.apache.pdfbox.pdmodel.common.PDMetadata; +import org.apache.xmpbox.XMPMetadata; +import org.apache.xmpbox.schema.DublinCoreSchema; +import org.apache.xmpbox.xml.XmpSerializer; +import org.jabref.logic.exporter.EmbeddedBibFilePdfExporter; +import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; +import org.jabref.logic.util.io.FileUtil; +import org.jabref.model.database.BibDatabase; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.schema.DublinCoreSchemaCustom; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.transform.TransformerException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -12,28 +32,6 @@ import java.util.function.Predicate; import java.util.stream.Collectors; -import javax.xml.transform.TransformerException; - -import org.jabref.logic.exporter.EmbeddedBibFilePdfExporter; -import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; -import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.database.BibDatabase; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.schema.DublinCoreSchemaCustom; - -import org.apache.pdfbox.Loader; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDDocumentCatalog; -import org.apache.pdfbox.pdmodel.PDDocumentInformation; -import org.apache.pdfbox.pdmodel.common.PDMetadata; -import org.apache.xmpbox.XMPMetadata; -import org.apache.xmpbox.schema.DublinCoreSchema; -import org.apache.xmpbox.xml.XmpSerializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Writes given BibEntries into the XMP part of a PDF file. * diff --git a/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java b/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java index 3d6fe280f1d..2cc8697de05 100644 --- a/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java +++ b/src/main/java/org/jabref/migrations/ConvertLegacyExplicitGroups.java @@ -1,14 +1,14 @@ package org.jabref.migrations; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - import org.jabref.logic.importer.ParserResult; import org.jabref.model.entry.BibEntry; import org.jabref.model.groups.ExplicitGroup; import org.jabref.model.groups.GroupTreeNode; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + /** * Converts legacy explicit groups, where the group contained a list of assigned entries, to the new format, * where the entry stores a list of groups it belongs to. diff --git a/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java b/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java index c4d08bad58b..6b72ee1527b 100644 --- a/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java +++ b/src/main/java/org/jabref/migrations/ConvertMarkingToGroups.java @@ -1,15 +1,8 @@ package org.jabref.migrations; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import com.google.common.collect.Multimap; +import com.google.common.collect.MultimapBuilder; import javafx.collections.ObservableList; - import org.jabref.logic.groups.DefaultGroupsFactory; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; @@ -19,8 +12,9 @@ import org.jabref.model.groups.GroupHierarchyType; import org.jabref.model.groups.GroupTreeNode; -import com.google.common.collect.Multimap; -import com.google.common.collect.MultimapBuilder; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Converts legacy explicit groups, where the group contained a list of assigned entries, to the new format, diff --git a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java index e92d95be4c4..b9a6a5c082e 100644 --- a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java +++ b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java @@ -1,10 +1,5 @@ package org.jabref.migrations; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; @@ -13,6 +8,11 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.preferences.JabRefPreferences; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + class CustomEntryTypePreferenceMigration { // non-default preferences diff --git a/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java b/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java index 80c2e6e4b2a..c1cc3302c3a 100644 --- a/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java +++ b/src/main/java/org/jabref/migrations/MergeReviewIntoCommentMigration.java @@ -1,17 +1,16 @@ package org.jabref.migrations; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import org.jabref.logic.importer.ParserResult; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + public class MergeReviewIntoCommentMigration { private static final Logger LOGGER = LoggerFactory.getLogger(MergeReviewIntoCommentMigration.class); diff --git a/src/main/java/org/jabref/migrations/PreferencesMigrations.java b/src/main/java/org/jabref/migrations/PreferencesMigrations.java index 41daa1f741e..ee6416e6e6a 100644 --- a/src/main/java/org/jabref/migrations/PreferencesMigrations.java +++ b/src/main/java/org/jabref/migrations/PreferencesMigrations.java @@ -1,21 +1,7 @@ package org.jabref.migrations; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.function.UnaryOperator; -import java.util.prefs.BackingStoreException; -import java.util.prefs.Preferences; -import java.util.stream.Collectors; - +import com.github.javakeyring.Keyring; import javafx.scene.control.TableColumn; - import org.jabref.gui.maintable.ColumnPreferences; import org.jabref.gui.maintable.MainTableColumnModel; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; @@ -29,11 +15,15 @@ import org.jabref.model.strings.StringUtil; import org.jabref.preferences.CleanupPreferences; import org.jabref.preferences.JabRefPreferences; - -import com.github.javakeyring.Keyring; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.function.UnaryOperator; +import java.util.prefs.BackingStoreException; +import java.util.prefs.Preferences; +import java.util.stream.Collectors; + public class PreferencesMigrations { private static final Logger LOGGER = LoggerFactory.getLogger(PreferencesMigrations.class); diff --git a/src/main/java/org/jabref/migrations/SpecialFieldsToSeparateFields.java b/src/main/java/org/jabref/migrations/SpecialFieldsToSeparateFields.java index 73231790582..d68e66f090e 100644 --- a/src/main/java/org/jabref/migrations/SpecialFieldsToSeparateFields.java +++ b/src/main/java/org/jabref/migrations/SpecialFieldsToSeparateFields.java @@ -1,12 +1,5 @@ package org.jabref.migrations; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.logic.importer.ParserResult; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Keyword; @@ -14,6 +7,9 @@ import org.jabref.model.entry.field.SpecialField; import org.jabref.model.entry.field.SpecialFieldValue; +import java.util.*; +import java.util.stream.Collectors; + public class SpecialFieldsToSeparateFields implements PostOpenMigration { private final KeywordList possibleKeywordsToMigrate; private final Character keywordDelimiter; diff --git a/src/main/java/org/jabref/model/ChainNode.java b/src/main/java/org/jabref/model/ChainNode.java index ea35d5fdcd0..1238db52fb5 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. +// valid. public abstract class ChainNode> { /** diff --git a/src/main/java/org/jabref/model/FieldChange.java b/src/main/java/org/jabref/model/FieldChange.java index 1a99530bb30..6a6345894ad 100644 --- a/src/main/java/org/jabref/model/FieldChange.java +++ b/src/main/java/org/jabref/model/FieldChange.java @@ -1,10 +1,10 @@ package org.jabref.model; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; +import java.util.Objects; + /** * This class is used in the instance of a field being modified, removed or added. */ diff --git a/src/main/java/org/jabref/model/TreeNode.java b/src/main/java/org/jabref/model/TreeNode.java index daf05aa6123..e5cadcd1059 100644 --- a/src/main/java/org/jabref/model/TreeNode.java +++ b/src/main/java/org/jabref/model/TreeNode.java @@ -1,16 +1,12 @@ package org.jabref.model; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; -import java.util.function.Predicate; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; + /** * Represents a node in a tree. *

    diff --git a/src/main/java/org/jabref/model/database/BibDatabase.java b/src/main/java/org/jabref/model/database/BibDatabase.java index 9daa86b6647..51f364f2a93 100644 --- a/src/main/java/org/jabref/model/database/BibDatabase.java +++ b/src/main/java/org/jabref/model/database/BibDatabase.java @@ -1,26 +1,9 @@ package org.jabref.model.database; -import java.math.BigInteger; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.logic.bibtex.FieldWriter; import org.jabref.model.database.event.EntriesAddedEvent; import org.jabref.model.database.event.EntriesRemovedEvent; @@ -34,12 +17,16 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.strings.StringUtil; - -import com.google.common.eventbus.EventBus; -import com.google.common.eventbus.Subscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.math.BigInteger; +import java.security.SecureRandom; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + /** * A bibliography database. This is the "bib" file (or the library stored in a shared SQL database) */ diff --git a/src/main/java/org/jabref/model/database/BibDatabaseContext.java b/src/main/java/org/jabref/model/database/BibDatabaseContext.java index 986cf3005a9..82dcd885c27 100644 --- a/src/main/java/org/jabref/model/database/BibDatabaseContext.java +++ b/src/main/java/org/jabref/model/database/BibDatabaseContext.java @@ -1,13 +1,5 @@ package org.jabref.model.database; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.gui.LibraryTab; import org.jabref.logic.crawler.Crawler; @@ -20,10 +12,17 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.study.Study; import org.jabref.preferences.FilePreferences; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + /** * Represents everything related to a BIB file. * diff --git a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java index 86514752cbf..e35ae5c6f91 100644 --- a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java +++ b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java @@ -1,11 +1,11 @@ package org.jabref.model.database; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.EntryTypeFactory; +import java.util.stream.Stream; + public class BibDatabaseModeDetection { private BibDatabaseModeDetection() {} diff --git a/src/main/java/org/jabref/model/database/BibDatabases.java b/src/main/java/org/jabref/model/database/BibDatabases.java index b258eb504b7..8f7da765a23 100644 --- a/src/main/java/org/jabref/model/database/BibDatabases.java +++ b/src/main/java/org/jabref/model/database/BibDatabases.java @@ -1,11 +1,11 @@ package org.jabref.model.database; +import org.jabref.model.entry.BibEntry; + import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import org.jabref.model.entry.BibEntry; - public class BibDatabases { private BibDatabases() {} diff --git a/src/main/java/org/jabref/model/database/KeyChangeListener.java b/src/main/java/org/jabref/model/database/KeyChangeListener.java index 7c6f196c4a1..efe52f29aaf 100644 --- a/src/main/java/org/jabref/model/database/KeyChangeListener.java +++ b/src/main/java/org/jabref/model/database/KeyChangeListener.java @@ -1,10 +1,6 @@ package org.jabref.model.database; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - +import com.google.common.eventbus.Subscribe; import org.jabref.model.database.event.EntriesRemovedEvent; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.FieldChangedEvent; @@ -13,7 +9,10 @@ import org.jabref.model.entry.field.FieldProperty; import org.jabref.model.entry.field.InternalField; -import com.google.common.eventbus.Subscribe; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; public class KeyChangeListener { 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 c748501d8eb..d586b1ef183 100644 --- a/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java +++ b/src/main/java/org/jabref/model/database/event/EntriesAddedEvent.java @@ -1,12 +1,12 @@ package org.jabref.model.database.event; -import java.util.List; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntriesEvent; import org.jabref.model.entry.event.EntriesEventSource; +import java.util.List; + /** * {@link EntriesAddedEvent} is fired when at least {@link BibEntry} is being added to the {@link BibDatabase}. */ 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 8dd4d2e3e58..1d1fa983707 100644 --- a/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java +++ b/src/main/java/org/jabref/model/database/event/EntriesRemovedEvent.java @@ -1,11 +1,11 @@ package org.jabref.model.database.event; -import java.util.List; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.event.EntriesEvent; import org.jabref.model.entry.event.EntriesEventSource; +import java.util.List; + /** * EntriesRemovedEvent is fired when at least one BibEntry is being removed * from the database. diff --git a/src/main/java/org/jabref/model/entry/Author.java b/src/main/java/org/jabref/model/entry/Author.java index 55c9be23a5a..616afb000dc 100644 --- a/src/main/java/org/jabref/model/entry/Author.java +++ b/src/main/java/org/jabref/model/entry/Author.java @@ -1,11 +1,11 @@ package org.jabref.model.entry; -import java.util.Objects; -import java.util.Optional; - import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.strings.StringUtil; +import java.util.Objects; +import java.util.Optional; + /** * This is an immutable class that keeps information regarding single author. It is just a container for the information, with very simple methods to access it. *

    diff --git a/src/main/java/org/jabref/model/entry/AuthorList.java b/src/main/java/org/jabref/model/entry/AuthorList.java index 67082e9c55d..b8fb8ef81ce 100644 --- a/src/main/java/org/jabref/model/entry/AuthorList.java +++ b/src/main/java/org/jabref/model/entry/AuthorList.java @@ -1,17 +1,13 @@ package org.jabref.model.entry; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.WeakHashMap; +import org.jabref.architecture.AllowedToUseLogic; +import org.jabref.logic.importer.AuthorListParser; + +import java.util.*; import java.util.function.Function; import java.util.stream.Collector; import java.util.stream.Collectors; -import org.jabref.architecture.AllowedToUseLogic; -import org.jabref.logic.importer.AuthorListParser; - /** * This is an immutable class representing information of either author or editor field in bibtex record. *

    diff --git a/src/main/java/org/jabref/model/entry/BibEntry.java b/src/main/java/org/jabref/model/entry/BibEntry.java index 1e02a5e5aa9..42dd2b5ce5b 100644 --- a/src/main/java/org/jabref/model/entry/BibEntry.java +++ b/src/main/java/org/jabref/model/entry/BibEntry.java @@ -1,27 +1,13 @@ package org.jabref.model.entry; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.BiFunction; -import java.util.stream.Collectors; - +import com.google.common.eventbus.EventBus; +import com.tobiasdiez.easybind.EasyBind; +import com.tobiasdiez.easybind.optional.OptionalBinding; import javafx.beans.Observable; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableMap; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.logic.importer.util.FileFieldParser; @@ -42,13 +28,14 @@ import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.MultiKeyMap; - -import com.google.common.eventbus.EventBus; -import com.tobiasdiez.easybind.EasyBind; -import com.tobiasdiez.easybind.optional.OptionalBinding; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.BiFunction; +import java.util.stream.Collectors; + /** * Represents a Bib(La)TeX entry, which can be BibTeX or BibLaTeX. *

    diff --git a/src/main/java/org/jabref/model/entry/BibEntryType.java b/src/main/java/org/jabref/model/entry/BibEntryType.java index 0374bc6d1bd..7fbb3b16eb7 100644 --- a/src/main/java/org/jabref/model/entry/BibEntryType.java +++ b/src/main/java/org/jabref/model/entry/BibEntryType.java @@ -1,22 +1,14 @@ package org.jabref.model.entry; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.gui.importer.BibEntryTypePrefsAndFileViewModel; import org.jabref.logic.exporter.MetaDataSerializer; import org.jabref.model.database.BibDatabaseMode; -import org.jabref.model.entry.field.BibField; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldPriority; -import org.jabref.model.entry.field.OrFields; -import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.types.EntryType; +import java.util.*; +import java.util.stream.Collectors; + public class BibEntryType implements Comparable { private final EntryType type; diff --git a/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java b/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java index f4bc46db97c..5b654dce1ec 100644 --- a/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java +++ b/src/main/java/org/jabref/model/entry/BibEntryTypeBuilder.java @@ -1,13 +1,6 @@ package org.jabref.model.entry; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - +import com.google.common.collect.Streams; import org.jabref.model.entry.field.BibField; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldPriority; @@ -15,7 +8,9 @@ import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; -import com.google.common.collect.Streams; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; public class BibEntryTypeBuilder { diff --git a/src/main/java/org/jabref/model/entry/BibEntryTypesManager.java b/src/main/java/org/jabref/model/entry/BibEntryTypesManager.java index cf3b5c007f7..f1e755f9904 100644 --- a/src/main/java/org/jabref/model/entry/BibEntryTypesManager.java +++ b/src/main/java/org/jabref/model/entry/BibEntryTypesManager.java @@ -1,23 +1,13 @@ package org.jabref.model.entry; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.SortedSet; -import java.util.TreeSet; +import org.jabref.model.database.BibDatabaseMode; +import org.jabref.model.entry.types.*; + +import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.model.database.BibDatabaseMode; -import org.jabref.model.entry.types.BiblatexAPAEntryTypeDefinitions; -import org.jabref.model.entry.types.BiblatexEntryTypeDefinitions; -import org.jabref.model.entry.types.BiblatexSoftwareEntryTypeDefinitions; -import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; -import org.jabref.model.entry.types.EntryType; -import org.jabref.model.entry.types.EntryTypeFactory; -import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; - public class BibEntryTypesManager { private final InternalEntryTypes BIBTEX_ENTRYTYPES = new InternalEntryTypes( Stream.concat(BibtexEntryTypeDefinitions.ALL.stream(), IEEETranEntryTypeDefinitions.ALL.stream()) diff --git a/src/main/java/org/jabref/model/entry/CanonicalBibEntry.java b/src/main/java/org/jabref/model/entry/CanonicalBibEntry.java index 63ade49d2fb..6d16737f9f1 100644 --- a/src/main/java/org/jabref/model/entry/CanonicalBibEntry.java +++ b/src/main/java/org/jabref/model/entry/CanonicalBibEntry.java @@ -1,16 +1,11 @@ package org.jabref.model.entry; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.SortedSet; -import java.util.StringJoiner; -import java.util.TreeSet; - import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.InternalField; +import java.util.*; +import java.util.Map.Entry; + public class CanonicalBibEntry { private CanonicalBibEntry() {} diff --git a/src/main/java/org/jabref/model/entry/Date.java b/src/main/java/org/jabref/model/entry/Date.java index e038d4f93b3..04a84603c3e 100644 --- a/src/main/java/org/jabref/model/entry/Date.java +++ b/src/main/java/org/jabref/model/entry/Date.java @@ -1,5 +1,8 @@ package org.jabref.model.entry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.time.LocalDate; import java.time.Year; import java.time.YearMonth; @@ -8,14 +11,7 @@ import java.time.format.DateTimeParseException; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.*; public class Date { diff --git a/src/main/java/org/jabref/model/entry/EntryConverter.java b/src/main/java/org/jabref/model/entry/EntryConverter.java index 82c247dca1b..1f3da25fc02 100644 --- a/src/main/java/org/jabref/model/entry/EntryConverter.java +++ b/src/main/java/org/jabref/model/entry/EntryConverter.java @@ -1,12 +1,12 @@ package org.jabref.model.entry; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; + import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - /** * Converts Entry models from BibTex to biblatex and back. */ diff --git a/src/main/java/org/jabref/model/entry/EntryLinkList.java b/src/main/java/org/jabref/model/entry/EntryLinkList.java index 2e555d4c446..7f1b9d6b6f4 100644 --- a/src/main/java/org/jabref/model/entry/EntryLinkList.java +++ b/src/main/java/org/jabref/model/entry/EntryLinkList.java @@ -1,11 +1,11 @@ package org.jabref.model.entry; +import org.jabref.model.database.BibDatabase; + import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import org.jabref.model.database.BibDatabase; - public class EntryLinkList { private static String SEPARATOR = ","; diff --git a/src/main/java/org/jabref/model/entry/Keyword.java b/src/main/java/org/jabref/model/entry/Keyword.java index ba370c73590..eac8b89c0e5 100644 --- a/src/main/java/org/jabref/model/entry/Keyword.java +++ b/src/main/java/org/jabref/model/entry/Keyword.java @@ -1,12 +1,12 @@ package org.jabref.model.entry; +import org.jabref.model.ChainNode; + import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.model.ChainNode; - /** * Represents a keyword in a chain of keywords. * For example, "JabRef" in "Bibliographic manager > Awesome ones > JabRef" diff --git a/src/main/java/org/jabref/model/entry/KeywordList.java b/src/main/java/org/jabref/model/entry/KeywordList.java index d40c43c5c5e..021817b8096 100644 --- a/src/main/java/org/jabref/model/entry/KeywordList.java +++ b/src/main/java/org/jabref/model/entry/KeywordList.java @@ -1,19 +1,11 @@ package org.jabref.model.entry; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.StringTokenizer; +import org.jabref.model.strings.StringUtil; + +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.model.strings.StringUtil; - /** * Represents a list of keyword chains. * For example, "Type > A, Type > B, Something else". diff --git a/src/main/java/org/jabref/model/entry/LinkedFile.java b/src/main/java/org/jabref/model/entry/LinkedFile.java index e645d0f590f..a2bb8037a7c 100644 --- a/src/main/java/org/jabref/model/entry/LinkedFile.java +++ b/src/main/java/org/jabref/model/entry/LinkedFile.java @@ -1,5 +1,13 @@ package org.jabref.model.entry; +import javafx.beans.Observable; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import org.jabref.architecture.AllowedToUseLogic; +import org.jabref.logic.util.io.FileUtil; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.preferences.FilePreferences; + import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -13,15 +21,6 @@ import java.util.Optional; import java.util.regex.Pattern; -import javafx.beans.Observable; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - -import org.jabref.architecture.AllowedToUseLogic; -import org.jabref.logic.util.io.FileUtil; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.preferences.FilePreferences; - /** * Represents the link to an external file (e.g. associated PDF file). * This class is {@link Serializable} which is needed for drag and drop in gui diff --git a/src/main/java/org/jabref/model/entry/Month.java b/src/main/java/org/jabref/model/entry/Month.java index 71e3f27322d..80c89e7458a 100644 --- a/src/main/java/org/jabref/model/entry/Month.java +++ b/src/main/java/org/jabref/model/entry/Month.java @@ -1,10 +1,10 @@ package org.jabref.model.entry; -import java.util.Optional; - import org.jabref.logic.bibtex.FieldWriter; import org.jabref.model.strings.StringUtil; +import java.util.Optional; + /** * Represents a Month of the Year. */ diff --git a/src/main/java/org/jabref/model/entry/ParsedEntryLink.java b/src/main/java/org/jabref/model/entry/ParsedEntryLink.java index dd989692d95..4e73668ee39 100644 --- a/src/main/java/org/jabref/model/entry/ParsedEntryLink.java +++ b/src/main/java/org/jabref/model/entry/ParsedEntryLink.java @@ -1,10 +1,10 @@ package org.jabref.model.entry; +import org.jabref.model.database.BibDatabase; + import java.util.Objects; import java.util.Optional; -import org.jabref.model.database.BibDatabase; - public class ParsedEntryLink { private String key; diff --git a/src/main/java/org/jabref/model/entry/event/EntriesEvent.java b/src/main/java/org/jabref/model/entry/event/EntriesEvent.java index e44aa89ca9f..187e7b46b71 100644 --- a/src/main/java/org/jabref/model/entry/event/EntriesEvent.java +++ b/src/main/java/org/jabref/model/entry/event/EntriesEvent.java @@ -1,11 +1,11 @@ package org.jabref.model.entry.event; -import java.util.List; -import java.util.Objects; - import org.jabref.model.database.event.BibDatabaseContextChangedEvent; import org.jabref.model.entry.BibEntry; +import java.util.List; +import java.util.Objects; + /** * This abstract class pretends a minimal set of attributes and methods which an entries event should have. */ diff --git a/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java b/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java index 02fffc45504..5acf91e3774 100644 --- a/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java +++ b/src/main/java/org/jabref/model/entry/event/EntryChangedEvent.java @@ -1,9 +1,9 @@ package org.jabref.model.entry.event; -import java.util.Collections; - import org.jabref.model.entry.BibEntry; +import java.util.Collections; + /** * EntryChangedEvent is fired when a BibEntry has been changed. */ diff --git a/src/main/java/org/jabref/model/entry/field/BiblatexApaField.java b/src/main/java/org/jabref/model/entry/field/BiblatexApaField.java index c42e6395662..ba67d6daaa3 100644 --- a/src/main/java/org/jabref/model/entry/field/BiblatexApaField.java +++ b/src/main/java/org/jabref/model/entry/field/BiblatexApaField.java @@ -1,12 +1,12 @@ package org.jabref.model.entry.field; +import org.jabref.model.entry.types.BiblatexApaEntryType; + import java.util.Arrays; import java.util.EnumSet; import java.util.Optional; import java.util.Set; -import org.jabref.model.entry.types.BiblatexApaEntryType; - public enum BiblatexApaField implements Field { AMENDMENT("amendment"), ARTICLE("article"), diff --git a/src/main/java/org/jabref/model/entry/field/BiblatexSoftwareField.java b/src/main/java/org/jabref/model/entry/field/BiblatexSoftwareField.java index de0bd539bb3..b0b190c3c5a 100644 --- a/src/main/java/org/jabref/model/entry/field/BiblatexSoftwareField.java +++ b/src/main/java/org/jabref/model/entry/field/BiblatexSoftwareField.java @@ -1,12 +1,12 @@ package org.jabref.model.entry.field; +import org.jabref.model.entry.types.BiblatexSoftwareEntryType; + import java.util.Arrays; import java.util.EnumSet; import java.util.Optional; import java.util.Set; -import org.jabref.model.entry.types.BiblatexSoftwareEntryType; - public enum BiblatexSoftwareField implements Field { HALID("hal_id"), HALVERSION("hal_version"), diff --git a/src/main/java/org/jabref/model/entry/field/Field.java b/src/main/java/org/jabref/model/entry/field/Field.java index ec3055e493c..42134997f73 100644 --- a/src/main/java/org/jabref/model/entry/field/Field.java +++ b/src/main/java/org/jabref/model/entry/field/Field.java @@ -1,10 +1,10 @@ package org.jabref.model.entry.field; +import org.jabref.model.strings.StringUtil; + import java.util.Optional; import java.util.Set; -import org.jabref.model.strings.StringUtil; - public interface Field { /** diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 7136b551053..371e509ab5b 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -1,22 +1,13 @@ package org.jabref.model.entry.field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.function.Predicate; -import java.util.stream.Collectors; - import org.jabref.model.entry.types.EntryType; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; +import java.util.*; +import java.util.function.Predicate; +import java.util.stream.Collectors; + public class FieldFactory { /** diff --git a/src/main/java/org/jabref/model/entry/field/OrFields.java b/src/main/java/org/jabref/model/entry/field/OrFields.java index eedd752f630..2efef51ea0d 100644 --- a/src/main/java/org/jabref/model/entry/field/OrFields.java +++ b/src/main/java/org/jabref/model/entry/field/OrFields.java @@ -1,11 +1,6 @@ package org.jabref.model.entry.field; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Objects; -import java.util.Set; -import java.util.StringJoiner; +import java.util.*; public class OrFields implements Comparable { diff --git a/src/main/java/org/jabref/model/entry/field/SpecialField.java b/src/main/java/org/jabref/model/entry/field/SpecialField.java index 293804d35cf..f78ba11c7d1 100644 --- a/src/main/java/org/jabref/model/entry/field/SpecialField.java +++ b/src/main/java/org/jabref/model/entry/field/SpecialField.java @@ -1,15 +1,9 @@ package org.jabref.model.entry.field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import org.jabref.model.entry.KeywordList; +import java.util.*; + public enum SpecialField implements Field { PRINTED("printed", SpecialFieldValue.PRINTED), diff --git a/src/main/java/org/jabref/model/entry/field/SpecialFieldValue.java b/src/main/java/org/jabref/model/entry/field/SpecialFieldValue.java index 7364167f7ca..5abdd2ae7df 100644 --- a/src/main/java/org/jabref/model/entry/field/SpecialFieldValue.java +++ b/src/main/java/org/jabref/model/entry/field/SpecialFieldValue.java @@ -1,9 +1,9 @@ package org.jabref.model.entry.field; -import java.util.Optional; - import org.jabref.model.entry.Keyword; +import java.util.Optional; + public enum SpecialFieldValue { PRINTED("printed"), diff --git a/src/main/java/org/jabref/model/entry/field/StandardField.java b/src/main/java/org/jabref/model/entry/field/StandardField.java index 152d31148a8..01e7d0ae12c 100644 --- a/src/main/java/org/jabref/model/entry/field/StandardField.java +++ b/src/main/java/org/jabref/model/entry/field/StandardField.java @@ -1,12 +1,12 @@ package org.jabref.model.entry.field; +import org.jabref.gui.fieldeditors.FieldNameLabel; + import java.util.Arrays; import java.util.EnumSet; import java.util.Optional; import java.util.Set; -import org.jabref.gui.fieldeditors.FieldNameLabel; - /** * Standard BibTeX and BibLaTeX fields, as well as "normal" JabRef specific fields. * diff --git a/src/main/java/org/jabref/model/entry/field/UnknownField.java b/src/main/java/org/jabref/model/entry/field/UnknownField.java index 208186bfd5f..ca125f18a06 100644 --- a/src/main/java/org/jabref/model/entry/field/UnknownField.java +++ b/src/main/java/org/jabref/model/entry/field/UnknownField.java @@ -1,12 +1,12 @@ package org.jabref.model.entry.field; +import org.jabref.model.strings.StringUtil; + import java.util.EnumSet; import java.util.Locale; import java.util.Objects; import java.util.Set; -import org.jabref.model.strings.StringUtil; - public class UnknownField implements Field { private String name; private final Set properties; diff --git a/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java b/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java index 41f0a764c0c..89d9f577c8f 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java +++ b/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java @@ -1,5 +1,9 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.strings.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.URI; import java.net.URISyntaxException; import java.util.Objects; @@ -7,11 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.strings.StringUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Identifier for the arXiv. See https://arxiv.org/help/arxiv_identifier */ 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 6ab79281ea4..4a3f32af513 100644 --- a/src/main/java/org/jabref/model/entry/identifier/DOI.java +++ b/src/main/java/org/jabref/model/entry/identifier/DOI.java @@ -1,5 +1,12 @@ package org.jabref.model.entry.identifier; +import org.jabref.architecture.AllowedToUseLogic; +import org.jabref.logic.layout.format.LatexToUnicodeFormatter; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; @@ -10,14 +17,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.architecture.AllowedToUseLogic; -import org.jabref.logic.layout.format.LatexToUnicodeFormatter; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * Class for working with Digital object identifiers (DOIs) and Short DOIs */ @@ -56,17 +55,17 @@ public class DOI implements Identifier { "" + "^\\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 + // 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 + // 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" - // ... + // ... + "|(?:\\s?/?)" // or "/10/12ab" or " /10/12ab" or "10/12ab" or " 10/12ab" + ")" // end "any one of these" + "(" // begin group \1 @@ -80,7 +79,7 @@ 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: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/entry/identifier/ISBN.java b/src/main/java/org/jabref/model/entry/identifier/ISBN.java index d536ef41cde..6b32d7adb90 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ISBN.java +++ b/src/main/java/org/jabref/model/entry/identifier/ISBN.java @@ -1,5 +1,8 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; + import java.net.URI; import java.net.URISyntaxException; import java.util.Locale; @@ -8,9 +11,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - public class ISBN implements Identifier { private static final Pattern ISBN_PATTERN = Pattern.compile("^(\\d{9}[\\dxX]|\\d{13})$"); 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 76dd55ce330..716f39947c6 100644 --- a/src/main/java/org/jabref/model/entry/identifier/ISSN.java +++ b/src/main/java/org/jabref/model/entry/identifier/ISSN.java @@ -1,14 +1,14 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; + import java.net.URI; import java.util.Objects; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - public class ISSN implements Identifier { private static final Pattern ISSN_PATTERN = Pattern.compile("^\\d{4}-\\d{3}[\\dxX]$"); diff --git a/src/main/java/org/jabref/model/entry/identifier/IacrEprint.java b/src/main/java/org/jabref/model/entry/identifier/IacrEprint.java index 77a2d54f5d6..0fea611b461 100644 --- a/src/main/java/org/jabref/model/entry/identifier/IacrEprint.java +++ b/src/main/java/org/jabref/model/entry/identifier/IacrEprint.java @@ -1,5 +1,10 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.URI; import java.net.URISyntaxException; import java.util.Objects; @@ -7,12 +12,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class IacrEprint implements Identifier { public static final URI RESOLVER = URI.create("https://ia.cr"); private static final Logger LOGGER = LoggerFactory.getLogger(IacrEprint.class); diff --git a/src/main/java/org/jabref/model/entry/identifier/Identifier.java b/src/main/java/org/jabref/model/entry/identifier/Identifier.java index 3a921bfdf6c..710b98451a1 100644 --- a/src/main/java/org/jabref/model/entry/identifier/Identifier.java +++ b/src/main/java/org/jabref/model/entry/identifier/Identifier.java @@ -1,10 +1,10 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.entry.field.Field; + import java.net.URI; import java.util.Optional; -import org.jabref.model.entry.field.Field; - public interface Identifier { /** diff --git a/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java b/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java index 7ea026993e5..9bc8e442d8c 100644 --- a/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java +++ b/src/main/java/org/jabref/model/entry/identifier/MathSciNetId.java @@ -1,14 +1,14 @@ package org.jabref.model.entry.identifier; +import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.strings.StringUtil; + import java.net.URI; import java.net.URISyntaxException; import java.util.Objects; import java.util.Optional; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.strings.StringUtil; - /** * Article identifier for MathSciNet (also sometimes called "MRNumber") */ diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexAPAEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BiblatexAPAEntryTypeDefinitions.java index 27bd81e27fb..576eee68ed9 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexAPAEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexAPAEntryTypeDefinitions.java @@ -1,13 +1,13 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.BiblatexApaField; import org.jabref.model.entry.field.StandardField; +import java.util.Arrays; +import java.util.List; + public class BiblatexAPAEntryTypeDefinitions { private static final BibEntryType JURISDICTION = new BibEntryTypeBuilder() 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 ceb516ecf3d..266895839ba 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java @@ -1,13 +1,13 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; +import java.util.Arrays; +import java.util.List; + /** * This class defines entry types for biblatex support. * diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexSoftwareEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BiblatexSoftwareEntryTypeDefinitions.java index 4262f1fe8be..7fa7be6dfef 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexSoftwareEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexSoftwareEntryTypeDefinitions.java @@ -1,14 +1,14 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.BiblatexSoftwareField; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; +import java.util.Arrays; +import java.util.List; + public class BiblatexSoftwareEntryTypeDefinitions { private static final BibEntryType SOFTWARE = new BibEntryTypeBuilder() .withType(StandardEntryType.Software) diff --git a/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java index 696edfac30d..a04fd99c060 100644 --- a/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java @@ -1,13 +1,13 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; +import java.util.Arrays; +import java.util.List; + /** * This class represents all supported BibTeX entry types. * The BibLaTeX entry types are defined at {@link BiblatexEntryTypeDefinitions}. 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 8cb94a4564c..3c92203b8ec 100644 --- a/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java +++ b/src/main/java/org/jabref/model/entry/types/EntryTypeFactory.java @@ -1,13 +1,9 @@ package org.jabref.model.entry.types; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.Objects; - import org.jabref.model.entry.BibEntryType; +import java.util.*; + public class EntryTypeFactory { private EntryTypeFactory() {} 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 2f75a8616a9..ba8010e0fa8 100644 --- a/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/IEEETranEntryTypeDefinitions.java @@ -1,14 +1,14 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.IEEEField; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; +import java.util.Arrays; +import java.util.List; + /** * This class represents all supported IEEETran entry types. *

    diff --git a/src/main/java/org/jabref/model/entry/types/SystematicLiteratureReviewStudyEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/SystematicLiteratureReviewStudyEntryTypeDefinitions.java index 1d628a02deb..bac3e9301ce 100644 --- a/src/main/java/org/jabref/model/entry/types/SystematicLiteratureReviewStudyEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/SystematicLiteratureReviewStudyEntryTypeDefinitions.java @@ -1,13 +1,13 @@ package org.jabref.model.entry.types; -import java.util.Arrays; -import java.util.List; - import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; +import java.util.Arrays; +import java.util.List; + /** * This class represents all supported entry types used in a study definition file */ diff --git a/src/main/java/org/jabref/model/entry/types/UnknownEntryType.java b/src/main/java/org/jabref/model/entry/types/UnknownEntryType.java index 354a54bec58..ff2863e790c 100644 --- a/src/main/java/org/jabref/model/entry/types/UnknownEntryType.java +++ b/src/main/java/org/jabref/model/entry/types/UnknownEntryType.java @@ -1,10 +1,10 @@ package org.jabref.model.entry.types; +import org.jabref.model.strings.StringUtil; + import java.util.Locale; import java.util.Objects; -import org.jabref.model.strings.StringUtil; - public class UnknownEntryType implements EntryType { private final String name; diff --git a/src/main/java/org/jabref/model/groups/AbstractGroup.java b/src/main/java/org/jabref/model/groups/AbstractGroup.java index aabd35787be..5e41f919b51 100644 --- a/src/main/java/org/jabref/model/groups/AbstractGroup.java +++ b/src/main/java/org/jabref/model/groups/AbstractGroup.java @@ -1,17 +1,16 @@ package org.jabref.model.groups; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.scene.paint.Color; - import org.jabref.model.entry.BibEntry; import org.jabref.model.search.SearchMatcher; import org.jabref.model.strings.StringUtil; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + /** * Base class for all groups. */ diff --git a/src/main/java/org/jabref/model/groups/AllEntriesGroup.java b/src/main/java/org/jabref/model/groups/AllEntriesGroup.java index 320b3306ce8..4c7743e051b 100644 --- a/src/main/java/org/jabref/model/groups/AllEntriesGroup.java +++ b/src/main/java/org/jabref/model/groups/AllEntriesGroup.java @@ -1,9 +1,9 @@ package org.jabref.model.groups; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; +import java.util.Objects; + /** * This group contains all entries. Always. At any time! */ diff --git a/src/main/java/org/jabref/model/groups/AutomaticGroup.java b/src/main/java/org/jabref/model/groups/AutomaticGroup.java index 261a5691b48..cc970dfc289 100644 --- a/src/main/java/org/jabref/model/groups/AutomaticGroup.java +++ b/src/main/java/org/jabref/model/groups/AutomaticGroup.java @@ -1,12 +1,11 @@ package org.jabref.model.groups; -import java.util.Set; - import javafx.collections.ObservableList; - import org.jabref.model.entry.BibEntry; import org.jabref.model.util.TreeCollector; +import java.util.Set; + public abstract class AutomaticGroup extends AbstractGroup { public AutomaticGroup(String name, GroupHierarchyType context) { super(name, context); diff --git a/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java b/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java index 64928a2d448..6098853bedd 100644 --- a/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java +++ b/src/main/java/org/jabref/model/groups/AutomaticKeywordGroup.java @@ -1,15 +1,15 @@ package org.jabref.model.groups; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Keyword; import org.jabref.model.entry.KeywordList; import org.jabref.model.entry.field.Field; import org.jabref.model.strings.StringUtil; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + public class AutomaticKeywordGroup extends AutomaticGroup { private final Character keywordDelimiter; diff --git a/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java b/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java index 0a68e66cbb4..43de38150f1 100644 --- a/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java +++ b/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java @@ -1,12 +1,12 @@ package org.jabref.model.groups; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; + import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; - public class AutomaticPersonsGroup extends AutomaticGroup { private final Field field; diff --git a/src/main/java/org/jabref/model/groups/ExplicitGroup.java b/src/main/java/org/jabref/model/groups/ExplicitGroup.java index 53a01bc519d..8c430e661f4 100644 --- a/src/main/java/org/jabref/model/groups/ExplicitGroup.java +++ b/src/main/java/org/jabref/model/groups/ExplicitGroup.java @@ -1,12 +1,12 @@ package org.jabref.model.groups; +import org.jabref.model.entry.field.StandardField; + import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; -import org.jabref.model.entry.field.StandardField; - /** * This group contains entries, which were manually assigned to it. * Assignments are stored in the {@link StandardField#GROUPS} field. diff --git a/src/main/java/org/jabref/model/groups/GroupEntryChanger.java b/src/main/java/org/jabref/model/groups/GroupEntryChanger.java index 8bd75be26db..7076c195d86 100644 --- a/src/main/java/org/jabref/model/groups/GroupEntryChanger.java +++ b/src/main/java/org/jabref/model/groups/GroupEntryChanger.java @@ -1,12 +1,12 @@ package org.jabref.model.groups; +import org.jabref.model.FieldChange; +import org.jabref.model.entry.BibEntry; + import java.util.Collection; import java.util.Collections; import java.util.List; -import org.jabref.model.FieldChange; -import org.jabref.model.entry.BibEntry; - /** * Some groups can change entries so that they match (or no longer match) the group. * This functionality is encoded in this interface. diff --git a/src/main/java/org/jabref/model/groups/GroupTreeNode.java b/src/main/java/org/jabref/model/groups/GroupTreeNode.java index 8196766885d..2cc2caa0977 100644 --- a/src/main/java/org/jabref/model/groups/GroupTreeNode.java +++ b/src/main/java/org/jabref/model/groups/GroupTreeNode.java @@ -1,13 +1,5 @@ package org.jabref.model.groups; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.model.FieldChange; import org.jabref.model.TreeNode; import org.jabref.model.database.BibDatabase; @@ -16,6 +8,9 @@ import org.jabref.model.search.matchers.MatcherSet; import org.jabref.model.search.matchers.MatcherSets; +import java.util.*; +import java.util.stream.Collectors; + /** * A node in the groups tree that holds exactly one AbstractGroup. */ diff --git a/src/main/java/org/jabref/model/groups/KeywordGroup.java b/src/main/java/org/jabref/model/groups/KeywordGroup.java index 0263385a60a..3196df41df8 100644 --- a/src/main/java/org/jabref/model/groups/KeywordGroup.java +++ b/src/main/java/org/jabref/model/groups/KeywordGroup.java @@ -1,9 +1,9 @@ package org.jabref.model.groups; -import java.util.Objects; - import org.jabref.model.entry.field.Field; +import java.util.Objects; + /** * Matches entries based on a search phrase relative to the content in a specified field. */ diff --git a/src/main/java/org/jabref/model/groups/LastNameGroup.java b/src/main/java/org/jabref/model/groups/LastNameGroup.java index 916ac900c77..af404f646ee 100644 --- a/src/main/java/org/jabref/model/groups/LastNameGroup.java +++ b/src/main/java/org/jabref/model/groups/LastNameGroup.java @@ -1,16 +1,16 @@ package org.jabref.model.groups; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.strings.LatexToUnicodeAdapter; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + /** * Matches based on a latex free last name in a specified field. The field is parsed as an author list and the last names are resolved of latex. */ diff --git a/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java b/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java index e77beb3e3f8..d37de9b8f0c 100644 --- a/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java +++ b/src/main/java/org/jabref/model/groups/RegexKeywordGroup.java @@ -1,12 +1,12 @@ package org.jabref.model.groups; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.Field; + import java.util.Objects; import java.util.Optional; import java.util.regex.Pattern; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; - /** * Matches entries if the content of a given field is matched by a regular expression. */ diff --git a/src/main/java/org/jabref/model/groups/SearchGroup.java b/src/main/java/org/jabref/model/groups/SearchGroup.java index 74646de6305..a01124874f9 100644 --- a/src/main/java/org/jabref/model/groups/SearchGroup.java +++ b/src/main/java/org/jabref/model/groups/SearchGroup.java @@ -1,15 +1,14 @@ package org.jabref.model.groups; -import java.util.EnumSet; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; import org.jabref.model.search.GroupSearchQuery; import org.jabref.model.search.rules.SearchRules.SearchFlags; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.EnumSet; +import java.util.Objects; + /** * This group matches entries by a complex search pattern, which might include conditions about the values of * multiple fields. diff --git a/src/main/java/org/jabref/model/groups/TexGroup.java b/src/main/java/org/jabref/model/groups/TexGroup.java index 70bf63434db..c35b55d0d48 100644 --- a/src/main/java/org/jabref/model/groups/TexGroup.java +++ b/src/main/java/org/jabref/model/groups/TexGroup.java @@ -1,13 +1,5 @@ package org.jabref.model.groups; -import java.io.IOException; -import java.net.InetAddress; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Set; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.logic.auxparser.AuxParser; import org.jabref.logic.auxparser.AuxParserResult; @@ -17,10 +9,17 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateListener; import org.jabref.model.util.FileUpdateMonitor; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.InetAddress; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Set; + @AllowedToUseLogic("because it needs access to aux parser") public class TexGroup extends AbstractGroup implements FileUpdateListener { diff --git a/src/main/java/org/jabref/model/groups/WordKeywordGroup.java b/src/main/java/org/jabref/model/groups/WordKeywordGroup.java index e7af8742888..81b30d3c45e 100644 --- a/src/main/java/org/jabref/model/groups/WordKeywordGroup.java +++ b/src/main/java/org/jabref/model/groups/WordKeywordGroup.java @@ -1,13 +1,5 @@ package org.jabref.model.groups; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.KeywordList; @@ -18,6 +10,9 @@ import org.jabref.model.strings.StringUtil; import org.jabref.model.util.ListUtil; +import java.util.*; +import java.util.stream.Collectors; + /** * Matches entries if a given field contains a specified word. */ diff --git a/src/main/java/org/jabref/model/metadata/ContentSelector.java b/src/main/java/org/jabref/model/metadata/ContentSelector.java index 1dc0317dab1..0a9039eb13e 100644 --- a/src/main/java/org/jabref/model/metadata/ContentSelector.java +++ b/src/main/java/org/jabref/model/metadata/ContentSelector.java @@ -1,12 +1,12 @@ package org.jabref.model.metadata; +import org.jabref.model.entry.field.Field; + import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; -import org.jabref.model.entry.field.Field; - public class ContentSelector { private final Field field; diff --git a/src/main/java/org/jabref/model/metadata/ContentSelectors.java b/src/main/java/org/jabref/model/metadata/ContentSelectors.java index bb42beaab45..0939beb3b57 100644 --- a/src/main/java/org/jabref/model/metadata/ContentSelectors.java +++ b/src/main/java/org/jabref/model/metadata/ContentSelectors.java @@ -1,13 +1,9 @@ package org.jabref.model.metadata; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - import org.jabref.model.entry.field.Field; +import java.util.*; + public class ContentSelectors { private final List contentSelectors; diff --git a/src/main/java/org/jabref/model/metadata/MetaData.java b/src/main/java/org/jabref/model/metadata/MetaData.java index ea4a2af5564..fb04a4dcd76 100644 --- a/src/main/java/org/jabref/model/metadata/MetaData.java +++ b/src/main/java/org/jabref/model/metadata/MetaData.java @@ -1,17 +1,10 @@ package org.jabref.model.metadata; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - +import com.google.common.eventbus.EventBus; +import com.tobiasdiez.easybind.optional.OptionalBinding; +import com.tobiasdiez.easybind.optional.OptionalWrapper; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern; import org.jabref.logic.citationkeypattern.DatabaseCitationKeyPattern; @@ -24,13 +17,13 @@ import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.groups.event.GroupUpdatedEvent; import org.jabref.model.metadata.event.MetaDataChangedEvent; - -import com.google.common.eventbus.EventBus; -import com.tobiasdiez.easybind.optional.OptionalBinding; -import com.tobiasdiez.easybind.optional.OptionalWrapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.util.*; + @AllowedToUseLogic("because it needs access to citation pattern and cleanups") public class MetaData { diff --git a/src/main/java/org/jabref/model/metadata/SaveOrder.java b/src/main/java/org/jabref/model/metadata/SaveOrder.java index 51b15d36c34..534857b4605 100644 --- a/src/main/java/org/jabref/model/metadata/SaveOrder.java +++ b/src/main/java/org/jabref/model/metadata/SaveOrder.java @@ -1,15 +1,14 @@ package org.jabref.model.metadata; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + /** * Stores the save order config for a library *

    diff --git a/src/main/java/org/jabref/model/metadata/SelfContainedSaveOrder.java b/src/main/java/org/jabref/model/metadata/SelfContainedSaveOrder.java index 30e925b9ed7..70ab8388431 100644 --- a/src/main/java/org/jabref/model/metadata/SelfContainedSaveOrder.java +++ b/src/main/java/org/jabref/model/metadata/SelfContainedSaveOrder.java @@ -1,10 +1,10 @@ package org.jabref.model.metadata; -import java.util.List; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; + /** * With this class, the user of an instance can directly sort things. Without looking up anything in the preferences or in the UI. * diff --git a/src/main/java/org/jabref/model/openoffice/backend/NamedRange.java b/src/main/java/org/jabref/model/openoffice/backend/NamedRange.java index f72601e3523..bfbceed2712 100644 --- a/src/main/java/org/jabref/model/openoffice/backend/NamedRange.java +++ b/src/main/java/org/jabref/model/openoffice/backend/NamedRange.java @@ -1,14 +1,13 @@ package org.jabref.model.openoffice.backend; -import java.util.Optional; - -import org.jabref.model.openoffice.uno.CreationException; -import org.jabref.model.openoffice.uno.NoDocumentException; - import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextCursor; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; +import org.jabref.model.openoffice.uno.CreationException; +import org.jabref.model.openoffice.uno.NoDocumentException; + +import java.util.Optional; /** * NamedRange (with NamedRangeManager) attempts to provide a common interface for working with reference mark based and bookmark based text ranges to be used as locations to fill with citation markers. LibreOffice supports name-based lookup and listing names for both (hence the name). diff --git a/src/main/java/org/jabref/model/openoffice/backend/NamedRangeManager.java b/src/main/java/org/jabref/model/openoffice/backend/NamedRangeManager.java index a034005a67e..049c444d902 100644 --- a/src/main/java/org/jabref/model/openoffice/backend/NamedRangeManager.java +++ b/src/main/java/org/jabref/model/openoffice/backend/NamedRangeManager.java @@ -1,14 +1,13 @@ package org.jabref.model.openoffice.backend; -import java.util.List; -import java.util.Optional; - -import org.jabref.model.openoffice.uno.CreationException; -import org.jabref.model.openoffice.uno.NoDocumentException; - import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextCursor; import com.sun.star.text.XTextDocument; +import org.jabref.model.openoffice.uno.CreationException; +import org.jabref.model.openoffice.uno.NoDocumentException; + +import java.util.List; +import java.util.Optional; public interface NamedRangeManager { diff --git a/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java b/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java index 25f1a4fc6b5..00eb635f724 100644 --- a/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java +++ b/src/main/java/org/jabref/model/openoffice/ootext/OOTextIntoOO.java @@ -1,50 +1,28 @@ package org.jabref.model.openoffice.ootext; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Deque; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jabref.architecture.AllowedToUseAwt; -import org.jabref.model.openoffice.uno.CreationException; -import org.jabref.model.openoffice.uno.UnoCast; -import org.jabref.model.openoffice.uno.UnoCrossRef; -import org.jabref.model.openoffice.util.OOPair; -import org.jabref.model.strings.StringUtil; - import com.sun.star.awt.FontSlant; import com.sun.star.awt.FontStrikeout; import com.sun.star.awt.FontUnderline; import com.sun.star.awt.FontWeight; -import com.sun.star.beans.Property; -import com.sun.star.beans.PropertyAttribute; -import com.sun.star.beans.PropertyState; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.XMultiPropertySet; -import com.sun.star.beans.XMultiPropertyStates; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.XPropertySetInfo; -import com.sun.star.beans.XPropertyState; +import com.sun.star.beans.*; import com.sun.star.lang.Locale; import com.sun.star.lang.WrappedTargetException; import com.sun.star.style.CaseMap; -import com.sun.star.text.ControlCharacter; -import com.sun.star.text.XParagraphCursor; -import com.sun.star.text.XText; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; +import com.sun.star.text.*; +import org.jabref.architecture.AllowedToUseAwt; +import org.jabref.model.openoffice.uno.CreationException; +import org.jabref.model.openoffice.uno.UnoCast; +import org.jabref.model.openoffice.uno.UnoCrossRef; +import org.jabref.model.openoffice.util.OOPair; +import org.jabref.model.strings.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Interpret OOText into an OpenOffice or LibreOffice writer document. */ diff --git a/src/main/java/org/jabref/model/openoffice/rangesort/FunctionalTextViewCursor.java b/src/main/java/org/jabref/model/openoffice/rangesort/FunctionalTextViewCursor.java index 4a25d184544..a0aaf374e4c 100644 --- a/src/main/java/org/jabref/model/openoffice/rangesort/FunctionalTextViewCursor.java +++ b/src/main/java/org/jabref/model/openoffice/rangesort/FunctionalTextViewCursor.java @@ -1,16 +1,15 @@ package org.jabref.model.openoffice.rangesort; -import java.util.Arrays; -import java.util.Objects; - -import org.jabref.model.openoffice.uno.UnoCursor; -import org.jabref.model.openoffice.uno.UnoSelection; -import org.jabref.model.openoffice.util.OOResult; - import com.sun.star.lang.XServiceInfo; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; import com.sun.star.text.XTextViewCursor; +import org.jabref.model.openoffice.uno.UnoCursor; +import org.jabref.model.openoffice.uno.UnoSelection; +import org.jabref.model.openoffice.util.OOResult; + +import java.util.Arrays; +import java.util.Objects; /* * A problem with XTextViewCursor: if it is not in text, then we get a crippled version that does diff --git a/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapBetween.java b/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapBetween.java index f2ceb96e0fe..7f82708afb9 100644 --- a/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapBetween.java +++ b/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapBetween.java @@ -1,16 +1,15 @@ package org.jabref.model.openoffice.rangesort; -import java.util.ArrayList; -import java.util.List; - -import org.jabref.model.openoffice.uno.UnoCast; -import org.jabref.model.openoffice.uno.UnoTextRange; -import org.jabref.model.openoffice.util.OOTuple3; - import com.sun.star.text.XText; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; import com.sun.star.text.XTextRangeCompare; +import org.jabref.model.openoffice.uno.UnoCast; +import org.jabref.model.openoffice.uno.UnoTextRange; +import org.jabref.model.openoffice.util.OOTuple3; + +import java.util.ArrayList; +import java.util.List; public class RangeOverlapBetween { diff --git a/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapWithin.java b/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapWithin.java index 1a1d4046e95..c65291dc9e9 100644 --- a/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapWithin.java +++ b/src/main/java/org/jabref/model/openoffice/rangesort/RangeOverlapWithin.java @@ -1,14 +1,13 @@ package org.jabref.model.openoffice.rangesort; -import java.util.ArrayList; -import java.util.List; - -import org.jabref.model.openoffice.uno.UnoCast; -import org.jabref.model.openoffice.uno.UnoTextRange; - import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; import com.sun.star.text.XTextRangeCompare; +import org.jabref.model.openoffice.uno.UnoCast; +import org.jabref.model.openoffice.uno.UnoTextRange; + +import java.util.ArrayList; +import java.util.List; public class RangeOverlapWithin { diff --git a/src/main/java/org/jabref/model/openoffice/rangesort/RangeSort.java b/src/main/java/org/jabref/model/openoffice/rangesort/RangeSort.java index fd0f658b1e8..3e441dcc0e2 100644 --- a/src/main/java/org/jabref/model/openoffice/rangesort/RangeSort.java +++ b/src/main/java/org/jabref/model/openoffice/rangesort/RangeSort.java @@ -1,16 +1,11 @@ package org.jabref.model.openoffice.rangesort; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import com.sun.star.text.XText; +import com.sun.star.text.XTextRangeCompare; import org.jabref.model.openoffice.uno.UnoCast; import org.jabref.model.openoffice.uno.UnoTextRange; -import com.sun.star.text.XText; -import com.sun.star.text.XTextRangeCompare; +import java.util.*; /** * RangeSort provides sorting based on XTextRangeCompare, which only provides comparison between XTextRange values within the same XText. diff --git a/src/main/java/org/jabref/model/openoffice/rangesort/RangeSortVisual.java b/src/main/java/org/jabref/model/openoffice/rangesort/RangeSortVisual.java index f28e8d3d94f..86dd4e873f4 100644 --- a/src/main/java/org/jabref/model/openoffice/rangesort/RangeSortVisual.java +++ b/src/main/java/org/jabref/model/openoffice/rangesort/RangeSortVisual.java @@ -1,17 +1,16 @@ package org.jabref.model.openoffice.rangesort; -import java.util.ArrayList; -import java.util.List; - -import org.jabref.model.openoffice.uno.UnoScreenRefresh; - import com.sun.star.awt.Point; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; import com.sun.star.text.XTextViewCursor; +import org.jabref.model.openoffice.uno.UnoScreenRefresh; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; + /** * Sort XTextRange values visually (top-down,left-to-right). *

    diff --git a/src/main/java/org/jabref/model/openoffice/style/Citation.java b/src/main/java/org/jabref/model/openoffice/style/Citation.java index 8e7310e62db..9329ca8f055 100644 --- a/src/main/java/org/jabref/model/openoffice/style/Citation.java +++ b/src/main/java/org/jabref/model/openoffice/style/Citation.java @@ -1,13 +1,13 @@ package org.jabref.model.openoffice.style; -import java.util.List; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.openoffice.ootext.OOText; import org.jabref.model.openoffice.util.OOPair; +import java.util.List; +import java.util.Optional; + public class Citation implements ComparableCitation, CitationMarkerEntry, CitationMarkerNumericEntry { /** diff --git a/src/main/java/org/jabref/model/openoffice/style/CitationGroup.java b/src/main/java/org/jabref/model/openoffice/style/CitationGroup.java index 8c8ab628190..4f479aefe30 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitationGroup.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitationGroup.java @@ -1,14 +1,14 @@ package org.jabref.model.openoffice.style; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.openoffice.ootext.OOText; +import org.jabref.model.openoffice.util.OOListUtil; + import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Optional; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.openoffice.ootext.OOText; -import org.jabref.model.openoffice.util.OOListUtil; - /** * A CitationGroup describes a group of citations. */ diff --git a/src/main/java/org/jabref/model/openoffice/style/CitationGroups.java b/src/main/java/org/jabref/model/openoffice/style/CitationGroups.java index 4f296aceb6c..40171911197 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitationGroups.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitationGroups.java @@ -1,22 +1,15 @@ package org.jabref.model.openoffice.style; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Consumer; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.openoffice.util.OOListUtil; import org.jabref.model.openoffice.util.OOPair; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.function.Consumer; + /** * CitationGroups : the set of citation groups in the document. *

    diff --git a/src/main/java/org/jabref/model/openoffice/style/CitationLookupResult.java b/src/main/java/org/jabref/model/openoffice/style/CitationLookupResult.java index c82177a7e69..eab3e3d9784 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitationLookupResult.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitationLookupResult.java @@ -1,10 +1,10 @@ package org.jabref.model.openoffice.style; -import java.util.Objects; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; +import java.util.Objects; + public class CitationLookupResult { public final BibEntry entry; diff --git a/src/main/java/org/jabref/model/openoffice/style/CitationMarkerEntry.java b/src/main/java/org/jabref/model/openoffice/style/CitationMarkerEntry.java index 18bbe5588b3..bf4f81221c9 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitationMarkerEntry.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitationMarkerEntry.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; +import java.util.Optional; + /** * This is what we need for createCitationMarker to produce author-year citation markers. */ diff --git a/src/main/java/org/jabref/model/openoffice/style/CitationMarkerNumericEntry.java b/src/main/java/org/jabref/model/openoffice/style/CitationMarkerNumericEntry.java index 9c0c6081489..79667ece57e 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitationMarkerNumericEntry.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitationMarkerNumericEntry.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; +import java.util.Optional; + /** * This is what we need for numeric citation markers. */ diff --git a/src/main/java/org/jabref/model/openoffice/style/CitedKey.java b/src/main/java/org/jabref/model/openoffice/style/CitedKey.java index 66a8b185232..b10ba20da49 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitedKey.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitedKey.java @@ -1,13 +1,13 @@ package org.jabref.model.openoffice.style; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.openoffice.ootext.OOText; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + /** * Cited keys are collected from the citations in citation groups. *

    diff --git a/src/main/java/org/jabref/model/openoffice/style/CitedKeys.java b/src/main/java/org/jabref/model/openoffice/style/CitedKeys.java index a5afedede80..48439406fa9 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CitedKeys.java +++ b/src/main/java/org/jabref/model/openoffice/style/CitedKeys.java @@ -1,14 +1,10 @@ package org.jabref.model.openoffice.style; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; +import java.util.*; + public class CitedKeys { /** diff --git a/src/main/java/org/jabref/model/openoffice/style/ComparableCitation.java b/src/main/java/org/jabref/model/openoffice/style/ComparableCitation.java index 42a7e5869ba..5496732eaa3 100644 --- a/src/main/java/org/jabref/model/openoffice/style/ComparableCitation.java +++ b/src/main/java/org/jabref/model/openoffice/style/ComparableCitation.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; +import java.util.Optional; + /** * When sorting citations (in a group), we also consider pageInfo. Otherwise we sort citations as cited keys. */ diff --git a/src/main/java/org/jabref/model/openoffice/style/ComparableCitedKey.java b/src/main/java/org/jabref/model/openoffice/style/ComparableCitedKey.java index 039126313f4..1335cc2e2f5 100644 --- a/src/main/java/org/jabref/model/openoffice/style/ComparableCitedKey.java +++ b/src/main/java/org/jabref/model/openoffice/style/ComparableCitedKey.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; +import java.util.Optional; + /** * This is what we need to sort bibliography entries. */ diff --git a/src/main/java/org/jabref/model/openoffice/style/CompareCitation.java b/src/main/java/org/jabref/model/openoffice/style/CompareCitation.java index b9e7de627db..6e80e7c0bd1 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CompareCitation.java +++ b/src/main/java/org/jabref/model/openoffice/style/CompareCitation.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Comparator; - import org.jabref.model.entry.BibEntry; +import java.util.Comparator; + /* * Given a Comparator provide a Comparator that can handle unresolved * citation keys and takes pageInfo into account. diff --git a/src/main/java/org/jabref/model/openoffice/style/CompareCitedKey.java b/src/main/java/org/jabref/model/openoffice/style/CompareCitedKey.java index e8a99e6980b..f66a7068c78 100644 --- a/src/main/java/org/jabref/model/openoffice/style/CompareCitedKey.java +++ b/src/main/java/org/jabref/model/openoffice/style/CompareCitedKey.java @@ -1,10 +1,10 @@ package org.jabref.model.openoffice.style; +import org.jabref.model.entry.BibEntry; + import java.util.Comparator; import java.util.Optional; -import org.jabref.model.entry.BibEntry; - /* * Given a Comparator provide a Comparator that also handles * unresolved citation keys. diff --git a/src/main/java/org/jabref/model/openoffice/style/OODataModel.java b/src/main/java/org/jabref/model/openoffice/style/OODataModel.java index 470edc1694d..bcdd97cc72b 100644 --- a/src/main/java/org/jabref/model/openoffice/style/OODataModel.java +++ b/src/main/java/org/jabref/model/openoffice/style/OODataModel.java @@ -1,11 +1,11 @@ package org.jabref.model.openoffice.style; +import org.jabref.model.openoffice.ootext.OOText; + import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.jabref.model.openoffice.ootext.OOText; - /** * What is the data stored? */ diff --git a/src/main/java/org/jabref/model/openoffice/style/PageInfo.java b/src/main/java/org/jabref/model/openoffice/style/PageInfo.java index b90222496d7..b26443bd213 100644 --- a/src/main/java/org/jabref/model/openoffice/style/PageInfo.java +++ b/src/main/java/org/jabref/model/openoffice/style/PageInfo.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.style; -import java.util.Optional; - import org.jabref.model.openoffice.ootext.OOText; +import java.util.Optional; + public class PageInfo { private PageInfo() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoBookmark.java b/src/main/java/org/jabref/model/openoffice/uno/UnoBookmark.java index fe78c444960..f5e63cfda09 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoBookmark.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoBookmark.java @@ -1,7 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNamed; @@ -12,6 +10,8 @@ import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; +import java.util.Optional; + public class UnoBookmark { private UnoBookmark() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoCast.java b/src/main/java/org/jabref/model/openoffice/uno/UnoCast.java index b01a4899851..9b9ed25b9b0 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoCast.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoCast.java @@ -1,9 +1,9 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.uno.UnoRuntime; +import java.util.Optional; + public class UnoCast { private UnoCast() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoCrossRef.java b/src/main/java/org/jabref/model/openoffice/uno/UnoCrossRef.java index 4fba0d1764f..b1160beecc7 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoCrossRef.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoCrossRef.java @@ -5,11 +5,7 @@ import com.sun.star.beans.XPropertySet; import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.ReferenceFieldPart; -import com.sun.star.text.ReferenceFieldSource; -import com.sun.star.text.XTextContent; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; +import com.sun.star.text.*; import com.sun.star.util.XRefreshable; public class UnoCrossRef { diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoCursor.java b/src/main/java/org/jabref/model/openoffice/uno/UnoCursor.java index de207fb2ef9..e87636e8f75 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoCursor.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoCursor.java @@ -1,13 +1,8 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; +import com.sun.star.text.*; -import com.sun.star.text.XTextContent; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; -import com.sun.star.text.XTextViewCursor; -import com.sun.star.text.XTextViewCursorSupplier; +import java.util.Optional; public class UnoCursor { diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoNameAccess.java b/src/main/java/org/jabref/model/openoffice/uno/UnoNameAccess.java index cadb4fcd810..cef377094df 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoNameAccess.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoNameAccess.java @@ -1,12 +1,12 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextContent; +import java.util.Optional; + public class UnoNameAccess { private UnoNameAccess() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoProperties.java b/src/main/java/org/jabref/model/openoffice/uno/UnoProperties.java index 7f3cd8d7e59..21ae8a5b7e5 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoProperties.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoProperties.java @@ -1,19 +1,12 @@ package org.jabref.model.openoffice.uno; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; +import com.sun.star.beans.*; +import com.sun.star.lang.WrappedTargetException; + import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; -import com.sun.star.beans.Property; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.XPropertyContainer; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.XPropertySetInfo; -import com.sun.star.lang.WrappedTargetException; - /** * Utilities for properties. */ diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoRedlines.java b/src/main/java/org/jabref/model/openoffice/uno/UnoRedlines.java index 11c42f99f7c..e7697e43eb6 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoRedlines.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoRedlines.java @@ -1,7 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.beans.UnknownPropertyException; import com.sun.star.beans.XPropertySet; import com.sun.star.container.NoSuchElementException; @@ -11,6 +9,8 @@ import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextDocument; +import java.util.Optional; + /** * Change tracking and Redlines */ diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoReferenceMark.java b/src/main/java/org/jabref/model/openoffice/uno/UnoReferenceMark.java index b06048dfc44..6e717356b64 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoReferenceMark.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoReferenceMark.java @@ -1,10 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNamed; @@ -15,6 +10,11 @@ import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + public class UnoReferenceMark { private UnoReferenceMark() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoSelection.java b/src/main/java/org/jabref/model/openoffice/uno/UnoSelection.java index 037bac28cc1..e36b250ebaf 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoSelection.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoSelection.java @@ -1,8 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.Objects; -import java.util.Optional; - import com.sun.star.frame.XController; import com.sun.star.lang.XServiceInfo; import com.sun.star.text.XTextDocument; @@ -10,6 +7,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Objects; +import java.util.Optional; + /** * Selection in the document. */ diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoStyle.java b/src/main/java/org/jabref/model/openoffice/uno/UnoStyle.java index 42f4b32f8bd..803a5b63fd3 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoStyle.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoStyle.java @@ -1,7 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; @@ -10,6 +8,8 @@ import com.sun.star.style.XStyleFamiliesSupplier; import com.sun.star.text.XTextDocument; +import java.util.Optional; + /** * Styles in the document. */ diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoTextDocument.java b/src/main/java/org/jabref/model/openoffice/uno/UnoTextDocument.java index c8d977e2da8..20f26e52a30 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoTextDocument.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoTextDocument.java @@ -1,7 +1,5 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.beans.XPropertySet; import com.sun.star.document.XDocumentProperties; import com.sun.star.document.XDocumentPropertiesSupplier; @@ -13,6 +11,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Optional; + public class UnoTextDocument { private static final Logger LOGGER = LoggerFactory.getLogger(UnoTextDocument.class); diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoTextRange.java b/src/main/java/org/jabref/model/openoffice/uno/UnoTextRange.java index 26a9142a1ab..43836096695 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoTextRange.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoTextRange.java @@ -1,12 +1,12 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.text.XFootnote; import com.sun.star.text.XTextContent; import com.sun.star.text.XTextRange; import com.sun.star.text.XTextRangeCompare; +import java.util.Optional; + public class UnoTextRange { private UnoTextRange() {} diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoTextSection.java b/src/main/java/org/jabref/model/openoffice/uno/UnoTextSection.java index d09d57dbdc6..389c5041a5c 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoTextSection.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoTextSection.java @@ -1,19 +1,15 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.container.NoSuchElementException; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNamed; import com.sun.star.lang.DisposedException; import com.sun.star.lang.WrappedTargetException; -import com.sun.star.text.XTextContent; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; -import com.sun.star.text.XTextSection; -import com.sun.star.text.XTextSectionsSupplier; +import com.sun.star.text.*; import com.sun.star.uno.Any; +import java.util.Optional; + public class UnoTextSection { /** diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoUndo.java b/src/main/java/org/jabref/model/openoffice/uno/UnoUndo.java index 17c43dc9556..d18c58b6411 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoUndo.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoUndo.java @@ -1,12 +1,12 @@ package org.jabref.model.openoffice.uno; -import java.util.Optional; - import com.sun.star.document.XUndoManager; import com.sun.star.document.XUndoManagerSupplier; import com.sun.star.text.XTextDocument; import com.sun.star.util.InvalidStateException; +import java.util.Optional; + /** * Undo : group document changes into larger Undo actions. */ diff --git a/src/main/java/org/jabref/model/openoffice/uno/UnoUserDefinedProperty.java b/src/main/java/org/jabref/model/openoffice/uno/UnoUserDefinedProperty.java index 674eb19ee89..bda0dc3cb14 100644 --- a/src/main/java/org/jabref/model/openoffice/uno/UnoUserDefinedProperty.java +++ b/src/main/java/org/jabref/model/openoffice/uno/UnoUserDefinedProperty.java @@ -1,19 +1,6 @@ package org.jabref.model.openoffice.uno; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; - -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.beans.NotRemoveableException; -import com.sun.star.beans.PropertyAttribute; -import com.sun.star.beans.PropertyExistException; -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.XPropertyContainer; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.XPropertySetInfo; +import com.sun.star.beans.*; import com.sun.star.document.XDocumentProperties; import com.sun.star.lang.WrappedTargetException; import com.sun.star.text.XTextDocument; @@ -22,6 +9,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + /** * Document level user-defined properties. *

    diff --git a/src/main/java/org/jabref/model/pdf/FileAnnotation.java b/src/main/java/org/jabref/model/pdf/FileAnnotation.java index e5328f726a9..f3c99778732 100644 --- a/src/main/java/org/jabref/model/pdf/FileAnnotation.java +++ b/src/main/java/org/jabref/model/pdf/FileAnnotation.java @@ -1,16 +1,16 @@ package org.jabref.model.pdf; +import org.apache.pdfbox.cos.COSName; +import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.Objects; import java.util.Optional; -import org.apache.pdfbox.cos.COSName; -import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class FileAnnotation { private static final Logger LOGGER = LoggerFactory.getLogger(FileAnnotation.class); diff --git a/src/main/java/org/jabref/model/pdf/FileAnnotationType.java b/src/main/java/org/jabref/model/pdf/FileAnnotationType.java index 934d5a07737..89a5fe93588 100644 --- a/src/main/java/org/jabref/model/pdf/FileAnnotationType.java +++ b/src/main/java/org/jabref/model/pdf/FileAnnotationType.java @@ -1,11 +1,11 @@ package org.jabref.model.pdf; -import java.util.Locale; - import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Locale; + /** * Our representation of the type of the FileAnnotation. This is needed as some FileAnnotationTypes require special * handling (e.g., Highlight or Underline), because of the linked FileAnnotations. diff --git a/src/main/java/org/jabref/model/pdf/search/EnglishStemAnalyzer.java b/src/main/java/org/jabref/model/pdf/search/EnglishStemAnalyzer.java index 5bee3154605..5b67f1f13d4 100644 --- a/src/main/java/org/jabref/model/pdf/search/EnglishStemAnalyzer.java +++ b/src/main/java/org/jabref/model/pdf/search/EnglishStemAnalyzer.java @@ -1,10 +1,6 @@ package org.jabref.model.pdf.search; -import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.LowerCaseFilter; -import org.apache.lucene.analysis.StopFilter; -import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.Tokenizer; +import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.core.DecimalDigitFilter; import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.apache.lucene.analysis.en.PorterStemFilter; diff --git a/src/main/java/org/jabref/model/pdf/search/SearchResult.java b/src/main/java/org/jabref/model/pdf/search/SearchResult.java index 143a0baea5f..6e2fcec9b4f 100644 --- a/src/main/java/org/jabref/model/pdf/search/SearchResult.java +++ b/src/main/java/org/jabref/model/pdf/search/SearchResult.java @@ -1,28 +1,19 @@ package org.jabref.model.pdf.search; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.jabref.model.entry.BibEntry; - import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.index.IndexableField; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; -import org.apache.lucene.search.highlight.Highlighter; -import org.apache.lucene.search.highlight.InvalidTokenOffsetsException; -import org.apache.lucene.search.highlight.QueryScorer; -import org.apache.lucene.search.highlight.SimpleHTMLFormatter; -import org.apache.lucene.search.highlight.TextFragment; - -import static org.jabref.model.pdf.search.SearchFieldConstants.ANNOTATIONS; -import static org.jabref.model.pdf.search.SearchFieldConstants.CONTENT; -import static org.jabref.model.pdf.search.SearchFieldConstants.MODIFIED; -import static org.jabref.model.pdf.search.SearchFieldConstants.PAGE_NUMBER; -import static org.jabref.model.pdf.search.SearchFieldConstants.PATH; +import org.apache.lucene.search.highlight.*; +import org.jabref.model.entry.BibEntry; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static org.jabref.model.pdf.search.SearchFieldConstants.*; public final class SearchResult { diff --git a/src/main/java/org/jabref/model/schema/DublinCoreSchemaCustom.java b/src/main/java/org/jabref/model/schema/DublinCoreSchemaCustom.java index 7bbb7dd511d..54d3426154e 100644 --- a/src/main/java/org/jabref/model/schema/DublinCoreSchemaCustom.java +++ b/src/main/java/org/jabref/model/schema/DublinCoreSchemaCustom.java @@ -1,9 +1,5 @@ package org.jabref.model.schema; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.xmpbox.XMPMetadata; import org.apache.xmpbox.schema.DublinCoreSchema; @@ -14,6 +10,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + /** * A DublinCoreSchema extension Class. * In case anyone intends to alter standard behaviour. diff --git a/src/main/java/org/jabref/model/search/GroupSearchQuery.java b/src/main/java/org/jabref/model/search/GroupSearchQuery.java index 185a5cad339..62e14d55196 100644 --- a/src/main/java/org/jabref/model/search/GroupSearchQuery.java +++ b/src/main/java/org/jabref/model/search/GroupSearchQuery.java @@ -1,13 +1,13 @@ package org.jabref.model.search; -import java.util.EnumSet; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; import org.jabref.model.search.rules.SearchRule; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; +import java.util.EnumSet; +import java.util.Objects; + public class GroupSearchQuery implements SearchMatcher { private final String query; diff --git a/src/main/java/org/jabref/model/search/matchers/MatcherSet.java b/src/main/java/org/jabref/model/search/matchers/MatcherSet.java index 46043c86551..4a771948f1e 100644 --- a/src/main/java/org/jabref/model/search/matchers/MatcherSet.java +++ b/src/main/java/org/jabref/model/search/matchers/MatcherSet.java @@ -1,11 +1,11 @@ package org.jabref.model.search.matchers; +import org.jabref.model.search.SearchMatcher; + import java.util.ArrayList; import java.util.List; import java.util.Objects; -import org.jabref.model.search.SearchMatcher; - public abstract class MatcherSet implements SearchMatcher { protected final List matchers = new ArrayList<>(); diff --git a/src/main/java/org/jabref/model/search/matchers/NotMatcher.java b/src/main/java/org/jabref/model/search/matchers/NotMatcher.java index 09be8c7f86e..c7ea7a5488d 100644 --- a/src/main/java/org/jabref/model/search/matchers/NotMatcher.java +++ b/src/main/java/org/jabref/model/search/matchers/NotMatcher.java @@ -1,10 +1,10 @@ package org.jabref.model.search.matchers; -import java.util.Objects; - import org.jabref.model.entry.BibEntry; import org.jabref.model.search.SearchMatcher; +import java.util.Objects; + /** * Inverts the search result. *

    diff --git a/src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java b/src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java index 6a870baf5e3..2dc635e45f7 100644 --- a/src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java +++ b/src/main/java/org/jabref/model/search/rules/ContainsBasedSearchRule.java @@ -1,16 +1,16 @@ package org.jabref.model.search.rules; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.model.strings.StringUtil; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; + /** * Search rule for a search based on String.contains() */ diff --git a/src/main/java/org/jabref/model/search/rules/FullTextSearchRule.java b/src/main/java/org/jabref/model/search/rules/FullTextSearchRule.java index fdba3c9e3af..bdf3bd6c6af 100644 --- a/src/main/java/org/jabref/model/search/rules/FullTextSearchRule.java +++ b/src/main/java/org/jabref/model/search/rules/FullTextSearchRule.java @@ -1,11 +1,5 @@ package org.jabref.model.search.rules; -import java.io.IOException; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.stream.Collectors; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.gui.Globals; import org.jabref.logic.pdf.search.retrieval.PdfSearcher; @@ -13,10 +7,15 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.pdf.search.PdfSearchResults; import org.jabref.model.pdf.search.SearchResult; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.stream.Collectors; + /** * All classes providing full text search results inherit from this class. *

    diff --git a/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java b/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java index e4b64ebe554..e3d56eb4417 100644 --- a/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java +++ b/src/main/java/org/jabref/model/search/rules/GrammarBasedSearchRule.java @@ -1,17 +1,8 @@ package org.jabref.model.search.rules; -import java.io.IOException; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Predicate; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.ParseCancellationException; +import org.antlr.v4.runtime.tree.ParseTree; import org.jabref.architecture.AllowedToUseLogic; import org.jabref.gui.Globals; import org.jabref.logic.pdf.search.retrieval.PdfSearcher; @@ -27,18 +18,16 @@ import org.jabref.search.SearchBaseVisitor; import org.jabref.search.SearchLexer; import org.jabref.search.SearchParser; - -import org.antlr.v4.runtime.ANTLRInputStream; -import org.antlr.v4.runtime.BailErrorStrategy; -import org.antlr.v4.runtime.BaseErrorListener; -import org.antlr.v4.runtime.CommonTokenStream; -import org.antlr.v4.runtime.RecognitionException; -import org.antlr.v4.runtime.Recognizer; -import org.antlr.v4.runtime.misc.ParseCancellationException; -import org.antlr.v4.runtime.tree.ParseTree; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.util.*; +import java.util.function.Predicate; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + /** * The search query must be specified in an expression that is acceptable by the Search.g4 grammar. *

    diff --git a/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java b/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java index f3d9b3984c7..6be23e5f267 100644 --- a/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java +++ b/src/main/java/org/jabref/model/search/rules/RegexBasedSearchRule.java @@ -1,20 +1,19 @@ package org.jabref.model.search.rules; -import java.util.EnumSet; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.model.strings.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.EnumSet; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + /** * Search rule for regex-based search. */ diff --git a/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java b/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java index 01c4c304ef2..3c70f91a46a 100644 --- a/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java +++ b/src/main/java/org/jabref/model/strings/LatexToUnicodeAdapter.java @@ -1,13 +1,13 @@ package org.jabref.model.strings; +import com.github.tomtung.latex2unicode.LaTeX2Unicode; +import fastparse.Parsed; + import java.text.Normalizer; import java.util.Objects; import java.util.Optional; import java.util.regex.Pattern; -import com.github.tomtung.latex2unicode.LaTeX2Unicode; -import fastparse.Parsed; - /** * Adapter class for the latex2unicode lib. This is an alternative to our LatexToUnicode class */ diff --git a/src/main/java/org/jabref/model/strings/StringUtil.java b/src/main/java/org/jabref/model/strings/StringUtil.java index 5e0fe41fa6f..9d4699b09e6 100644 --- a/src/main/java/org/jabref/model/strings/StringUtil.java +++ b/src/main/java/org/jabref/model/strings/StringUtil.java @@ -1,21 +1,14 @@ package org.jabref.model.strings; -import java.text.Normalizer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; -import java.util.StringTokenizer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import com.google.common.base.CharMatcher; +import org.apache.commons.lang3.StringUtils; import org.jabref.architecture.ApacheCommonsLang3Allowed; import org.jabref.logic.bibtex.FieldWriter; -import com.google.common.base.CharMatcher; -import org.apache.commons.lang3.StringUtils; +import java.text.Normalizer; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; @ApacheCommonsLang3Allowed("There is no equivalent in Google's Guava") public class StringUtil { diff --git a/src/main/java/org/jabref/model/study/Study.java b/src/main/java/org/jabref/model/study/Study.java index f2295c2c5ec..f930643edab 100644 --- a/src/main/java/org/jabref/model/study/Study.java +++ b/src/main/java/org/jabref/model/study/Study.java @@ -1,13 +1,12 @@ package org.jabref.model.study; -import java.util.List; -import java.util.Objects; - -import org.jabref.logic.crawler.StudyYamlParser; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.jabref.logic.crawler.StudyYamlParser; + +import java.util.List; +import java.util.Objects; /** * This class represents a scientific study. diff --git a/src/main/java/org/jabref/model/texparser/LatexBibEntriesResolverResult.java b/src/main/java/org/jabref/model/texparser/LatexBibEntriesResolverResult.java index b18a21479ce..2c31f3858a8 100644 --- a/src/main/java/org/jabref/model/texparser/LatexBibEntriesResolverResult.java +++ b/src/main/java/org/jabref/model/texparser/LatexBibEntriesResolverResult.java @@ -1,14 +1,13 @@ package org.jabref.model.texparser; +import com.google.common.collect.Multimap; +import org.jabref.model.entry.BibEntry; + import java.nio.file.Path; import java.util.HashSet; import java.util.Objects; import java.util.Set; -import org.jabref.model.entry.BibEntry; - -import com.google.common.collect.Multimap; - public class LatexBibEntriesResolverResult { private final LatexParserResult latexParserResult; diff --git a/src/main/java/org/jabref/model/texparser/LatexParserResult.java b/src/main/java/org/jabref/model/texparser/LatexParserResult.java index 2fc05e4e14b..7bd51f1b1af 100644 --- a/src/main/java/org/jabref/model/texparser/LatexParserResult.java +++ b/src/main/java/org/jabref/model/texparser/LatexParserResult.java @@ -1,17 +1,11 @@ package org.jabref.model.texparser; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.Set; - -import org.jabref.model.entry.BibEntry; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import org.jabref.model.entry.BibEntry; + +import java.nio.file.Path; +import java.util.*; public class LatexParserResult { diff --git a/src/main/java/org/jabref/model/util/TreeCollector.java b/src/main/java/org/jabref/model/util/TreeCollector.java index dad6c9981ed..13ee9a06729 100644 --- a/src/main/java/org/jabref/model/util/TreeCollector.java +++ b/src/main/java/org/jabref/model/util/TreeCollector.java @@ -1,22 +1,13 @@ package org.jabref.model.util; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.function.BiConsumer; -import java.util.function.BiPredicate; -import java.util.function.BinaryOperator; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collector; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.model.TreeNode; +import java.util.*; +import java.util.function.*; +import java.util.stream.Collector; + /** * Merges a list of nodes into a tree. * Nodes with a common parent are added as direct children. diff --git a/src/main/java/org/jabref/preferences/CleanupPreferences.java b/src/main/java/org/jabref/preferences/CleanupPreferences.java index cf3b24491fa..052231b6f56 100644 --- a/src/main/java/org/jabref/preferences/CleanupPreferences.java +++ b/src/main/java/org/jabref/preferences/CleanupPreferences.java @@ -1,16 +1,15 @@ package org.jabref.preferences; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Set; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableSet; - import org.jabref.logic.cleanup.FieldFormatterCleanups; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.Set; + public class CleanupPreferences { private final ObservableSet activeJobs; diff --git a/src/main/java/org/jabref/preferences/ExportPreferences.java b/src/main/java/org/jabref/preferences/ExportPreferences.java index 80a4717d0d1..48d1c7f5dc1 100644 --- a/src/main/java/org/jabref/preferences/ExportPreferences.java +++ b/src/main/java/org/jabref/preferences/ExportPreferences.java @@ -1,18 +1,17 @@ package org.jabref.preferences; -import java.nio.file.Path; -import java.util.List; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.logic.exporter.TemplateExporter; import org.jabref.model.metadata.SaveOrder; +import java.nio.file.Path; +import java.util.List; + public class ExportPreferences { private final StringProperty lastExportExtension; diff --git a/src/main/java/org/jabref/preferences/FilePreferences.java b/src/main/java/org/jabref/preferences/FilePreferences.java index 19ba613e238..740ce084562 100644 --- a/src/main/java/org/jabref/preferences/FilePreferences.java +++ b/src/main/java/org/jabref/preferences/FilePreferences.java @@ -1,23 +1,17 @@ package org.jabref.preferences; +import javafx.beans.property.*; +import javafx.collections.FXCollections; +import javafx.collections.ObservableSet; +import org.jabref.gui.externalfiletype.ExternalFileType; +import org.jabref.model.strings.StringUtil; + import java.nio.file.Path; import java.util.Comparator; import java.util.Optional; import java.util.Set; import java.util.TreeSet; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; -import javafx.collections.FXCollections; -import javafx.collections.ObservableSet; - -import org.jabref.gui.externalfiletype.ExternalFileType; -import org.jabref.model.strings.StringUtil; - /** * Preferences for the linked files */ diff --git a/src/main/java/org/jabref/preferences/GuiPreferences.java b/src/main/java/org/jabref/preferences/GuiPreferences.java index 89fdb862e39..1f22f5c9d1a 100644 --- a/src/main/java/org/jabref/preferences/GuiPreferences.java +++ b/src/main/java/org/jabref/preferences/GuiPreferences.java @@ -1,22 +1,14 @@ package org.jabref.preferences; -import java.nio.file.Path; -import java.util.List; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.DoubleProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleDoubleProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.mergeentries.DiffMode; import org.jabref.logic.util.io.FileHistory; +import java.nio.file.Path; +import java.util.List; + public class GuiPreferences { private final DoubleProperty positionX; private final DoubleProperty positionY; diff --git a/src/main/java/org/jabref/preferences/InternalPreferences.java b/src/main/java/org/jabref/preferences/InternalPreferences.java index b41d0873d57..7ea34e340c8 100644 --- a/src/main/java/org/jabref/preferences/InternalPreferences.java +++ b/src/main/java/org/jabref/preferences/InternalPreferences.java @@ -1,16 +1,10 @@ package org.jabref.preferences; -import java.nio.file.Path; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; - +import javafx.beans.property.*; import org.jabref.logic.util.Version; +import java.nio.file.Path; + public class InternalPreferences { private final ObjectProperty ignoredVersion; diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 42eddaa43f7..a2f99da2115 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -1,42 +1,14 @@ package org.jabref.preferences; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.StringReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; -import java.util.UUID; -import java.util.prefs.BackingStoreException; -import java.util.prefs.InvalidPreferencesFormatException; -import java.util.prefs.Preferences; -import java.util.stream.Collectors; -import java.util.stream.Stream; - +import com.github.javakeyring.Keyring; +import com.github.javakeyring.PasswordAccessException; +import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Singleton; import javafx.beans.InvalidationListener; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; import javafx.collections.SetChangeListener; import javafx.scene.control.TableColumn.SortType; - import org.jabref.gui.Globals; import org.jabref.gui.autocompleter.AutoCompleteFirstNameMode; import org.jabref.gui.autocompleter.AutoCompletePreferences; @@ -71,12 +43,7 @@ import org.jabref.logic.exporter.TemplateExporter; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.fetcher.ACMPortalFetcher; -import org.jabref.logic.importer.fetcher.DBLPFetcher; -import org.jabref.logic.importer.fetcher.DoiFetcher; -import org.jabref.logic.importer.fetcher.GrobidPreferences; -import org.jabref.logic.importer.fetcher.IEEE; -import org.jabref.logic.importer.fetcher.SpringerFetcher; +import org.jabref.logic.importer.fetcher.*; import org.jabref.logic.importer.fileformat.CustomImporter; import org.jabref.logic.importer.util.MetaDataParser; import org.jabref.logic.journals.JournalAbbreviationPreferences; @@ -119,15 +86,21 @@ import org.jabref.model.metadata.SelfContainedSaveOrder; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.strings.StringUtil; - -import com.github.javakeyring.Keyring; -import com.github.javakeyring.PasswordAccessException; -import com.tobiasdiez.easybind.EasyBind; -import jakarta.inject.Singleton; import org.jvnet.hk2.annotations.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.prefs.BackingStoreException; +import java.util.prefs.InvalidPreferencesFormatException; +import java.util.prefs.Preferences; +import java.util.stream.Collectors; +import java.util.stream.Stream; + /** * The {@code JabRefPreferences} class provides the preferences and their defaults using the JDK {@code java.util.prefs} * class. diff --git a/src/main/java/org/jabref/preferences/LibraryPreferences.java b/src/main/java/org/jabref/preferences/LibraryPreferences.java index 14eb1c56441..41932a9abf3 100644 --- a/src/main/java/org/jabref/preferences/LibraryPreferences.java +++ b/src/main/java/org/jabref/preferences/LibraryPreferences.java @@ -4,7 +4,6 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; - import org.jabref.model.database.BibDatabaseMode; public class LibraryPreferences { diff --git a/src/main/java/org/jabref/preferences/PreferencesFilter.java b/src/main/java/org/jabref/preferences/PreferencesFilter.java index 372374589f1..e373403dd54 100644 --- a/src/main/java/org/jabref/preferences/PreferencesFilter.java +++ b/src/main/java/org/jabref/preferences/PreferencesFilter.java @@ -1,10 +1,6 @@ package org.jabref.preferences; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; public class PreferencesFilter { diff --git a/src/main/java/org/jabref/preferences/PreferencesService.java b/src/main/java/org/jabref/preferences/PreferencesService.java index a03123740d6..9b7da3e8ee8 100644 --- a/src/main/java/org/jabref/preferences/PreferencesService.java +++ b/src/main/java/org/jabref/preferences/PreferencesService.java @@ -1,9 +1,5 @@ package org.jabref.preferences; -import java.nio.file.Path; -import java.util.Map; -import java.util.prefs.BackingStoreException; - import org.jabref.gui.autocompleter.AutoCompletePreferences; import org.jabref.gui.entryeditor.EntryEditorPreferences; import org.jabref.gui.groups.GroupsPreferences; @@ -33,9 +29,12 @@ import org.jabref.logic.util.io.AutoLinkPreferences; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.model.entry.BibEntryTypesManager; - import org.jvnet.hk2.annotations.Contract; +import java.nio.file.Path; +import java.util.Map; +import java.util.prefs.BackingStoreException; + @Contract public interface PreferencesService { diff --git a/src/main/java/org/jabref/preferences/PreviewPreferences.java b/src/main/java/org/jabref/preferences/PreviewPreferences.java index 9bf1fb27556..6d8448bb88e 100644 --- a/src/main/java/org/jabref/preferences/PreviewPreferences.java +++ b/src/main/java/org/jabref/preferences/PreviewPreferences.java @@ -1,21 +1,13 @@ package org.jabref.preferences; -import java.util.List; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleIntegerProperty; -import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.logic.layout.TextBasedPreviewLayout; import org.jabref.logic.preview.PreviewLayout; +import java.util.List; + public class PreviewPreferences { private final ObservableList layoutCycle; diff --git a/src/main/java/org/jabref/preferences/PushToApplicationPreferences.java b/src/main/java/org/jabref/preferences/PushToApplicationPreferences.java index bf8ea4570cf..b6754022f6c 100644 --- a/src/main/java/org/jabref/preferences/PushToApplicationPreferences.java +++ b/src/main/java/org/jabref/preferences/PushToApplicationPreferences.java @@ -1,13 +1,13 @@ package org.jabref.preferences; -import java.util.Map; - import javafx.beans.property.MapProperty; import javafx.beans.property.SimpleMapProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; +import java.util.Map; + public class PushToApplicationPreferences { private final StringProperty activeApplicationName; private final MapProperty commandPaths; diff --git a/src/main/java/org/jabref/preferences/SearchPreferences.java b/src/main/java/org/jabref/preferences/SearchPreferences.java index b21f5f8570d..be5e43b980b 100644 --- a/src/main/java/org/jabref/preferences/SearchPreferences.java +++ b/src/main/java/org/jabref/preferences/SearchPreferences.java @@ -1,19 +1,13 @@ package org.jabref.preferences; -import java.util.EnumSet; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.DoubleProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleDoubleProperty; -import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.collections.ObservableSet; - import org.jabref.gui.search.SearchDisplayMode; import org.jabref.model.search.rules.SearchRules.SearchFlags; +import java.util.EnumSet; + public class SearchPreferences { private final ObjectProperty searchDisplayMode; diff --git a/src/main/java/org/jabref/preferences/SidePanePreferences.java b/src/main/java/org/jabref/preferences/SidePanePreferences.java index b9640af44c2..8dadf12873e 100644 --- a/src/main/java/org/jabref/preferences/SidePanePreferences.java +++ b/src/main/java/org/jabref/preferences/SidePanePreferences.java @@ -1,16 +1,15 @@ package org.jabref.preferences; -import java.util.Map; -import java.util.Set; - import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableMap; import javafx.collections.ObservableSet; - import org.jabref.gui.sidepane.SidePaneType; +import java.util.Map; +import java.util.Set; + public class SidePanePreferences { private final ObservableSet visiblePanes; private final ObservableMap preferredPositions; diff --git a/src/main/java/org/jabref/preferences/WorkspacePreferences.java b/src/main/java/org/jabref/preferences/WorkspacePreferences.java index d5619f3636f..95393bef1b6 100644 --- a/src/main/java/org/jabref/preferences/WorkspacePreferences.java +++ b/src/main/java/org/jabref/preferences/WorkspacePreferences.java @@ -1,12 +1,6 @@ package org.jabref.preferences; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.ObjectProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleIntegerProperty; -import javafx.beans.property.SimpleObjectProperty; - +import javafx.beans.property.*; import org.jabref.gui.theme.Theme; import org.jabref.logic.l10n.Language; diff --git a/src/test/java/org/jabref/cli/ArgumentProcessorTest.java b/src/test/java/org/jabref/cli/ArgumentProcessorTest.java index bcd81d2db5a..6d71c9f8b99 100644 --- a/src/test/java/org/jabref/cli/ArgumentProcessorTest.java +++ b/src/test/java/org/jabref/cli/ArgumentProcessorTest.java @@ -1,13 +1,6 @@ package org.jabref.cli; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; - import javafx.collections.FXCollections; - import org.jabref.cli.ArgumentProcessor.Mode; import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.exporter.BibDatabaseWriter; @@ -25,12 +18,17 @@ import org.jabref.preferences.ExportPreferences; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SearchPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.EnumSet; +import java.util.List; +import java.util.Objects; + import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/cli/AuxCommandLineTest.java b/src/test/java/org/jabref/cli/AuxCommandLineTest.java index 6fca77167dc..ae2cd5ec2be 100644 --- a/src/test/java/org/jabref/cli/AuxCommandLineTest.java +++ b/src/test/java/org/jabref/cli/AuxCommandLineTest.java @@ -1,22 +1,21 @@ package org.jabref.cli; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.model.database.BibDatabase; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/cli/JabRefCLITest.java b/src/test/java/org/jabref/cli/JabRefCLITest.java index da7a094e100..2a41f50c35b 100644 --- a/src/test/java/org/jabref/cli/JabRefCLITest.java +++ b/src/test/java/org/jabref/cli/JabRefCLITest.java @@ -1,12 +1,11 @@ package org.jabref.cli; -import java.util.Collections; -import java.util.List; - import javafx.util.Pair; - import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/UpdateTimestampListenerTest.java b/src/test/java/org/jabref/gui/UpdateTimestampListenerTest.java index 8b959a47776..f9497b3d023 100644 --- a/src/test/java/org/jabref/gui/UpdateTimestampListenerTest.java +++ b/src/test/java/org/jabref/gui/UpdateTimestampListenerTest.java @@ -1,17 +1,16 @@ package org.jabref.gui; -import java.util.Optional; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/autocompleter/BibEntrySuggestionProviderTest.java b/src/test/java/org/jabref/gui/autocompleter/BibEntrySuggestionProviderTest.java index 7b641e987dd..fb3ffb97f2d 100644 --- a/src/test/java/org/jabref/gui/autocompleter/BibEntrySuggestionProviderTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/BibEntrySuggestionProviderTest.java @@ -1,15 +1,14 @@ package org.jabref.gui.autocompleter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + import static org.jabref.gui.autocompleter.AutoCompleterUtil.getRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/gui/autocompleter/ContentSelectorSuggestionProviderTest.java b/src/test/java/org/jabref/gui/autocompleter/ContentSelectorSuggestionProviderTest.java index efa4139f4e3..cf10e74eaee 100644 --- a/src/test/java/org/jabref/gui/autocompleter/ContentSelectorSuggestionProviderTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/ContentSelectorSuggestionProviderTest.java @@ -1,15 +1,14 @@ package org.jabref.gui.autocompleter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + import static org.jabref.gui.autocompleter.AutoCompleterUtil.getRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/gui/autocompleter/DefaultAutoCompleterTest.java b/src/test/java/org/jabref/gui/autocompleter/DefaultAutoCompleterTest.java index 767eff82374..cd0b5592d3b 100644 --- a/src/test/java/org/jabref/gui/autocompleter/DefaultAutoCompleterTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/DefaultAutoCompleterTest.java @@ -1,16 +1,15 @@ package org.jabref.gui.autocompleter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + import static org.jabref.gui.autocompleter.AutoCompleterUtil.getRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/gui/autocompleter/FieldValueSuggestionProviderTest.java b/src/test/java/org/jabref/gui/autocompleter/FieldValueSuggestionProviderTest.java index 684f4c9aee5..37ede0c0952 100644 --- a/src/test/java/org/jabref/gui/autocompleter/FieldValueSuggestionProviderTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/FieldValueSuggestionProviderTest.java @@ -1,21 +1,15 @@ package org.jabref.gui.autocompleter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; - import javafx.collections.FXCollections; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.*; + import static org.jabref.gui.autocompleter.AutoCompleterUtil.getRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java b/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java index 4334c275c92..227658b36c0 100644 --- a/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java @@ -1,13 +1,12 @@ package org.jabref.gui.autocompleter; -import java.util.Collections; - import org.jabref.model.entry.Author; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; public class PersonNameStringConverterTest { diff --git a/src/test/java/org/jabref/gui/autocompleter/PersonNameSuggestionProviderTest.java b/src/test/java/org/jabref/gui/autocompleter/PersonNameSuggestionProviderTest.java index 211e517f770..ff9e34fb5dc 100644 --- a/src/test/java/org/jabref/gui/autocompleter/PersonNameSuggestionProviderTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/PersonNameSuggestionProviderTest.java @@ -1,18 +1,17 @@ package org.jabref.gui.autocompleter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.Author; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + import static org.jabref.gui.autocompleter.AutoCompleterUtil.getRequest; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java b/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java index e9565b51a58..0d0dd9d2f6b 100644 --- a/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java @@ -1,21 +1,20 @@ package org.jabref.gui.autocompleter; -import java.util.Set; -import java.util.stream.Stream; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.SpecialField; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Set; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerDiscardedTest.java b/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerDiscardedTest.java index 823a6ff71ba..8a9a95821f0 100644 --- a/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerDiscardedTest.java +++ b/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerDiscardedTest.java @@ -1,17 +1,7 @@ package org.jabref.gui.autosaveandbackup; -import java.io.IOException; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; - import org.jabref.gui.LibraryTab; -import org.jabref.logic.exporter.AtomicFileWriter; -import org.jabref.logic.exporter.BibDatabaseWriter; -import org.jabref.logic.exporter.BibWriter; -import org.jabref.logic.exporter.BibtexDatabaseWriter; -import org.jabref.logic.exporter.SelfContainedSaveConfiguration; +import org.jabref.logic.exporter.*; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -19,12 +9,17 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.SaveOrder; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.io.IOException; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerTest.java b/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerTest.java index c1cb74c127b..25fab6ac850 100644 --- a/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerTest.java +++ b/src/test/java/org/jabref/gui/autosaveandbackup/BackupManagerTest.java @@ -1,13 +1,5 @@ package org.jabref.gui.autosaveandbackup; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.FileTime; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.LibraryTab; import org.jabref.logic.util.BackupFileType; import org.jabref.logic.util.OS; @@ -20,16 +12,20 @@ import org.jabref.model.metadata.event.MetaDataChangedEvent; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.FileTime; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/commonfxcontrols/SaveOrderPanelViewModelTest.java b/src/test/java/org/jabref/gui/commonfxcontrols/SaveOrderPanelViewModelTest.java index 863f299ca82..a1cd0333f50 100644 --- a/src/test/java/org/jabref/gui/commonfxcontrols/SaveOrderPanelViewModelTest.java +++ b/src/test/java/org/jabref/gui/commonfxcontrols/SaveOrderPanelViewModelTest.java @@ -1,13 +1,12 @@ package org.jabref.gui.commonfxcontrols; -import java.util.List; - import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; class SaveOrderPanelViewModelTest { diff --git a/src/test/java/org/jabref/gui/documentviewer/PdfDocumentViewModelTest.java b/src/test/java/org/jabref/gui/documentviewer/PdfDocumentViewModelTest.java index b9ea795ff2f..3c211fd6c06 100644 --- a/src/test/java/org/jabref/gui/documentviewer/PdfDocumentViewModelTest.java +++ b/src/test/java/org/jabref/gui/documentviewer/PdfDocumentViewModelTest.java @@ -1,13 +1,13 @@ package org.jabref.gui.documentviewer; -import java.io.IOException; -import java.nio.file.Path; - import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.io.IOException; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; class PdfDocumentViewModelTest { diff --git a/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java b/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java index 1941dab827d..77a9ec19267 100644 --- a/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java +++ b/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java @@ -1,12 +1,7 @@ package org.jabref.gui.edit; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefDialogService; @@ -20,16 +15,14 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.mockito.Mockito.*; public class CopyMoreActionTest { diff --git a/src/test/java/org/jabref/gui/edit/CopyOrMoveFieldContentTabViewModelTest.java b/src/test/java/org/jabref/gui/edit/CopyOrMoveFieldContentTabViewModelTest.java index e58a41ac654..e361fe01f4c 100644 --- a/src/test/java/org/jabref/gui/edit/CopyOrMoveFieldContentTabViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/CopyOrMoveFieldContentTabViewModelTest.java @@ -1,17 +1,16 @@ package org.jabref.gui.edit; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.StateManager; import org.jabref.gui.edit.automaticfiededitor.copyormovecontent.CopyOrMoveFieldContentTabViewModel; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/edit/EditFieldContentTabViewModelTest.java b/src/test/java/org/jabref/gui/edit/EditFieldContentTabViewModelTest.java index 1221580762a..b437c4c6202 100644 --- a/src/test/java/org/jabref/gui/edit/EditFieldContentTabViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/EditFieldContentTabViewModelTest.java @@ -1,17 +1,16 @@ package org.jabref.gui.edit; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.StateManager; import org.jabref.gui.edit.automaticfiededitor.editfieldcontent.EditFieldContentViewModel; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java b/src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java index 0a298ff3a1f..d87b1777d1a 100644 --- a/src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java @@ -1,19 +1,17 @@ package org.jabref.gui.edit; -import java.util.Arrays; -import java.util.List; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.BibEntryPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/edit/RenameFieldViewModelTest.java b/src/test/java/org/jabref/gui/edit/RenameFieldViewModelTest.java index bf5a246e97f..a307de4d761 100644 --- a/src/test/java/org/jabref/gui/edit/RenameFieldViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/RenameFieldViewModelTest.java @@ -1,8 +1,5 @@ package org.jabref.gui.edit; -import java.util.List; -import java.util.Optional; - import org.jabref.gui.StateManager; import org.jabref.gui.edit.automaticfiededitor.renamefield.RenameFieldViewModel; import org.jabref.model.database.BibDatabase; @@ -11,10 +8,12 @@ import org.jabref.model.entry.field.FieldFactory; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java index ebbb198fe43..ead3451f2a4 100644 --- a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java @@ -1,21 +1,19 @@ package org.jabref.gui.edit; -import java.util.ArrayList; -import java.util.List; - import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleStringProperty; - import org.jabref.gui.LibraryTab; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; +import java.util.ArrayList; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -59,17 +57,17 @@ 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 + // selected field "Informatics, replaceText, randomField, TRUE, FALSE, 0", // does not replace if the BibEntry does not have - // selected field + // selected field "Informatics, replaceText, journaltitle, TRUE, FALSE, 1", // replace "Informatics" in the JOURNALTITLE field to - // "replaceText" in the BibEntry + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, TRUE, TRUE, 1", // replace "Informatics" in the JOURNALTITLE field to - // "replaceText" in the BibEntry + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, FALSE, FALSE, 1", // replace "Informatics" in the JOURNALTITLE field to - // "replaceText" in the BibEntry + // "replaceText" in the BibEntry "Informatics, replaceText, journaltitle, FALSE, TRUE, 1", // replace "Informatics" in the JOURNALTITLE field to - // "replaceText" in the BibEntry + // "replaceText" in the BibEntry "2020, 2021, date, TRUE, FALSE, 1", // only replace "2020" in the DATE field to "2021" in 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 diff --git a/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java b/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java index c5386e02f6c..3c3dd562a9e 100644 --- a/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java @@ -1,10 +1,5 @@ package org.jabref.gui.entryeditor; -import java.util.Optional; -import java.util.Set; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.autocompleter.SuggestionProviders; @@ -24,7 +19,6 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.PreferencesService; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -32,6 +26,10 @@ import org.mockito.MockitoAnnotations; import org.testfx.framework.junit5.ApplicationExtension; +import javax.swing.undo.UndoManager; +import java.util.Optional; +import java.util.Set; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java b/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java index 5deceee6420..72e70e2863a 100644 --- a/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java @@ -6,7 +6,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.PreferencesService; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java b/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java index 7cf10602d49..66c2935d986 100644 --- a/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java @@ -1,19 +1,18 @@ package org.jabref.gui.entryeditor; -import java.util.Optional; - +import kong.unirest.json.JSONObject; import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.identifier.DOI; import org.jabref.preferences.PreferencesService; - -import kong.unirest.json.JSONObject; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/entryeditor/SourceTabTest.java b/src/test/java/org/jabref/gui/entryeditor/SourceTabTest.java index 61ad7e20a76..88df053080c 100644 --- a/src/test/java/org/jabref/gui/entryeditor/SourceTabTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/SourceTabTest.java @@ -1,14 +1,12 @@ package org.jabref.gui.entryeditor; -import java.util.Collections; - import javafx.collections.FXCollections; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.stage.Stage; - +import org.fxmisc.richtext.CodeArea; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.keyboard.KeyBindingRepository; @@ -22,8 +20,6 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.testutils.category.GUITest; - -import org.fxmisc.richtext.CodeArea; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Answers; @@ -31,6 +27,8 @@ import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; +import java.util.Collections; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.java b/src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.java index eab91846431..b9b7a1496af 100644 --- a/src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.java @@ -1,14 +1,13 @@ package org.jabref.gui.entryeditor.fileannotationtab; -import java.time.LocalDateTime; -import java.util.Optional; - import org.jabref.model.pdf.FileAnnotation; import org.jabref.model.pdf.FileAnnotationType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.time.LocalDateTime; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FileAnnotationViewModelTest { diff --git a/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java b/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java index 7132f2e3f3b..3677a946b84 100644 --- a/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java +++ b/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java @@ -1,13 +1,7 @@ package org.jabref.gui.exporter; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.ClipBoardManager; import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; @@ -27,19 +21,17 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.LibraryPreferences; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyCollection; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; public class ExportToClipboardActionTest { diff --git a/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java b/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java index 7bf7da4cf2c..e68bdbc23d2 100644 --- a/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java +++ b/src/test/java/org/jabref/gui/exporter/SaveDatabaseActionTest.java @@ -1,15 +1,6 @@ package org.jabref.gui.exporter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.LibraryTab; @@ -32,19 +23,21 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.LibraryPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class SaveDatabaseActionTest { diff --git a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java index 930fc646be5..7cff5a36317 100644 --- a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java @@ -1,13 +1,6 @@ package org.jabref.gui.externalfiles; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.TreeSet; - import javafx.collections.FXCollections; - import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.logic.util.io.AutoLinkPreferences; import org.jabref.model.database.BibDatabaseContext; @@ -15,11 +8,16 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.TreeSet; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java b/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java index e940d94e9dc..47668def7ef 100755 --- a/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java @@ -1,5 +1,10 @@ package org.jabref.gui.externalfiles; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.FileTime; @@ -10,11 +15,6 @@ import java.util.Set; import java.util.stream.Collectors; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/gui/externalfiles/GitIgnoreFileFilterTest.java b/src/test/java/org/jabref/gui/externalfiles/GitIgnoreFileFilterTest.java index f915a21ac99..1a9624d53a9 100644 --- a/src/test/java/org/jabref/gui/externalfiles/GitIgnoreFileFilterTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/GitIgnoreFileFilterTest.java @@ -1,11 +1,11 @@ package org.jabref.gui.externalfiles; -import java.nio.file.Files; -import java.nio.file.Path; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.nio.file.Files; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java b/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java index b7fdde2b948..2015691c079 100644 --- a/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/ImportHandlerTest.java @@ -1,9 +1,5 @@ package org.jabref.gui.externalfiles; -import java.util.List; - -import javax.swing.undo.UndoManager; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.duplicationFinder.DuplicateResolverDialog; @@ -19,7 +15,6 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; @@ -27,9 +22,10 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import javax.swing.undo.UndoManager; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawlerTest.java b/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawlerTest.java index 58bdf94c026..c885c18b51f 100644 --- a/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawlerTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesCrawlerTest.java @@ -1,18 +1,17 @@ package org.jabref.gui.externalfiles; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.stream.Stream; - import org.jabref.gui.util.FileNodeViewModel; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.stream.Stream; + import static java.nio.file.DirectoryStream.Filter; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/org/jabref/gui/externalfiletype/ExternalFileTypesTest.java b/src/test/java/org/jabref/gui/externalfiletype/ExternalFileTypesTest.java index f393ebabdc9..c00839707b6 100644 --- a/src/test/java/org/jabref/gui/externalfiletype/ExternalFileTypesTest.java +++ b/src/test/java/org/jabref/gui/externalfiletype/ExternalFileTypesTest.java @@ -1,22 +1,18 @@ package org.jabref.gui.externalfiletype; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Optional; -import java.util.Set; - import javafx.collections.FXCollections; - import org.jabref.gui.icon.IconTheme; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Optional; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java b/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java index a9f7db4f81c..e7a72ee5a8f 100644 --- a/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java +++ b/src/test/java/org/jabref/gui/fieldeditors/LinkedFileViewModelTest.java @@ -1,23 +1,8 @@ package org.jabref.gui.fieldeditors; -import java.io.IOException; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.TreeSet; - import javafx.collections.FXCollections; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.ButtonType; - import org.jabref.gui.DialogService; import org.jabref.gui.externalfiletype.ExternalFileType; import org.jabref.gui.externalfiletype.ExternalFileTypes; @@ -34,26 +19,22 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; +import java.io.IOException; +import java.net.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class LinkedFileViewModelTest { diff --git a/src/test/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModelTest.java b/src/test/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModelTest.java index 652806ab258..894eadb08f9 100644 --- a/src/test/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModelTest.java +++ b/src/test/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModelTest.java @@ -1,13 +1,6 @@ package org.jabref.gui.fieldeditors; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Optional; - -import javax.swing.undo.UndoManager; - import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.gui.autocompleter.EmptySuggestionProvider; import org.jabref.gui.externalfiletype.StandardExternalFileType; @@ -19,11 +12,15 @@ import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import javax.swing.undo.UndoManager; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java b/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java index ae6f29b9e5b..fde710e9c8e 100644 --- a/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java +++ b/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java @@ -1,9 +1,5 @@ package org.jabref.gui.groups; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.groups.AbstractGroup; @@ -13,14 +9,15 @@ import org.jabref.preferences.BibEntryPreferences; import org.jabref.preferences.FilePreferences; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/groups/GroupNodeViewModelTest.java b/src/test/java/org/jabref/gui/groups/GroupNodeViewModelTest.java index c6818c5bc29..28cddca9ff2 100644 --- a/src/test/java/org/jabref/gui/groups/GroupNodeViewModelTest.java +++ b/src/test/java/org/jabref/gui/groups/GroupNodeViewModelTest.java @@ -1,10 +1,7 @@ package org.jabref.gui.groups; -import java.util.Arrays; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.StateManager; import org.jabref.gui.util.CurrentThreadTaskExecutor; import org.jabref.gui.util.CustomLocalDragboard; @@ -13,17 +10,13 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java b/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java index fa45f8efa5b..111721b9b24 100644 --- a/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java +++ b/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java @@ -1,7 +1,5 @@ package org.jabref.gui.groups; -import java.util.Optional; - import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.gui.util.CurrentThreadTaskExecutor; @@ -10,20 +8,15 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java b/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java index 079bb6c1388..e9c81e783d3 100644 --- a/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java +++ b/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java @@ -1,25 +1,15 @@ package org.jabref.gui.importer; -import org.jabref.gui.DialogService; -import org.jabref.gui.EntryTypeView; -import org.jabref.gui.JabRefFrame; -import org.jabref.gui.LibraryTab; -import org.jabref.gui.StateManager; +import org.jabref.gui.*; import org.jabref.gui.util.OptionalObjectProperty; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; public class NewEntryActionTest { diff --git a/src/test/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModelTest.java b/src/test/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModelTest.java index 38534a40221..e5f100f9d64 100644 --- a/src/test/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModelTest.java +++ b/src/test/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModelTest.java @@ -3,7 +3,6 @@ import org.jabref.gui.DialogService; import org.jabref.gui.StateManager; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; diff --git a/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java b/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java index c5084ab771f..6b6d72fa5b3 100644 --- a/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java +++ b/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java @@ -1,24 +1,19 @@ package org.jabref.gui.keyboard; -import java.util.Optional; - import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; - import org.jabref.gui.DialogService; import org.jabref.gui.preferences.keybindings.KeyBindingViewModel; import org.jabref.gui.preferences.keybindings.KeyBindingsTabViewModel; import org.jabref.logic.util.OS; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java b/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java index 7280c3e33e1..31ce51ad63c 100644 --- a/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java +++ b/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java @@ -1,19 +1,17 @@ package org.jabref.gui.libraryproperties.constants; -import java.util.List; - import javafx.beans.property.StringProperty; - import org.jabref.gui.DialogService; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibtexString; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModelTest.java b/src/test/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModelTest.java index f67673301eb..97b0c85a784 100644 --- a/src/test/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModelTest.java +++ b/src/test/java/org/jabref/gui/libraryproperties/contentselectors/ContentSelectorViewModelTest.java @@ -1,23 +1,21 @@ package org.jabref.gui.libraryproperties.contentselectors; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; - import org.jabref.gui.DialogService; import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/maintable/MainTableDataModelTest.java b/src/test/java/org/jabref/gui/maintable/MainTableDataModelTest.java index 78fca17ce7f..3b908c0f08c 100644 --- a/src/test/java/org/jabref/gui/maintable/MainTableDataModelTest.java +++ b/src/test/java/org/jabref/gui/maintable/MainTableDataModelTest.java @@ -1,7 +1,6 @@ package org.jabref.gui.maintable; -import java.util.List; - +import com.tobiasdiez.easybind.EasyBind; import javafx.beans.InvalidationListener; import javafx.beans.binding.Bindings; import javafx.beans.property.IntegerProperty; @@ -11,15 +10,14 @@ import javafx.collections.ObservableList; import javafx.collections.transformation.FilteredList; import javafx.collections.transformation.SortedList; - import org.jabref.logic.bibtex.comparator.EntryComparator; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - -import com.tobiasdiez.easybind.EasyBind; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/menus/FileHistoryMenuTest.java b/src/test/java/org/jabref/gui/menus/FileHistoryMenuTest.java index dc710c87a02..691dd677492 100644 --- a/src/test/java/org/jabref/gui/menus/FileHistoryMenuTest.java +++ b/src/test/java/org/jabref/gui/menus/FileHistoryMenuTest.java @@ -1,17 +1,16 @@ package org.jabref.gui.menus; -import java.nio.file.Path; - import org.jabref.gui.DialogService; import org.jabref.gui.importer.actions.OpenDatabaseAction; import org.jabref.logic.util.io.FileHistory; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.testfx.framework.junit5.ApplicationExtension; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.MockitoAnnotations.openMocks; diff --git a/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java b/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java index 12ff0ee66b4..17a285e06e4 100644 --- a/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java @@ -1,19 +1,17 @@ package org.jabref.gui.mergeentries; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - import javafx.scene.text.Text; - import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.testfx.framework.junit5.ApplicationExtension; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + @GUITest @ExtendWith(ApplicationExtension.class) class DiffHighlightingTest { diff --git a/src/test/java/org/jabref/gui/mergeentries/FieldRowViewModelTest.java b/src/test/java/org/jabref/gui/mergeentries/FieldRowViewModelTest.java index 9aa33730571..896a91813b2 100644 --- a/src/test/java/org/jabref/gui/mergeentries/FieldRowViewModelTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/FieldRowViewModelTest.java @@ -1,7 +1,5 @@ package org.jabref.gui.mergeentries; -import java.util.Optional; - import org.jabref.gui.mergeentries.newmergedialog.FieldRowViewModel; import org.jabref.gui.mergeentries.newmergedialog.fieldsmerger.FieldMergerFactory; import org.jabref.model.entry.BibEntry; @@ -10,16 +8,14 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.BibEntryPreferences; - import org.jbibtex.ParseException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/mergeentries/GroupMergerTest.java b/src/test/java/org/jabref/gui/mergeentries/GroupMergerTest.java index 6742efb08d6..764e5f763d3 100644 --- a/src/test/java/org/jabref/gui/mergeentries/GroupMergerTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/GroupMergerTest.java @@ -1,14 +1,13 @@ package org.jabref.gui.mergeentries; -import java.util.stream.Stream; - import org.jabref.gui.mergeentries.newmergedialog.fieldsmerger.GroupMerger; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class GroupMergerTest { diff --git a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java index 12ae7212893..4886aa2ecf1 100644 --- a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java @@ -1,14 +1,13 @@ package org.jabref.gui.mergeentries; -import java.util.stream.Stream; - import org.jabref.gui.mergeentries.newmergedialog.cell.ThreeWayMergeCellViewModel; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ThreeWayMergeCellViewModelTest { diff --git a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeViewModelTest.java b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeViewModelTest.java index d408507a180..611fa088e8a 100644 --- a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeViewModelTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeViewModelTest.java @@ -1,21 +1,16 @@ package org.jabref.gui.mergeentries; -import java.util.HashSet; -import java.util.List; - +import com.google.common.collect.Comparators; import org.jabref.gui.mergeentries.newmergedialog.ThreeWayMergeViewModel; import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldFactory; -import org.jabref.model.entry.field.InternalField; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.types.StandardEntryType; - -import com.google.common.collect.Comparators; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.HashSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/preferences/journals/AbbreviationViewModelTest.java b/src/test/java/org/jabref/gui/preferences/journals/AbbreviationViewModelTest.java index a0bedd594ae..01b166628c2 100644 --- a/src/test/java/org/jabref/gui/preferences/journals/AbbreviationViewModelTest.java +++ b/src/test/java/org/jabref/gui/preferences/journals/AbbreviationViewModelTest.java @@ -1,13 +1,12 @@ package org.jabref.gui.preferences.journals; -import java.util.stream.Stream; - import org.jabref.logic.journals.Abbreviation; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java b/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java index a389d7c5007..517d42064fc 100644 --- a/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java +++ b/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java @@ -1,18 +1,7 @@ package org.jabref.gui.preferences.journals; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.DialogService; import org.jabref.gui.util.CurrentThreadTaskExecutor; import org.jabref.gui.util.TaskExecutor; @@ -20,22 +9,26 @@ import org.jabref.logic.journals.JournalAbbreviationLoader; import org.jabref.logic.journals.JournalAbbreviationPreferences; import org.jabref.logic.journals.JournalAbbreviationRepository; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; class JournalAbbreviationsViewModelTabTest { diff --git a/src/test/java/org/jabref/gui/preferences/keybindings/KeyBindingViewModelTest.java b/src/test/java/org/jabref/gui/preferences/keybindings/KeyBindingViewModelTest.java index af1ea2449a9..138a6db2f7c 100644 --- a/src/test/java/org/jabref/gui/preferences/keybindings/KeyBindingViewModelTest.java +++ b/src/test/java/org/jabref/gui/preferences/keybindings/KeyBindingViewModelTest.java @@ -1,17 +1,15 @@ package org.jabref.gui.preferences.keybindings; -import java.util.Optional; - import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; - import org.jabref.gui.DialogService; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/preview/CopyCitationActionTest.java b/src/test/java/org/jabref/gui/preview/CopyCitationActionTest.java index 8167d45c889..72f163135cc 100644 --- a/src/test/java/org/jabref/gui/preview/CopyCitationActionTest.java +++ b/src/test/java/org/jabref/gui/preview/CopyCitationActionTest.java @@ -1,13 +1,11 @@ package org.jabref.gui.preview; -import java.util.Arrays; - import javafx.scene.input.ClipboardContent; - import org.jabref.logic.util.OS; - import org.junit.jupiter.api.Test; +import java.util.Arrays; + import static org.junit.jupiter.api.Assertions.assertEquals; class CopyCitationActionTest { diff --git a/src/test/java/org/jabref/gui/push/PushToEmacsTest.java b/src/test/java/org/jabref/gui/push/PushToEmacsTest.java index a9d9ba0919a..3aae767d737 100644 --- a/src/test/java/org/jabref/gui/push/PushToEmacsTest.java +++ b/src/test/java/org/jabref/gui/push/PushToEmacsTest.java @@ -1,22 +1,20 @@ package org.jabref.gui.push; -import java.util.Map; - import javafx.beans.property.SimpleMapProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableMap; - import org.jabref.gui.DialogService; import org.jabref.logic.util.OS; import org.jabref.preferences.ExternalApplicationsPreferences; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.PushToApplicationPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Map; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java b/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java index e4f516a2081..4662fc5248f 100644 --- a/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java +++ b/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java @@ -1,23 +1,21 @@ package org.jabref.gui.search; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.stage.Stage; - import org.jabref.gui.search.rules.describer.ContainsAndRegexBasedSearchRuleDescriber; import org.jabref.gui.util.TooltipTextUtil; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; +import java.util.EnumSet; +import java.util.List; + @GUITest @ExtendWith(ApplicationExtension.class) class ContainsAndRegexBasedSearchRuleDescriberTest { diff --git a/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java b/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java index 390c9c81505..68dae2315ea 100644 --- a/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java +++ b/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java @@ -1,18 +1,16 @@ package org.jabref.gui.search; -import java.util.List; - import javafx.stage.Stage; - import org.jabref.gui.StateManager; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; +import java.util.List; + @GUITest @ExtendWith(ApplicationExtension.class) public class GetLastSearchHistoryTest { diff --git a/src/test/java/org/jabref/gui/search/GlobalSearchBarTest.java b/src/test/java/org/jabref/gui/search/GlobalSearchBarTest.java index a6578c7c4f3..afe1a4c1f87 100644 --- a/src/test/java/org/jabref/gui/search/GlobalSearchBarTest.java +++ b/src/test/java/org/jabref/gui/search/GlobalSearchBarTest.java @@ -1,13 +1,9 @@ package org.jabref.gui.search; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.Scene; import javafx.scene.control.TextInputControl; import javafx.scene.layout.HBox; import javafx.stage.Stage; - import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.StateManager; @@ -18,7 +14,6 @@ import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SearchPreferences; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Answers; @@ -26,6 +21,9 @@ import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; +import java.util.EnumSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java b/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java index 9a2364a054b..593fd7a9bcd 100644 --- a/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java +++ b/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java @@ -1,25 +1,23 @@ package org.jabref.gui.search; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.stage.Stage; - import org.jabref.gui.search.rules.describer.GrammarBasedSearchRuleDescriber; import org.jabref.gui.util.TooltipTextUtil; import org.jabref.model.search.rules.GrammarBasedSearchRule; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; import org.jabref.testutils.category.GUITest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertTrue; @GUITest diff --git a/src/test/java/org/jabref/gui/search/TextFlowEqualityHelper.java b/src/test/java/org/jabref/gui/search/TextFlowEqualityHelper.java index 15246db4681..a9db5f53417 100644 --- a/src/test/java/org/jabref/gui/search/TextFlowEqualityHelper.java +++ b/src/test/java/org/jabref/gui/search/TextFlowEqualityHelper.java @@ -1,12 +1,11 @@ package org.jabref.gui.search; -import java.util.List; - import javafx.scene.text.Text; import javafx.scene.text.TextFlow; - import org.junit.jupiter.api.Assertions; +import java.util.List; + public class TextFlowEqualityHelper { public static void assertEquals(List expectedTexts, TextFlow description) { diff --git a/src/test/java/org/jabref/gui/sidepane/SidePaneViewModelTest.java b/src/test/java/org/jabref/gui/sidepane/SidePaneViewModelTest.java index 14cdea8f9a4..e09fb185c4a 100644 --- a/src/test/java/org/jabref/gui/sidepane/SidePaneViewModelTest.java +++ b/src/test/java/org/jabref/gui/sidepane/SidePaneViewModelTest.java @@ -1,14 +1,7 @@ package org.jabref.gui.sidepane; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; - -import javax.swing.undo.UndoManager; - import javafx.collections.FXCollections; import javafx.collections.ObservableList; - import org.jabref.gui.DialogService; import org.jabref.gui.LibraryTabContainer; import org.jabref.gui.StateManager; @@ -20,12 +13,16 @@ import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.PreferencesService; import org.jabref.preferences.SidePanePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.testfx.framework.junit5.ApplicationExtension; +import javax.swing.undo.UndoManager; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/slr/ManageStudyDefinitionViewModelTest.java b/src/test/java/org/jabref/gui/slr/ManageStudyDefinitionViewModelTest.java index 46afa29c4e8..92810e61717 100644 --- a/src/test/java/org/jabref/gui/slr/ManageStudyDefinitionViewModelTest.java +++ b/src/test/java/org/jabref/gui/slr/ManageStudyDefinitionViewModelTest.java @@ -1,19 +1,18 @@ package org.jabref.gui.slr; -import java.nio.file.Path; -import java.util.List; - import org.jabref.gui.DialogService; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.model.study.Study; import org.jabref.model.study.StudyDatabase; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.file.Path; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java b/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java index c8d4e159c54..95e312ac3a6 100644 --- a/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java +++ b/src/test/java/org/jabref/gui/theme/ThemeManagerTest.java @@ -1,22 +1,13 @@ package org.jabref.gui.theme; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; - import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.web.WebEngine; - import org.jabref.gui.util.DefaultFileUpdateMonitor; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.WorkspacePreferences; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; @@ -26,6 +17,13 @@ import org.mockito.Answers; import org.testfx.framework.junit5.ApplicationExtension; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/gui/theme/ThemeTest.java b/src/test/java/org/jabref/gui/theme/ThemeTest.java index ebabdddf6bc..6afc1b593ab 100644 --- a/src/test/java/org/jabref/gui/theme/ThemeTest.java +++ b/src/test/java/org/jabref/gui/theme/ThemeTest.java @@ -1,9 +1,9 @@ package org.jabref.gui.theme; -import java.util.Optional; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/util/ColorUtilTest.java b/src/test/java/org/jabref/gui/util/ColorUtilTest.java index 1125c02bc41..9628a454709 100644 --- a/src/test/java/org/jabref/gui/util/ColorUtilTest.java +++ b/src/test/java/org/jabref/gui/util/ColorUtilTest.java @@ -1,14 +1,13 @@ package org.jabref.gui.util; -import java.util.stream.Stream; - import javafx.scene.paint.Color; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ColorUtilTest { diff --git a/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java b/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java index 3376ab88bbb..45c4501e375 100644 --- a/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java +++ b/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java @@ -1,18 +1,16 @@ package org.jabref.gui.util; -import java.nio.file.Path; -import java.util.Optional; -import java.util.stream.Collectors; - import javafx.stage.FileChooser; - import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.FileType; import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.nio.file.Path; +import java.util.Optional; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; class FileDialogConfigurationTest { diff --git a/src/test/java/org/jabref/gui/util/OpenConsoleActionTest.java b/src/test/java/org/jabref/gui/util/OpenConsoleActionTest.java index 5ec37c2ee0e..8419d5ca029 100644 --- a/src/test/java/org/jabref/gui/util/OpenConsoleActionTest.java +++ b/src/test/java/org/jabref/gui/util/OpenConsoleActionTest.java @@ -1,20 +1,15 @@ package org.jabref.gui.util; -import java.util.Optional; - import org.jabref.gui.OpenConsoleAction; import org.jabref.gui.StateManager; import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import java.util.Optional; + +import static org.mockito.Mockito.*; public class OpenConsoleActionTest { diff --git a/src/test/java/org/jabref/gui/util/RecursiveTreeItemTest.java b/src/test/java/org/jabref/gui/util/RecursiveTreeItemTest.java index 4bd653a7327..e788c422c25 100644 --- a/src/test/java/org/jabref/gui/util/RecursiveTreeItemTest.java +++ b/src/test/java/org/jabref/gui/util/RecursiveTreeItemTest.java @@ -1,19 +1,17 @@ package org.jabref.gui.util; -import java.util.Collections; -import java.util.function.Predicate; -import java.util.stream.Collectors; - import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.control.TreeItem; - import org.jabref.model.TreeNode; import org.jabref.model.TreeNodeTestData; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.function.Predicate; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; class RecursiveTreeItemTest { diff --git a/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java b/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java index 240f4c9dc74..2bc813ed4e0 100644 --- a/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java +++ b/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java @@ -1,14 +1,12 @@ package org.jabref.gui.util; -import java.util.ArrayList; -import java.util.List; - import javafx.scene.text.Text; - import org.jabref.gui.search.TextFlowEqualityHelper; - import org.junit.jupiter.api.Test; +import java.util.ArrayList; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/gui/util/comparator/RankingFieldComparatorTest.java b/src/test/java/org/jabref/gui/util/comparator/RankingFieldComparatorTest.java index 2ac2d37f539..667fdb15cc0 100644 --- a/src/test/java/org/jabref/gui/util/comparator/RankingFieldComparatorTest.java +++ b/src/test/java/org/jabref/gui/util/comparator/RankingFieldComparatorTest.java @@ -1,13 +1,12 @@ package org.jabref.gui.util.comparator; -import java.util.Optional; - import org.jabref.gui.specialfields.SpecialFieldValueViewModel; import org.jabref.model.entry.field.SpecialFieldValue; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class RankingFieldComparatorTest { diff --git a/src/test/java/org/jabref/gui/util/comparator/SpecialFieldComparatorTest.java b/src/test/java/org/jabref/gui/util/comparator/SpecialFieldComparatorTest.java index b62731b7b38..9df846596f4 100644 --- a/src/test/java/org/jabref/gui/util/comparator/SpecialFieldComparatorTest.java +++ b/src/test/java/org/jabref/gui/util/comparator/SpecialFieldComparatorTest.java @@ -1,13 +1,12 @@ package org.jabref.gui.util.comparator; -import java.util.Optional; - import org.jabref.gui.specialfields.SpecialFieldValueViewModel; import org.jabref.model.entry.field.SpecialFieldValue; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class SpecialFieldComparatorTest { diff --git a/src/test/java/org/jabref/http/server/LibrariesResourceTest.java b/src/test/java/org/jabref/http/server/LibrariesResourceTest.java index 6cd180cb81f..8c3ce85555c 100644 --- a/src/test/java/org/jabref/http/server/LibrariesResourceTest.java +++ b/src/test/java/org/jabref/http/server/LibrariesResourceTest.java @@ -1,12 +1,12 @@ package org.jabref.http.server; -import java.util.EnumSet; -import java.util.stream.Collectors; - import jakarta.ws.rs.core.Application; import org.glassfish.jersey.server.ResourceConfig; import org.junit.jupiter.api.Test; +import java.util.EnumSet; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; class LibrariesResourceTest extends ServerTest { diff --git a/src/test/java/org/jabref/http/server/LibraryResourceTest.java b/src/test/java/org/jabref/http/server/LibraryResourceTest.java index 0edc9356b93..a25dbbcf896 100644 --- a/src/test/java/org/jabref/http/server/LibraryResourceTest.java +++ b/src/test/java/org/jabref/http/server/LibraryResourceTest.java @@ -1,9 +1,8 @@ package org.jabref.http.server; -import org.jabref.http.JabrefMediaType; - import jakarta.ws.rs.core.Application; import org.glassfish.jersey.server.ResourceConfig; +import org.jabref.http.JabrefMediaType; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/http/server/ServerTest.java b/src/test/java/org/jabref/http/server/ServerTest.java index 7070af24350..bb1c7a79bac 100644 --- a/src/test/java/org/jabref/http/server/ServerTest.java +++ b/src/test/java/org/jabref/http/server/ServerTest.java @@ -1,25 +1,23 @@ package org.jabref.http.server; -import java.util.EnumSet; -import java.util.List; -import java.util.stream.Collectors; - +import com.google.gson.Gson; import javafx.collections.FXCollections; - +import org.glassfish.hk2.utilities.binding.AbstractBinder; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; import org.jabref.http.dto.GsonFactory; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.preferences.BibEntryPreferences; import org.jabref.preferences.GuiPreferences; import org.jabref.preferences.PreferencesService; - -import com.google.gson.Gson; -import org.glassfish.hk2.utilities.binding.AbstractBinder; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.test.JerseyTest; import org.junit.jupiter.api.BeforeAll; import org.slf4j.bridge.SLF4JBridgeHandler; +import java.util.EnumSet; +import java.util.List; +import java.util.stream.Collectors; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/http/server/TestBibFile.java b/src/test/java/org/jabref/http/server/TestBibFile.java index 4897defde32..64a9830d05e 100644 --- a/src/test/java/org/jabref/http/server/TestBibFile.java +++ b/src/test/java/org/jabref/http/server/TestBibFile.java @@ -1,9 +1,9 @@ package org.jabref.http.server; -import java.nio.file.Path; - import org.jabref.logic.util.io.BackupFileUtil; +import java.nio.file.Path; + public enum TestBibFile { GENERAL_SERVER_TEST("src/test/resources/org/jabref/http/server/general-server-test.bib"), JABREF_AUTHORS("src/test/resources/testbib/jabref-authors.bib"); diff --git a/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java b/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java index 9fb6febf989..c8c80020fcf 100644 --- a/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java +++ b/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java @@ -1,28 +1,25 @@ package org.jabref.logic.auxparser; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; class AuxParserTest { diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java b/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java index 9b1578d6d49..b201e1547e5 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryAssert.java @@ -1,5 +1,13 @@ package org.jabref.logic.bibtex; +import org.jabref.logic.importer.ImportFormatPreferences; +import org.jabref.logic.importer.Importer; +import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.importer.fileformat.BibtexParser; +import org.jabref.model.entry.BibEntry; +import org.junit.jupiter.api.Assertions; +import org.mockito.Answers; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -11,15 +19,6 @@ import java.util.Collections; import java.util.List; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.importer.fileformat.BibtexParser; -import org.jabref.model.entry.BibEntry; - -import org.junit.jupiter.api.Assertions; -import org.mockito.Answers; - import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java index 4ae2e00534a..2e3316d4b43 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java @@ -1,15 +1,5 @@ package org.jabref.logic.bibtex; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.stream.Stream; - import org.jabref.logic.exporter.BibWriter; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParserResult; @@ -25,7 +15,6 @@ import org.jabref.model.entry.types.EntryTypeFactory; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -33,9 +22,17 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; class BibEntryWriterTest { diff --git a/src/test/java/org/jabref/logic/bibtex/FieldContentFormatterTest.java b/src/test/java/org/jabref/logic/bibtex/FieldContentFormatterTest.java index 9192f259caf..c521650849d 100644 --- a/src/test/java/org/jabref/logic/bibtex/FieldContentFormatterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/FieldContentFormatterTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.bibtex; -import java.util.Collections; - import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; class FieldContentFormatterTest { diff --git a/src/test/java/org/jabref/logic/bibtex/FieldWriterTest.java b/src/test/java/org/jabref/logic/bibtex/FieldWriterTest.java index 690bc18a6d7..947aedb5d9e 100644 --- a/src/test/java/org/jabref/logic/bibtex/FieldWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/FieldWriterTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.bibtex; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.logic.util.OS; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.strings.StringUtil; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java b/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java index c777ea09116..c85d84477bf 100644 --- a/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.bibtex; -import java.nio.file.Path; -import java.util.stream.Stream; - import org.jabref.model.entry.LinkedFile; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.nio.file.Path; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java index 914b703ecea..752eaf1e6a2 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/BibDatabaseDiffTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Arrays; -import java.util.Collections; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; +import java.util.Arrays; +import java.util.Collections; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java index 345552e71e5..c862e4a06d5 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java @@ -1,18 +1,14 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Collections; -import java.util.List; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibtexString; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Collections; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java index 72a2e966c31..5078cfeb4e2 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/BibtexStringComparatorTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.bibtex.comparator; import org.jabref.model.entry.BibtexString; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java index 5bf856aeeb7..58738537c3a 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/CrossRefEntryComparatorTest.java @@ -2,7 +2,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java index e41fbf0ee43..1a4833262d8 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/EntryComparatorTest.java @@ -3,7 +3,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java index 25ee8575359..20d484e164a 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/FieldComparatorTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.bibtex.comparator; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.OrFields; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FieldComparatorTest { diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/GroupDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/GroupDiffTest.java index ad0d5ab05c8..e266840c608 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/GroupDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/GroupDiffTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Optional; - import org.jabref.model.groups.AllEntriesGroup; import org.jabref.model.groups.ExplicitGroup; import org.jabref.model.groups.GroupHierarchyType; import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.metadata.MetaData; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java index 8e7e11473ce..3feccafe722 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/MetaDataDiffTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Optional; - import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.ContentSelector; import org.jabref.model.metadata.MetaData; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class MetaDataDiffTest { diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/PreambleDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/PreambleDiffTest.java index b868a4e26bf..209ba65d2a5 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/PreambleDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/PreambleDiffTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.bibtex.comparator; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java b/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java index e7ed5c967c1..0a5d4e9b0d9 100644 --- a/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java +++ b/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java @@ -1,26 +1,18 @@ package org.jabref.logic.bst; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.jabref.logic.bst.util.BstCaseChangersTest; -import org.jabref.logic.bst.util.BstNameFormatterTest; -import org.jabref.logic.bst.util.BstPurifierTest; -import org.jabref.logic.bst.util.BstTextPrefixerTest; -import org.jabref.logic.bst.util.BstWidthCalculatorTest; +import org.antlr.v4.runtime.RecognitionException; +import org.jabref.logic.bst.util.*; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - -import org.antlr.v4.runtime.RecognitionException; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; /** * For additional tests see for diff --git a/src/test/java/org/jabref/logic/bst/BstPreviewLayoutTest.java b/src/test/java/org/jabref/logic/bst/BstPreviewLayoutTest.java index c0768ff33a8..43080c085b8 100644 --- a/src/test/java/org/jabref/logic/bst/BstPreviewLayoutTest.java +++ b/src/test/java/org/jabref/logic/bst/BstPreviewLayoutTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.bst; -import java.nio.file.Path; - import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Test; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/bst/BstVMTest.java b/src/test/java/org/jabref/logic/bst/BstVMTest.java index 280b6151869..a07dc9fcbeb 100644 --- a/src/test/java/org/jabref/logic/bst/BstVMTest.java +++ b/src/test/java/org/jabref/logic/bst/BstVMTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.bst; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - +import org.antlr.v4.runtime.RecognitionException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - -import org.antlr.v4.runtime.RecognitionException; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java index 4b13078ae23..0a65878bbca 100644 --- a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java +++ b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java @@ -1,22 +1,17 @@ package org.jabref.logic.bst; +import org.antlr.v4.runtime.RecognitionException; +import org.antlr.v4.runtime.tree.ParseTree; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.types.StandardEntryType; +import org.junit.jupiter.api.Test; + import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.types.StandardEntryType; - -import org.antlr.v4.runtime.RecognitionException; -import org.antlr.v4.runtime.tree.ParseTree; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; class BstVMVisitorTest { diff --git a/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java b/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java index bfe10c4d693..d9fee375407 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.bst.util; -import java.util.stream.Stream; - import org.jabref.logic.bst.util.BstCaseChanger.FormatMode; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class BstCaseChangersTest { diff --git a/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java b/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java index 1552aa1d7b6..4af8af2fca6 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.bst.util; import org.jabref.model.entry.AuthorList; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java b/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java index c70a9b25e22..de10b96a02d 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.bst.util; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class BstPurifierTest { diff --git a/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java b/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java index 02c85c7dfcb..45342d76aec 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.bst.util; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java b/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java index 082a66cab24..6e34d493c03 100644 --- a/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java +++ b/src/test/java/org/jabref/logic/cleanup/BibtexBiblatexRoundtripTest.java @@ -4,7 +4,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java index 5271bd37c09..1ea5e7aec85 100644 --- a/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java +++ b/src/test/java/org/jabref/logic/cleanup/CleanupWorkerTest.java @@ -1,21 +1,7 @@ package org.jabref.logic.cleanup; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.bibtex.FileFieldWriter; -import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter; -import org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; -import org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter; +import org.jabref.logic.formatter.bibtexfields.*; import org.jabref.logic.formatter.casechanger.ProtectTermsFormatter; import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.logic.protectedterms.ProtectedTermsLoader; @@ -30,15 +16,17 @@ import org.jabref.model.metadata.MetaData; import org.jabref.preferences.CleanupPreferences; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java index 2208a000130..330010ef147 100644 --- a/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/ConvertToBiblatexCleanupTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.cleanup; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ConvertToBiblatexCleanupTest { diff --git a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java index c5a39e098dc..940d3162b15 100644 --- a/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/ConvertToBibtexCleanupTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.cleanup; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ConvertToBibtexCleanupTest { diff --git a/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java index 96b9ebc684b..46f7f41d219 100644 --- a/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.cleanup; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DoiCleanupTest { diff --git a/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java index 75702b5571a..3e0acd58fd3 100644 --- a/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.cleanup; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DoiDecodeCleanupTest { diff --git a/src/test/java/org/jabref/logic/cleanup/EprintCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/EprintCleanupTest.java index d27a98e59fa..c76fe4e6eb4 100644 --- a/src/test/java/org/jabref/logic/cleanup/EprintCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/EprintCleanupTest.java @@ -2,7 +2,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java index d4cda0dea8f..98ed52e82a7 100644 --- a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.cleanup; -import java.util.HashMap; -import java.util.Map; - import org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter; import org.jabref.logic.formatter.casechanger.UpperCaseFormatter; import org.jabref.model.entry.BibEntry; @@ -10,10 +7,12 @@ import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.HashMap; +import java.util.Map; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FieldFormatterCleanupTest { diff --git a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupsTest.java b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupsTest.java index 292e5a1c5f6..ffe5fb31902 100644 --- a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupsTest.java +++ b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupsTest.java @@ -1,29 +1,18 @@ package org.jabref.logic.cleanup; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.formatter.IdentityFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeAmpersandsFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeDollarSignFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter; -import org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; +import org.jabref.logic.formatter.bibtexfields.*; import org.jabref.logic.formatter.casechanger.LowerCaseFormatter; import org.jabref.logic.layout.format.ReplaceUnicodeLigaturesFormatter; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.*; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FieldFormatterCleanupsTest { diff --git a/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java index 0848b7be2cf..5bdeeeab9f8 100644 --- a/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/ISSNCleanupTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.cleanup; -import java.util.Optional; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.CleanupPreferences; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java index 9b2d1a3648a..3c747a5fe82 100644 --- a/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/MoveFilesCleanupTest.java @@ -1,13 +1,5 @@ package org.jabref.logic.cleanup; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.model.FieldChange; import org.jabref.model.database.BibDatabase; @@ -17,14 +9,19 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java index 5718b46791e..ead99bcacb2 100644 --- a/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/RenamePdfCleanupTest.java @@ -1,11 +1,5 @@ package org.jabref.logic.cleanup; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Optional; - import org.jabref.logic.bibtex.FileFieldWriter; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; @@ -14,11 +8,16 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -48,7 +47,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 + // correctly cleanup = new RenamePdfCleanup(false, context, filePreferences); } diff --git a/src/test/java/org/jabref/logic/cleanup/TimeStampToCreationDateTest.java b/src/test/java/org/jabref/logic/cleanup/TimeStampToCreationDateTest.java index 115022f2883..515a708c4df 100644 --- a/src/test/java/org/jabref/logic/cleanup/TimeStampToCreationDateTest.java +++ b/src/test/java/org/jabref/logic/cleanup/TimeStampToCreationDateTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.cleanup; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.logic.importer.ParserResult; import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class TimeStampToCreationDateTest { diff --git a/src/test/java/org/jabref/logic/cleanup/TimeStampToModificationDateTest.java b/src/test/java/org/jabref/logic/cleanup/TimeStampToModificationDateTest.java index eaebb74cd37..1bf99170f7f 100644 --- a/src/test/java/org/jabref/logic/cleanup/TimeStampToModificationDateTest.java +++ b/src/test/java/org/jabref/logic/cleanup/TimeStampToModificationDateTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.cleanup; -import java.util.stream.Stream; - import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class TimeStampToModificationDateTest { diff --git a/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java index 61e8b46c2af..40240090675 100644 --- a/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.cleanup; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class URLCleanupTest { diff --git a/src/test/java/org/jabref/logic/crawler/CrawlerTest.java b/src/test/java/org/jabref/logic/crawler/CrawlerTest.java index 41f46e614ec..c64edd4bfbc 100644 --- a/src/test/java/org/jabref/logic/crawler/CrawlerTest.java +++ b/src/test/java/org/jabref/logic/crawler/CrawlerTest.java @@ -1,12 +1,7 @@ package org.jabref.logic.crawler; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - import javafx.collections.FXCollections; - +import org.eclipse.jgit.api.Git; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.exporter.SaveConfiguration; @@ -19,13 +14,16 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.PreferencesService; import org.jabref.testutils.category.FetcherTest; - -import org.eclipse.jgit.api.Git; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + import static org.jabref.logic.citationkeypattern.CitationKeyGenerator.DEFAULT_UNWANTED_CHARACTERS; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverterTest.java b/src/test/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverterTest.java index 65ec2b8dfc0..8fa75a73482 100644 --- a/src/test/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverterTest.java +++ b/src/test/java/org/jabref/logic/crawler/StudyCatalogToFetcherConverterTest.java @@ -1,12 +1,6 @@ package org.jabref.logic.crawler; -import java.net.URL; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Collectors; - import javafx.collections.FXCollections; - import org.jabref.logic.exporter.SaveConfiguration; import org.jabref.logic.git.SlrGitHandler; import org.jabref.logic.importer.ImportFormatPreferences; @@ -17,13 +11,17 @@ import org.jabref.model.metadata.SaveOrder; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.net.URL; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Collectors; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/crawler/StudyRepositoryTest.java b/src/test/java/org/jabref/logic/crawler/StudyRepositoryTest.java index 779aec8e71e..a78f0cc597c 100644 --- a/src/test/java/org/jabref/logic/crawler/StudyRepositoryTest.java +++ b/src/test/java/org/jabref/logic/crawler/StudyRepositoryTest.java @@ -1,15 +1,6 @@ package org.jabref.logic.crawler; -import java.io.IOException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - import javafx.collections.FXCollections; - import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; @@ -29,17 +20,21 @@ import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.LibraryPreferences; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + import static org.jabref.logic.citationkeypattern.CitationKeyGenerator.DEFAULT_UNWANTED_CHARACTERS; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/crawler/StudyYamlParserTest.java b/src/test/java/org/jabref/logic/crawler/StudyYamlParserTest.java index 61d6423a54d..f990e8cfb77 100644 --- a/src/test/java/org/jabref/logic/crawler/StudyYamlParserTest.java +++ b/src/test/java/org/jabref/logic/crawler/StudyYamlParserTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.crawler; -import java.net.URL; -import java.nio.file.Path; -import java.util.List; - import org.jabref.logic.util.io.FileUtil; import org.jabref.model.study.Study; import org.jabref.model.study.StudyDatabase; import org.jabref.model.study.StudyQuery; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.net.URL; +import java.nio.file.Path; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; class StudyYamlParserTest { diff --git a/src/test/java/org/jabref/logic/database/DatabaseMergerTest.java b/src/test/java/org/jabref/logic/database/DatabaseMergerTest.java index 229cb48835b..396e21aa148 100644 --- a/src/test/java/org/jabref/logic/database/DatabaseMergerTest.java +++ b/src/test/java/org/jabref/logic/database/DatabaseMergerTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.database; -import java.util.List; -import java.util.stream.Collectors; - import org.jabref.logic.bibtex.comparator.BibtexStringComparator; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.database.BibDatabase; @@ -16,11 +13,13 @@ import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.metadata.ContentSelector; import org.jabref.model.metadata.MetaData; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.List; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java index 88d76ccbc51..bbdfdeda359 100644 --- a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java +++ b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java @@ -1,14 +1,11 @@ package org.jabref.logic.database; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -16,9 +13,9 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; public class DuplicateCheckTest { diff --git a/src/test/java/org/jabref/logic/exporter/AtomicFileOutputStreamTest.java b/src/test/java/org/jabref/logic/exporter/AtomicFileOutputStreamTest.java index 9b72b60fa16..42cc653933d 100644 --- a/src/test/java/org/jabref/logic/exporter/AtomicFileOutputStreamTest.java +++ b/src/test/java/org/jabref/logic/exporter/AtomicFileOutputStreamTest.java @@ -1,5 +1,10 @@ package org.jabref.logic.exporter; +import com.google.common.base.Strings; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.mockito.Mockito; + import java.io.ByteArrayInputStream; import java.io.FileOutputStream; import java.io.IOException; @@ -7,11 +12,6 @@ import java.nio.file.Files; import java.nio.file.Path; -import com.google.common.base.Strings; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.mockito.Mockito; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.anyInt; diff --git a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java index 145d8bd2988..736997f6161 100644 --- a/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java +++ b/src/test/java/org/jabref/logic/exporter/BibtexDatabaseWriterTest.java @@ -1,18 +1,5 @@ package org.jabref.logic.exporter; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; @@ -51,12 +38,24 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.metadata.SaveOrder; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java index d06e969d951..2ef5635eb17 100644 --- a/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java @@ -1,23 +1,22 @@ package org.jabref.logic.exporter; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java index 56f68b33fd7..4471bdea65b 100644 --- a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java @@ -1,14 +1,5 @@ package org.jabref.logic.exporter; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; @@ -17,7 +8,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -28,6 +18,15 @@ import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java b/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java index ac7cbadf618..cd4435474b5 100644 --- a/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java @@ -1,24 +1,23 @@ package org.jabref.logic.exporter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java b/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java index 1fff14f89ff..8e213ced722 100644 --- a/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java @@ -1,13 +1,8 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import javafx.collections.FXCollections; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; import org.jabref.logic.bibtex.FieldPreferences; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fileformat.PdfEmbeddedBibFileImporter; @@ -22,9 +17,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.FilePreferences; - -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDPage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -32,9 +24,13 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/exporter/ExporterTest.java b/src/test/java/org/jabref/logic/exporter/ExporterTest.java index aec81e19f91..386c8a74619 100644 --- a/src/test/java/org/jabref/logic/exporter/ExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/ExporterTest.java @@ -1,27 +1,25 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import javafx.collections.FXCollections; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.BibEntryTypesManager; import org.jabref.model.metadata.SaveOrder; import org.jabref.preferences.PreferencesService; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java b/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java index 639410b8af3..e8d2c91b6df 100644 --- a/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java +++ b/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java @@ -1,35 +1,21 @@ package org.jabref.logic.exporter; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.paint.Color; - import org.jabref.logic.auxparser.DefaultAuxParser; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.AutomaticGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.GroupTreeNodeTest; -import org.jabref.model.groups.KeywordGroup; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.MetaData; import org.jabref.model.search.rules.SearchRules; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; class GroupSerializerTest { diff --git a/src/test/java/org/jabref/logic/exporter/HayagrivaYamlExporterTest.java b/src/test/java/org/jabref/logic/exporter/HayagrivaYamlExporterTest.java index 0b6356906e9..3521076acb0 100644 --- a/src/test/java/org/jabref/logic/exporter/HayagrivaYamlExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/HayagrivaYamlExporterTest.java @@ -1,10 +1,5 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; @@ -12,12 +7,16 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java index 6f5ebf7eb19..3afabea157f 100644 --- a/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/HtmlExportFormatTest.java @@ -1,24 +1,23 @@ package org.jabref.logic.exporter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java b/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java index 2190dd74723..6b53550caeb 100644 --- a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java +++ b/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java @@ -1,21 +1,10 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fileformat.BibtexImporter; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -24,6 +13,16 @@ import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.ElementSelectors; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.xmlunit.matchers.CompareMatcher.isSimilarTo; diff --git a/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java b/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java index 10c6dec3116..ecaecc56e41 100644 --- a/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java +++ b/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java @@ -1,12 +1,5 @@ package org.jabref.logic.exporter; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.TreeMap; -import java.util.stream.Stream; - import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanups; @@ -15,22 +8,20 @@ import org.jabref.logic.util.OS; import org.jabref.model.entry.BibEntryType; import org.jabref.model.entry.BibEntryTypeBuilder; -import org.jabref.model.entry.field.BibField; -import org.jabref.model.entry.field.FieldPriority; -import org.jabref.model.entry.field.OrFields; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.model.metadata.ContentSelector; import org.jabref.model.metadata.MetaData; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.*; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class MetaDataSerializerTest { diff --git a/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java b/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java index 70712dbe6b6..d7c258011f4 100644 --- a/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java +++ b/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java @@ -1,12 +1,5 @@ package org.jabref.logic.exporter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fileformat.BibtexImporter; @@ -15,7 +8,6 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.preferences.BibEntryPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -24,6 +16,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java index fce1c50af94..a4707bec0ac 100644 --- a/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/ModsExportFormatTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fileformat.BibtexImporter; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java index 7be464fc9a6..8f13c7c82fa 100644 --- a/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; public class MsBibExportFormatTest { diff --git a/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java b/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java index 4954358b5e9..c4a70225799 100644 --- a/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java +++ b/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java @@ -1,5 +1,17 @@ package org.jabref.logic.exporter; +import org.jabref.model.database.BibDatabaseContext; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.types.StandardEntryType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.xmlunit.builder.Input; +import org.xmlunit.diff.DefaultNodeMatcher; +import org.xmlunit.diff.ElementSelectors; +import org.xmlunit.matchers.CompareMatcher; + import java.io.FileInputStream; import java.io.IOException; import java.net.URISyntaxException; @@ -13,19 +25,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.jabref.model.database.BibDatabaseContext; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.StandardEntryType; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.xmlunit.builder.Input; -import org.xmlunit.diff.DefaultNodeMatcher; -import org.xmlunit.diff.ElementSelectors; -import org.xmlunit.matchers.CompareMatcher; - import static org.hamcrest.MatcherAssert.assertThat; public class OpenOfficeDocumentCreatorTest { diff --git a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java index a10ace12d0c..f4d943766f5 100644 --- a/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/XmpExporterTest.java @@ -1,22 +1,20 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - import javafx.collections.FXCollections; - import org.jabref.logic.xmp.XmpPreferences; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -45,7 +43,7 @@ public 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 + // fail String expected = """ @@ -86,7 +84,7 @@ public void writeMultipleEntriesInASingleFile(@TempDir Path testFolder) throws E "\n", Files.readAllLines( file)); // we are using \n to join, so we need it in the expected string as well, \r\n would - // fail + // fail String expected = """ diff --git a/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java b/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java index b7c5f317a8d..2b5f2c43ac0 100644 --- a/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java @@ -1,14 +1,12 @@ package org.jabref.logic.exporter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; +import org.apache.pdfbox.pdmodel.PDPageContentStream; +import org.apache.pdfbox.pdmodel.font.PDType1Font; +import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import org.jabref.logic.importer.ImportFormatPreferences; @@ -24,12 +22,6 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.FilePreferences; - -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDPage; -import org.apache.pdfbox.pdmodel.PDPageContentStream; -import org.apache.pdfbox.pdmodel.font.PDType1Font; -import org.apache.pdfbox.pdmodel.font.Standard14Fonts; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; @@ -38,9 +30,13 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/exporter/YamlExporterTest.java b/src/test/java/org/jabref/logic/exporter/YamlExporterTest.java index 7d461dea0e8..1453fe60d69 100644 --- a/src/test/java/org/jabref/logic/exporter/YamlExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/YamlExporterTest.java @@ -1,10 +1,5 @@ package org.jabref.logic.exporter; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseContext; @@ -12,12 +7,16 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/formatter/FormatterTest.java b/src/test/java/org/jabref/logic/formatter/FormatterTest.java index a0dfdc7064b..29888ca0532 100644 --- a/src/test/java/org/jabref/logic/formatter/FormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/FormatterTest.java @@ -1,26 +1,21 @@ package org.jabref.logic.formatter; -import java.util.Collections; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.logic.cleanup.Formatter; import org.jabref.logic.formatter.casechanger.ProtectTermsFormatter; import org.jabref.logic.formatter.minifier.TruncateFormatter; import org.jabref.logic.protectedterms.ProtectedTermsLoader; import org.jabref.logic.protectedterms.ProtectedTermsPreferences; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.Collections; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; class FormatterTest { diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatterTest.java index 8e090155464..75ff9f4e109 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/EscapeDollarSignFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.stream.Stream; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class EscapeDollarSignFormatterTest { diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java index ab63ff62457..0eb56793b05 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class HtmlToUnicodeFormatterTest { diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java index e789d2002ec..3ac0024cdef 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizePagesFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java index bc14ded0f3e..1ef5330b44b 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.formatter.bibtexfields; import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatterTest.java index 15ea8081908..b186a5d004d 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/ShortenDOIFormatterTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.formatter.bibtexfields; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java index 5d6b1638d9f..1a35e07e935 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.bibtexfields; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class UnicodeToLatexFormatterTest { 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 1c5834d04f7..d736d144bae 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java @@ -43,9 +43,9 @@ public void formatExample() { "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 {} "upper each first {NOT} {this}, Upper Each First {NOT} {this}", // multiple words in lower and upper - // case with {} + // 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 + // 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 - diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java index 5221239c149..3e21cc4c0f5 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/LowerCaseFormatterTest.java @@ -1,13 +1,13 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java index 3e56d727d8d..cee66ca2db7 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.formatter.casechanger; -import java.util.Collections; - import org.jabref.logic.protectedterms.ProtectedTermsLoader; import org.jabref.logic.protectedterms.ProtectedTermsPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java index a7adcd9e28d..8945afa930a 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/SentenceCaseFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java index 467a7cc8656..53bfa657c2d 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/TitleCaseFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatterTest.java index fef2c7433d3..b0ee81ff720 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatterTest.java @@ -1,13 +1,13 @@ package org.jabref.logic.formatter.casechanger; -import java.io.IOException; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java index 612f33627ec..0a79cf4d12f 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.casechanger; -import java.util.stream.Stream; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java b/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java index 51792942b59..1e89dfbead6 100644 --- a/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/minifier/MinifyNameListFormatterTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.formatter.minifier; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/git/GitHandlerTest.java b/src/test/java/org/jabref/logic/git/GitHandlerTest.java index 10fedd90a24..6ddb4734dd2 100644 --- a/src/test/java/org/jabref/logic/git/GitHandlerTest.java +++ b/src/test/java/org/jabref/logic/git/GitHandlerTest.java @@ -1,10 +1,5 @@ package org.jabref.logic.git; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Iterator; - import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.AnyObjectId; @@ -14,6 +9,11 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Iterator; + import static org.junit.jupiter.api.Assertions.assertEquals; class GitHandlerTest { diff --git a/src/test/java/org/jabref/logic/git/SlrGitHandlerTest.java b/src/test/java/org/jabref/logic/git/SlrGitHandlerTest.java index 262f50d48e6..c5539c5e6c3 100644 --- a/src/test/java/org/jabref/logic/git/SlrGitHandlerTest.java +++ b/src/test/java/org/jabref/logic/git/SlrGitHandlerTest.java @@ -1,11 +1,5 @@ package org.jabref.logic.git; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Map; - import org.eclipse.jgit.api.errors.GitAPIException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -13,6 +7,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; + import static org.junit.jupiter.api.Assertions.assertEquals; class SlrGitHandlerTest { diff --git a/src/test/java/org/jabref/logic/help/HelpFileTest.java b/src/test/java/org/jabref/logic/help/HelpFileTest.java index 006c0383d0e..4ada30524d3 100644 --- a/src/test/java/org/jabref/logic/help/HelpFileTest.java +++ b/src/test/java/org/jabref/logic/help/HelpFileTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.help; +import org.jabref.logic.net.URLDownload; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.Arrays; import java.util.stream.Stream; -import org.jabref.logic.net.URLDownload; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - import static org.junit.jupiter.api.Assertions.assertEquals; class HelpFileTest { diff --git a/src/test/java/org/jabref/logic/importer/AuthorListParserTest.java b/src/test/java/org/jabref/logic/importer/AuthorListParserTest.java index cc4e759c40b..96bd301c5b2 100644 --- a/src/test/java/org/jabref/logic/importer/AuthorListParserTest.java +++ b/src/test/java/org/jabref/logic/importer/AuthorListParserTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.importer; -import java.util.stream.Stream; - import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class AuthorListParserTest { diff --git a/src/test/java/org/jabref/logic/importer/BibDatabaseFilesTest.java b/src/test/java/org/jabref/logic/importer/BibDatabaseFilesTest.java index 075b2854d04..0bdea76c449 100644 --- a/src/test/java/org/jabref/logic/importer/BibDatabaseFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/BibDatabaseFilesTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; - import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.model.database.BibDatabase; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java b/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java index 9dfaa34068d..2c8838633e0 100644 --- a/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java +++ b/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer; -import java.util.Collection; - import org.jabref.logic.importer.fileformat.BibtexImporter; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collection; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java b/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java index a8aa3b7628d..6df08a294d3 100644 --- a/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java +++ b/src/test/java/org/jabref/logic/importer/FulltextFetchersTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Optional; -import java.util.Set; - import org.jabref.logic.importer.fetcher.TrustLevel; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Optional; +import java.util.Set; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/ImportDataTest.java b/src/test/java/org/jabref/logic/importer/ImportDataTest.java index 80e465e1a63..93a63ed44e2 100644 --- a/src/test/java/org/jabref/logic/importer/ImportDataTest.java +++ b/src/test/java/org/jabref/logic/importer/ImportDataTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer; +import org.junit.jupiter.api.Test; + import java.nio.file.Files; import java.nio.file.Path; -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java b/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java index 2593795bde1..6cead36a53f 100644 --- a/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java +++ b/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java @@ -1,20 +1,18 @@ package org.jabref.logic.importer; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.stream.Stream; - import javafx.collections.FXCollections; - import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/ImportFormatReaderParameterlessTest.java b/src/test/java/org/jabref/logic/importer/ImportFormatReaderParameterlessTest.java index 3febe2065ad..d29e9233da6 100644 --- a/src/test/java/org/jabref/logic/importer/ImportFormatReaderParameterlessTest.java +++ b/src/test/java/org/jabref/logic/importer/ImportFormatReaderParameterlessTest.java @@ -1,16 +1,14 @@ package org.jabref.logic.importer; -import java.nio.file.Path; - import javafx.collections.FXCollections; - import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/ImporterTest.java b/src/test/java/org/jabref/logic/importer/ImporterTest.java index 8afcb3e1994..a84a116e41e 100644 --- a/src/test/java/org/jabref/logic/importer/ImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/ImporterTest.java @@ -1,38 +1,18 @@ package org.jabref.logic.importer; -import java.io.BufferedReader; -import java.util.regex.Pattern; -import java.util.stream.Stream; - -import org.jabref.logic.importer.fileformat.BiblioscapeImporter; -import org.jabref.logic.importer.fileformat.BibtexImporter; -import org.jabref.logic.importer.fileformat.CitaviXmlImporter; -import org.jabref.logic.importer.fileformat.CopacImporter; -import org.jabref.logic.importer.fileformat.EndnoteImporter; -import org.jabref.logic.importer.fileformat.InspecImporter; -import org.jabref.logic.importer.fileformat.IsiImporter; -import org.jabref.logic.importer.fileformat.MedlineImporter; -import org.jabref.logic.importer.fileformat.MedlinePlainImporter; -import org.jabref.logic.importer.fileformat.ModsImporter; -import org.jabref.logic.importer.fileformat.MsBibImporter; -import org.jabref.logic.importer.fileformat.OvidImporter; -import org.jabref.logic.importer.fileformat.PdfContentImporter; -import org.jabref.logic.importer.fileformat.PdfXmpImporter; -import org.jabref.logic.importer.fileformat.RepecNepImporter; -import org.jabref.logic.importer.fileformat.RisImporter; -import org.jabref.logic.importer.fileformat.SilverPlatterImporter; +import org.jabref.logic.importer.fileformat.*; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; import org.mockito.Mockito; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; +import java.io.BufferedReader; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java b/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java index 5c44839e67f..276d2a45fc7 100644 --- a/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java +++ b/src/test/java/org/jabref/logic/importer/OpenDatabaseTest.java @@ -1,24 +1,23 @@ package org.jabref.logic.importer; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Optional; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.LibraryPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/ParserResultTest.java b/src/test/java/org/jabref/logic/importer/ParserResultTest.java index 4787583e113..0711a18fa58 100644 --- a/src/test/java/org/jabref/logic/importer/ParserResultTest.java +++ b/src/test/java/org/jabref/logic/importer/ParserResultTest.java @@ -1,12 +1,11 @@ package org.jabref.logic.importer; -import java.util.List; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/importer/QueryParserTest.java b/src/test/java/org/jabref/logic/importer/QueryParserTest.java index 04c93ccdd5c..d66d9d44d37 100644 --- a/src/test/java/org/jabref/logic/importer/QueryParserTest.java +++ b/src/test/java/org/jabref/logic/importer/QueryParserTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.importer; import org.jabref.logic.importer.fetcher.ComplexSearchQuery; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/importer/WebFetchersTest.java b/src/test/java/org/jabref/logic/importer/WebFetchersTest.java index 3b8949130ac..820d3549063 100644 --- a/src/test/java/org/jabref/logic/importer/WebFetchersTest.java +++ b/src/test/java/org/jabref/logic/importer/WebFetchersTest.java @@ -1,34 +1,26 @@ package org.jabref.logic.importer; -import java.util.Collection; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import org.jabref.logic.importer.fetcher.AbstractIsbnFetcher; -import org.jabref.logic.importer.fetcher.CollectionOfComputerScienceBibliographiesFetcher; -import org.jabref.logic.importer.fetcher.GoogleScholar; -import org.jabref.logic.importer.fetcher.GrobidCitationFetcher; -import org.jabref.logic.importer.fetcher.GvkFetcher; -import org.jabref.logic.importer.fetcher.IssnFetcher; -import org.jabref.logic.importer.fetcher.JstorFetcher; -import org.jabref.logic.importer.fetcher.MrDLibFetcher; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfoList; +import io.github.classgraph.ScanResult; +import org.jabref.logic.importer.fetcher.*; import org.jabref.logic.importer.fetcher.isbntobibtex.DoiToBibtexConverterComIsbnFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.EbookDeIsbnFetcher; import org.jabref.logic.importer.fetcher.isbntobibtex.OpenLibraryIsbnFetcher; import org.jabref.model.database.BibDatabaseContext; import org.jabref.preferences.FilePreferences; - -import io.github.classgraph.ClassGraph; -import io.github.classgraph.ClassInfoList; -import io.github.classgraph.ScanResult; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collection; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java index 7e62435b110..70e94c8dfbf 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java @@ -1,24 +1,23 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.List; -import java.util.Optional; - +import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; +import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.fileformat.ACMPortalParser; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; -import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.List; +import java.util.Optional; + import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java index 798cdeaf2f3..359b2ae02d1 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACSTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java index 72ec4e01f18..0cd3b7a5af6 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AbstractIsbnFetcherTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ApsFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ApsFetcherTest.java index 9187a775ee2..11ab89df199 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ApsFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ApsFetcherTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.importer.fetcher; -import java.net.URL; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java index c031bbf2e8d..7290f312063 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java @@ -1,21 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.StringJoiner; -import java.util.stream.Collectors; - import javafx.collections.FXCollections; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportCleanup; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.PagedSearchBasedFetcher; -import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.importer.*; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; @@ -24,19 +10,16 @@ import org.jabref.model.entry.identifier.ArXivIdentifier; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import org.mockito.Answers; import org.mockito.Mockito; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; 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 ec37fed5e6a..3b01c61dc0d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -1,10 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; @@ -13,14 +9,14 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.paging.Page; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java b/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java index 3f261cb4c24..98852fd1e67 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java @@ -1,10 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; - import javafx.collections.FXCollections; - +import kong.unirest.json.JSONObject; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.util.BuildInfo; @@ -12,16 +9,15 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import kong.unirest.json.JSONObject; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; +import java.net.MalformedURLException; +import java.net.URISyntaxException; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java index 77d8ca1cd38..226378c6ae6 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.net.URL; -import java.util.Collections; -import java.util.List; - +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.net.URL; +import java.util.Collections; +import java.util.List; + import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java index 6924ddc5b6c..613a2cfb34d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java @@ -1,21 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcherTest.java index 60e43ca0d2f..fdfcf56a306 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesFetcherTest.java @@ -1,13 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - +import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer; @@ -16,14 +10,19 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParserTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParserTest.java index 44452723e5b..f24f1229bea 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CollectionOfComputerScienceBibliographiesParserTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.io.InputStream; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java index b15eebe4987..9436e5cd1eb 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.importer.CompositeIdFetcher; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; @@ -12,7 +9,6 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -20,6 +16,9 @@ import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Answers; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcherTest.java index f7e4a4d46f0..33c82cb2fd2 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CompositeSearchBasedFetcherTest.java @@ -1,24 +1,11 @@ package org.jabref.logic.importer.fetcher; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Stream; - import javafx.collections.FXCollections; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.logic.importer.ImportCleanup; -import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.importer.ImporterPreferences; -import org.jabref.logic.importer.SearchBasedFetcher; +import org.jabref.logic.importer.*; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -28,6 +15,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.*; +import java.util.stream.Stream; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java index 86277c7803d..b17fe5a49a4 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.Locale; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.Locale; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; 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 9d0b01b934b..a3e98730ced 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DBLPFetcherTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -10,11 +7,13 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; @@ -58,9 +57,8 @@ 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/DOABFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java index f140ea40aff..e303a18289f 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java index 09ea811c224..b0ce8d24115 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java @@ -1,21 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import kong.unirest.json.JSONObject; +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import kong.unirest.json.JSONObject; -import org.apache.http.client.utils.URIBuilder; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java index 6589a851eb1..d9435f30382 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java @@ -1,20 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java index d07cff6f670..952137c962a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java index bcb54f4df9f..e19de455f71 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DoiResolutionTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import org.jabref.logic.preferences.DOIPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java index 7ac8d4e0216..3be54a63275 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/FulltextFetcherTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; -import java.util.Set; - import org.jabref.logic.importer.FulltextFetcher; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.WebFetchers; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.Set; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java index 8331430b0b2..031b4706289 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GoogleScholarTest.java @@ -1,11 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; @@ -15,11 +9,16 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.IOException; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcherTest.java index 86742d99eb7..cfbb8599ea1 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcherTest.java @@ -1,11 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.SocketTimeoutException; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; @@ -14,13 +8,18 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java index 01d47098000..e4f5529283d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java @@ -1,9 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.net.URL; -import java.util.Collections; -import java.util.List; - +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer; @@ -12,13 +10,14 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.net.URL; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; 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 bc0eeb7db72..54201ce5922 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IEEETest.java @@ -1,12 +1,6 @@ package org.jabref.logic.importer.fetcher; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; @@ -15,11 +9,15 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java index 34724de06bd..65534a2f2fb 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/INSPIREFetcherTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java index 7be6de722b2..6a3e724d8a7 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -16,7 +7,6 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; @@ -25,11 +15,12 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URL; +import java.util.*; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java index 684e01ecc63..43e86f9ebe7 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IssnFetcherTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.BibEntryPreferences; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/JstorFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/JstorFetcherTest.java index 9568c9c5d15..34721c60e17 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/JstorFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/JstorFetcherTest.java @@ -1,12 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.net.URL; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.model.entry.BibEntry; @@ -14,11 +7,17 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.net.URL; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/LOBIDFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/LOBIDFetcherTest.java index 62a11e7b3f1..fd17c6db265 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/LOBIDFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/LOBIDFetcherTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; import org.jabref.logic.importer.SearchBasedFetcher; @@ -10,11 +7,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java b/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java index d431ba36af3..3a4b8b45fdc 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/LibraryOfCongressTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -9,10 +7,11 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.preferences.BibEntryPreferences; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java index f29e8a47b5c..10eadd5d221 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MathSciNetTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.mockito.Mockito.mock; 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 f85ea3b1571..f3f9fcc4d5d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -1,22 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; @FetcherTest public class MedlineFetcherTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java index 6277344ba65..e99c7469886 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java index f9f3550793d..2be56b94358 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.util.Version; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.preferences.MrDlibPreferences; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java b/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java index ea4ba49a777..85d0335f39d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/OpenAccessDoiTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/PagedSearchFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/PagedSearchFetcherTest.java index 43902fe9fa2..e0b854d58b0 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/PagedSearchFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/PagedSearchFetcherTest.java @@ -3,7 +3,6 @@ import org.jabref.logic.importer.PagedSearchBasedFetcher; import org.jabref.model.entry.BibEntry; import org.jabref.model.paging.Page; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java b/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java index 5c04b29d7ec..d9cf55e24c9 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.io.InputStream; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.importer.fileformat.PicaXmlParser; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ResearchGateTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ResearchGateTest.java index faeb051ec43..7561ac345ab 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ResearchGateTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ResearchGateTest.java @@ -1,10 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.List; -import java.util.Optional; - +import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -13,13 +10,15 @@ import org.jabref.model.entry.types.UnknownEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.IOException; +import java.net.URL; +import java.util.List; +import java.util.Optional; + import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java index 8d061a2e91e..b2d4f24f32b 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/RfcFetcherTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -9,12 +7,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcherTest.java index f29608716a4..806ea156b90 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ScholarArchiveFetcherTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer.fetcher; -import java.util.List; - import org.jabref.logic.importer.FetcherException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java index 33f3fbdfbbf..248ec4d40f9 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ScienceDirectTest.java @@ -1,20 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImporterPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SearchBasedFetcherCapabilityTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SearchBasedFetcherCapabilityTest.java index b38c7637c07..6f25c6df4af 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SearchBasedFetcherCapabilityTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SearchBasedFetcherCapabilityTest.java @@ -1,23 +1,20 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.StringJoiner; -import java.util.stream.Collectors; - import org.jabref.logic.importer.ImportCleanup; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.model.database.BibDatabaseMode; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.*; /** * Defines the set of capability tests that each tests a given search capability, e.g. author based search. diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SemanticScholarTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SemanticScholarTest.java index 769515c6ad6..9b2da88132c 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SemanticScholarTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SemanticScholarTest.java @@ -1,14 +1,8 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; +import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; +import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; @@ -17,13 +11,18 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - -import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; -import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; -import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java index 38e1d88575a..9475e42a4e7 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java @@ -1,11 +1,7 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; - +import kong.unirest.json.JSONObject; import org.jabref.logic.importer.ImporterPreferences; import org.jabref.logic.importer.PagedSearchBasedFetcher; import org.jabref.logic.importer.SearchBasedFetcher; @@ -13,13 +9,15 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import kong.unirest.json.JSONObject; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java index 67663cc27e6..9ddb97d63f6 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerLinkTest.java @@ -1,20 +1,18 @@ package org.jabref.logic.importer.fetcher; -import java.io.IOException; -import java.net.URL; -import java.util.Optional; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImporterPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URL; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java index afe2104b3f3..55ee48b6427 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fetcher; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java index c2365983379..63f5631d932 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ZbMATHTest.java @@ -1,20 +1,19 @@ package org.jabref.logic.importer.fetcher; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java index 964934631b5..63f1ecd780a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; @@ -10,12 +8,13 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcherTest.java index a85be5b6dca..9ef87bf0237 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/EbookDeIsbnFetcherTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; @@ -11,12 +9,13 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java index e4178fc3420..930b15dddfc 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fetcher.AbstractIsbnFetcherTest; @@ -10,11 +8,12 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java index 59b950f64fe..21ca0478e24 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java @@ -1,9 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; @@ -11,14 +7,15 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; @FetcherTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java index 15844c5c268..a224ed76c91 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java @@ -1,7 +1,5 @@ package org.jabref.logic.importer.fetcher.isbntobibtex; -import java.util.Optional; - import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; @@ -9,11 +7,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/ArXivQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/ArXivQueryTransformerTest.java index f309c955281..2016ed9c228 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/ArXivQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/ArXivQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class ArXivQueryTransformerTest extends YearRangeByFilteringQueryTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformerTest.java index 67c86f6fd25..f27176624d8 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/CiteSeerQueryTransformerTest.java @@ -1,23 +1,22 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - -import org.jabref.logic.importer.FetcherException; -import org.jabref.model.strings.StringUtil; - import kong.unirest.json.JSONObject; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import org.jabref.logic.importer.FetcherException; +import org.jabref.model.strings.StringUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class CiteSeerQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/CollectionOfComputerScienceBibliographiesQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/CollectionOfComputerScienceBibliographiesQueryTransformerTest.java index 3459b010c79..b95650319a9 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/CollectionOfComputerScienceBibliographiesQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/CollectionOfComputerScienceBibliographiesQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class CollectionOfComputerScienceBibliographiesQueryTransformerTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformerTest.java index 25a394a0313..ca517f143c4 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/DBLPQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class DBLPQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformerTest.java index 36f4b5e3c4d..50d21d2d748 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/GVKQueryTransformerTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.Disabled; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class GVKQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java index 9cdd54d44b5..d01ae0398ac 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java @@ -1,14 +1,14 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; -import java.util.stream.Stream; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class IEEEQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/InfixTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/InfixTransformerTest.java index 44961390b65..31b011cbf47 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/InfixTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/InfixTransformerTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/JstorQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/JstorQueryTransformerTest.java index 1c2d537bcf9..811006f42a3 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/JstorQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/JstorQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class JstorQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/SpringerQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/SpringerQueryTransformerTest.java index f5df27cf969..f419d5fad70 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/SpringerQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/SpringerQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class SpringerQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/SuffixTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/SuffixTransformerTest.java index ec34d209e96..964fb21e8d4 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/SuffixTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/SuffixTransformerTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearAndYearRangeByFilteringQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearAndYearRangeByFilteringQueryTransformerTest.java index 12ea61c2fcf..c8d43241cd0 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearAndYearRangeByFilteringQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearAndYearRangeByFilteringQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public abstract class YearAndYearRangeByFilteringQueryTransformerTest< diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearRangeByFilteringQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearRangeByFilteringQueryTransformerTest.java index 7d17a798b36..a243ccad29d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearRangeByFilteringQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/YearRangeByFilteringQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; public abstract class YearRangeByFilteringQueryTransformerTest diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/ZbMathQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/ZbMathQueryTransformerTest.java index 26e2f0a0705..efb4c0e22d5 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/ZbMathQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/ZbMathQueryTransformerTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.importer.fetcher.transformers; -import java.util.Optional; - import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class ZbMathQueryTransformerTest extends InfixTransformerTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java index 978d52e6e4f..5467256eb01 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java @@ -1,15 +1,6 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import org.apache.http.client.utils.URIBuilder; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ParseException; import org.jabref.logic.net.URLDownload; @@ -17,11 +8,15 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - -import org.apache.http.client.utils.URIBuilder; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.*; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java index 8b52e8b58d8..9ad9464c433 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - public class BiblioscapeImporterFilesTest { private static final String FILE_ENDING = ".txt"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java index 60fd8c22864..51433e089f1 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; - import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; public class BiblioscapeImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTypesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTypesTest.java index eb869fed427..46832915807 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTypesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTypesTest.java @@ -1,22 +1,21 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + class BiblioscapeImporterTypesTest { private static Stream types() { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java index f6e1cc3013f..0b742a3eaf6 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; @@ -17,7 +8,6 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.DummyFileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -26,9 +16,16 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; /** 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 e5240af3095..7be2db905d9 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexParserTest.java @@ -1,60 +1,26 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.StringReader; -import java.net.InetAddress; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; - import javafx.collections.FXCollections; - import org.jabref.logic.citationkeypattern.AbstractCitationKeyPattern; import org.jabref.logic.citationkeypattern.DatabaseCitationKeyPattern; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanups; import org.jabref.logic.exporter.SaveConfiguration; -import org.jabref.logic.formatter.bibtexfields.EscapeAmpersandsFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeDollarSignFormatter; -import org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter; -import org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter; -import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; +import org.jabref.logic.formatter.bibtexfields.*; import org.jabref.logic.formatter.casechanger.LowerCaseFormatter; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.OS; import org.jabref.model.database.BibDatabaseMode; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.BibEntryType; -import org.jabref.model.entry.BibtexString; import org.jabref.model.entry.Date; -import org.jabref.model.entry.Month; -import org.jabref.model.entry.field.BibField; -import org.jabref.model.entry.field.Field; -import org.jabref.model.entry.field.FieldPriority; -import org.jabref.model.entry.field.InternalField; -import org.jabref.model.entry.field.OrFields; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.field.UnknownField; +import org.jabref.model.entry.*; +import org.jabref.model.entry.field.*; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; -import org.jabref.model.groups.AllEntriesGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.RegexKeywordGroup; -import org.jabref.model.groups.TexGroup; -import org.jabref.model.groups.WordKeywordGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.SaveOrder; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; @@ -62,10 +28,13 @@ import org.junit.jupiter.params.provider.CsvSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.io.StringReader; +import java.net.InetAddress; +import java.nio.file.Path; +import java.util.*; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java index d0df8a31e89..374f0c2663b 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java @@ -1,24 +1,21 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.List; - import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.BiblatexSoftwareField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; public class CffImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java index 4f59c86b0d5..abb918da377 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - public class CitaviXmlImporterFilesTest { private static final String FILE_ENDING = ".ctv6bak"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterTest.java index ab8ddd6e1e6..164efdbde7c 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.importer.fileformat; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class CitaviXmlImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java index 967c26fb03f..c96c5ba37f0 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - public class CopacImporterFilesTest { private static final String FILE_ENDING = ".txt"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java index 3ecf3760a49..93fe2c0db12 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; public class CopacImporterTest { 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 50140d3a67b..cce92d32463 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Arrays; - import org.jabref.logic.importer.Importer; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Arrays; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java index 048d19fc450..c5e821048f4 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java @@ -1,5 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.types.StandardEntryType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; @@ -9,17 +16,7 @@ import java.util.List; import java.util.Optional; -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.StandardEntryType; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class EndnoteImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java index 07136562970..49040ce08ed 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.io.IOException; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java b/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java index 57941acf7f6..e4d3a72e74f 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ImporterTestEngine.java @@ -1,5 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.bibtex.BibEntryAssert; +import org.jabref.logic.importer.ImportException; +import org.jabref.logic.importer.Importer; +import org.jabref.logic.importer.ParserResult; +import org.jabref.model.entry.BibEntry; +import org.junit.jupiter.api.Assertions; + import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; @@ -11,14 +18,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.jabref.logic.bibtex.BibEntryAssert; -import org.jabref.logic.importer.ImportException; -import org.jabref.logic.importer.Importer; -import org.jabref.logic.importer.ParserResult; -import org.jabref.model.entry.BibEntry; - -import org.junit.jupiter.api.Assertions; - import static org.junit.jupiter.api.Assertions.assertEquals; public class ImporterTestEngine { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java index da202514ead..79f01780290 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java @@ -1,25 +1,24 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.net.URISyntaxException; -import java.util.Collections; -import java.util.List; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class InspecImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java index eac441cf7a2..0e74c404d70 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java @@ -1,14 +1,5 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Month; @@ -16,11 +7,19 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class IsiImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java index 18425acde19..633422dc071 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.entry.BibEntry; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertNotNull; public class MarcXmlParserTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java index 38509960859..ac29c118236 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - public class MedlineImporterFilesTest { private static final String FILE_ENDING = ".xml"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java index 79044243f87..7b07a7b66fe 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.importer.fileformat; import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java index e36d37d1053..b467ae7bf7c 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java @@ -1,5 +1,16 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.bibtex.BibEntryAssert; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.entry.types.StandardEntryType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -13,23 +24,7 @@ import java.util.function.Predicate; import java.util.stream.Stream; -import org.jabref.logic.bibtex.BibEntryAssert; -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.types.StandardEntryType; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.function.Executable; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; class MedlinePlainImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java index ea97a31c74c..78fd57a1581 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.io.IOException; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java index 31391298887..26452dfff26 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fileformat; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.util.List; - import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java index ca8d428267e..b6ca7d8a366 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - public class MsBibImporterFilesTest { private static final String FILE_ENDING = ".xml"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java index f6e4b10928b..15beef3dd14 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java @@ -1,5 +1,9 @@ package org.jabref.logic.importer.fileformat; +import org.jabref.logic.util.StandardFileType; +import org.jabref.model.entry.BibEntry; +import org.junit.jupiter.api.Test; + import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Path; @@ -7,11 +11,6 @@ import java.util.Collections; import java.util.List; -import org.jabref.logic.util.StandardFileType; -import org.jabref.model.entry.BibEntry; - -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java index 1212d510732..3d3501de986 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java @@ -1,27 +1,26 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java index 60437ba8b4a..0b92ca1498e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java @@ -1,13 +1,13 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.util.function.Predicate; +import java.util.stream.Stream; + class PdfContentImporterFilesTest { private static final String FILE_ENDING = ".pdf"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java index 091b6bff8af..1775b1e72b6 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class PdfContentImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java index 5c5a67d12f7..292ea1b84cb 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java @@ -1,21 +1,19 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java index 2f51699e75a..e3f77d2dc52 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java @@ -1,25 +1,22 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fetcher.GrobidPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java index d4386ace85d..43fbf1c6acc 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java @@ -1,11 +1,6 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fetcher.GrobidPreferences; import org.jabref.logic.util.StandardFileType; @@ -15,12 +10,15 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java index 24cfe845cd5..a78452b5324 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java @@ -1,22 +1,20 @@ package org.jabref.logic.importer.fileformat; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import javafx.collections.FXCollections; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java index 5ea408d392e..b0dd55de8d7 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java @@ -1,25 +1,24 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.importer.ParserResult; import org.jabref.logic.util.StandardFileType; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java index cf7e9158f79..ea7a63ea912 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.importer.fileformat; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import java.io.IOException; import java.util.function.Predicate; import java.util.stream.Stream; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - class RISImporterFilesTest { private static final String FILE_ENDING = ".ris"; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java index 7023a8ff566..6eff6fdd475 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; - import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java index 5f67e82d134..10125674a3c 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; +import java.io.IOException; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java index 5fdee2d9235..a13c5fb5d59 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.fileformat; -import java.io.IOException; -import java.util.function.Predicate; -import java.util.stream.Stream; - import org.jabref.logic.importer.Importer; import org.jabref.logic.util.StandardFileType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; +import java.util.function.Predicate; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class SilverPlatterImporterTest { diff --git a/src/test/java/org/jabref/logic/importer/util/FileFieldParserTest.java b/src/test/java/org/jabref/logic/importer/util/FileFieldParserTest.java index 169d0ac9994..df562431564 100644 --- a/src/test/java/org/jabref/logic/importer/util/FileFieldParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/FileFieldParserTest.java @@ -1,5 +1,10 @@ package org.jabref.logic.importer.util; +import org.jabref.model.entry.LinkedFile; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + import java.net.URL; import java.nio.file.Path; import java.util.ArrayList; @@ -7,12 +12,6 @@ import java.util.List; import java.util.stream.Stream; -import org.jabref.model.entry.LinkedFile; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - import static org.junit.jupiter.api.Assertions.assertEquals; class FileFieldParserTest { diff --git a/src/test/java/org/jabref/logic/importer/util/GrobidServiceTest.java b/src/test/java/org/jabref/logic/importer/util/GrobidServiceTest.java index 1017d8be098..1f834db8867 100644 --- a/src/test/java/org/jabref/logic/importer/util/GrobidServiceTest.java +++ b/src/test/java/org/jabref/logic/importer/util/GrobidServiceTest.java @@ -1,11 +1,5 @@ package org.jabref.logic.importer.util; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.fetcher.GrobidPreferences; @@ -14,15 +8,17 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; 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 9526ed1b983..03f35ad97b2 100644 --- a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java @@ -1,33 +1,23 @@ package org.jabref.logic.importer.util; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.List; - import javafx.scene.paint.Color; - import org.jabref.logic.auxparser.DefaultAuxParser; import org.jabref.logic.importer.ParseException; import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.groups.AbstractGroup; -import org.jabref.model.groups.AutomaticGroup; -import org.jabref.model.groups.AutomaticKeywordGroup; -import org.jabref.model.groups.AutomaticPersonsGroup; -import org.jabref.model.groups.ExplicitGroup; -import org.jabref.model.groups.GroupHierarchyType; -import org.jabref.model.groups.GroupTreeNode; -import org.jabref.model.groups.SearchGroup; -import org.jabref.model.groups.TexGroup; +import org.jabref.model.groups.*; import org.jabref.model.metadata.MetaData; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.model.util.FileUpdateMonitor; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/importer/util/JsonReaderTest.java b/src/test/java/org/jabref/logic/importer/util/JsonReaderTest.java index 50030b02e91..f9002280f64 100644 --- a/src/test/java/org/jabref/logic/importer/util/JsonReaderTest.java +++ b/src/test/java/org/jabref/logic/importer/util/JsonReaderTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.importer.util; -import java.io.ByteArrayInputStream; - -import org.jabref.logic.importer.ParseException; - import kong.unirest.json.JSONObject; +import org.jabref.logic.importer.ParseException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import java.io.ByteArrayInputStream; + import static org.junit.jupiter.api.Assertions.assertEquals; class JsonReaderTest { diff --git a/src/test/java/org/jabref/logic/importer/util/MathMLParserTest.java b/src/test/java/org/jabref/logic/importer/util/MathMLParserTest.java index d4b198983bf..6bd112e1503 100644 --- a/src/test/java/org/jabref/logic/importer/util/MathMLParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/MathMLParserTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.util; -import java.io.StringReader; -import java.util.stream.Stream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import java.io.StringReader; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class MathMLParserTest { diff --git a/src/test/java/org/jabref/logic/importer/util/MetaDataParserTest.java b/src/test/java/org/jabref/logic/importer/util/MetaDataParserTest.java index 76d949a812f..26834d9cc25 100644 --- a/src/test/java/org/jabref/logic/importer/util/MetaDataParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/MetaDataParserTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.importer.util; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.exporter.MetaDataSerializerTest; import org.jabref.model.entry.BibEntryTypeBuilder; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.UnknownEntryType; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class MetaDataParserTest { diff --git a/src/test/java/org/jabref/logic/importer/util/ShortDOIServiceTest.java b/src/test/java/org/jabref/logic/importer/util/ShortDOIServiceTest.java index 26ea4706030..80d4d036113 100644 --- a/src/test/java/org/jabref/logic/importer/util/ShortDOIServiceTest.java +++ b/src/test/java/org/jabref/logic/importer/util/ShortDOIServiceTest.java @@ -2,7 +2,6 @@ import org.jabref.model.entry.identifier.DOI; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/importer/util/StaxParserTest.java b/src/test/java/org/jabref/logic/importer/util/StaxParserTest.java index 96d122c9a51..a71f428ba96 100644 --- a/src/test/java/org/jabref/logic/importer/util/StaxParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/StaxParserTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.importer.util; -import java.io.StringReader; -import java.util.stream.Stream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import java.io.StringReader; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class StaxParserTest { diff --git a/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java b/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java index c2622f4dbef..cca74859d58 100644 --- a/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/AbbreviationCheckerTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.integrity; -import java.util.Collections; - import org.jabref.logic.journals.Abbreviation; import org.jabref.logic.journals.JournalAbbreviationLoader; import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/AmpersandCheckerTest.java b/src/test/java/org/jabref/logic/integrity/AmpersandCheckerTest.java index 1307426a842..e541e4ac51d 100644 --- a/src/test/java/org/jabref/logic/integrity/AmpersandCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/AmpersandCheckerTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.integrity; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class AmpersandCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/BibStringCheckerTest.java b/src/test/java/org/jabref/logic/integrity/BibStringCheckerTest.java index 08308bf1554..15162e1b43b 100644 --- a/src/test/java/org/jabref/logic/integrity/BibStringCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/BibStringCheckerTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class BibStringCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/BooktitleCheckerTest.java b/src/test/java/org/jabref/logic/integrity/BooktitleCheckerTest.java index 3b3e1517cbf..3ef4419ddf8 100644 --- a/src/test/java/org/jabref/logic/integrity/BooktitleCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/BooktitleCheckerTest.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/BracketCheckerTest.java b/src/test/java/org/jabref/logic/integrity/BracketCheckerTest.java index d49a6ac69ac..7b41c64b490 100644 --- a/src/test/java/org/jabref/logic/integrity/BracketCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/BracketCheckerTest.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/CitationKeyCheckerTest.java b/src/test/java/org/jabref/logic/integrity/CitationKeyCheckerTest.java index 11e8782f936..c53b82057df 100644 --- a/src/test/java/org/jabref/logic/integrity/CitationKeyCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/CitationKeyCheckerTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; public class CitationKeyCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java b/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java index d6f003f934c..f4150967b89 100644 --- a/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/DateCheckerTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class DateCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/DoiValidityCheckerTest.java b/src/test/java/org/jabref/logic/integrity/DoiValidityCheckerTest.java index f43bb16ec07..14061715419 100644 --- a/src/test/java/org/jabref/logic/integrity/DoiValidityCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/DoiValidityCheckerTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/EditionCheckerTest.java b/src/test/java/org/jabref/logic/integrity/EditionCheckerTest.java index 974608ff57f..6c046d63973 100644 --- a/src/test/java/org/jabref/logic/integrity/EditionCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/EditionCheckerTest.java @@ -1,17 +1,13 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.logic.l10n.Localization; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; public class EditionCheckerTest { @Test diff --git a/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java b/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java index 344751c2576..e87e7c10bd1 100644 --- a/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java @@ -1,18 +1,15 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.Collections; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; class EntryLinkCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java b/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java index bf46b8e02e6..5177193dfdc 100644 --- a/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; -import java.util.stream.Stream; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/integrity/HowPublishedCheckerTest.java b/src/test/java/org/jabref/logic/integrity/HowPublishedCheckerTest.java index cea5ae468a2..95f703b16ec 100644 --- a/src/test/java/org/jabref/logic/integrity/HowPublishedCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/HowPublishedCheckerTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/ISBNCheckerTest.java b/src/test/java/org/jabref/logic/integrity/ISBNCheckerTest.java index c93c8a24c5e..7ac081e0958 100644 --- a/src/test/java/org/jabref/logic/integrity/ISBNCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/ISBNCheckerTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.l10n.Localization; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/ISSNCheckerTest.java b/src/test/java/org/jabref/logic/integrity/ISSNCheckerTest.java index 8f3694aaebd..e7b8ff8b6bb 100644 --- a/src/test/java/org/jabref/logic/integrity/ISSNCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/ISSNCheckerTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.logic.l10n.Localization; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java index f85356bb0a3..5d5f9f9b5e5 100644 --- a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java +++ b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java @@ -1,14 +1,5 @@ package org.jabref.logic.integrity; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import java.util.stream.Stream; - import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; @@ -25,13 +16,21 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/org/jabref/logic/integrity/MonthCheckerTest.java b/src/test/java/org/jabref/logic/integrity/MonthCheckerTest.java index 44c1603bb81..e9b6fdc5996 100644 --- a/src/test/java/org/jabref/logic/integrity/MonthCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/MonthCheckerTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/NoteCheckerTest.java b/src/test/java/org/jabref/logic/integrity/NoteCheckerTest.java index ffd5781695b..3c93113a1a9 100644 --- a/src/test/java/org/jabref/logic/integrity/NoteCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/NoteCheckerTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/PagesCheckerBibtexTest.java b/src/test/java/org/jabref/logic/integrity/PagesCheckerBibtexTest.java index 04171e75cdc..38dbf8fb96c 100644 --- a/src/test/java/org/jabref/logic/integrity/PagesCheckerBibtexTest.java +++ b/src/test/java/org/jabref/logic/integrity/PagesCheckerBibtexTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java b/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java index b64fc51b437..cb3d79f4e17 100644 --- a/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/PersonNamesCheckerTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/TitleCheckerTest.java b/src/test/java/org/jabref/logic/integrity/TitleCheckerTest.java index 6ee7d90ae3b..1eb5e9b5732 100644 --- a/src/test/java/org/jabref/logic/integrity/TitleCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/TitleCheckerTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.integrity; -import java.util.Optional; -import java.util.stream.Stream; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/TypeCheckerTest.java b/src/test/java/org/jabref/logic/integrity/TypeCheckerTest.java index 83886d7ba52..07200ec1cd5 100644 --- a/src/test/java/org/jabref/logic/integrity/TypeCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/TypeCheckerTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.integrity; -import java.util.Collections; -import java.util.List; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; public class TypeCheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/UTF8CheckerTest.java b/src/test/java/org/jabref/logic/integrity/UTF8CheckerTest.java index 15867838fff..4c7d6e462db 100644 --- a/src/test/java/org/jabref/logic/integrity/UTF8CheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/UTF8CheckerTest.java @@ -1,19 +1,16 @@ package org.jabref.logic.integrity; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.junit.jupiter.api.Test; + import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class UTF8CheckerTest { diff --git a/src/test/java/org/jabref/logic/integrity/UrlCheckerTest.java b/src/test/java/org/jabref/logic/integrity/UrlCheckerTest.java index 068ffa8efd3..839d38caecd 100644 --- a/src/test/java/org/jabref/logic/integrity/UrlCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/UrlCheckerTest.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java b/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java index dcd68676def..f1b375df33a 100644 --- a/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java @@ -1,9 +1,9 @@ package org.jabref.logic.integrity; -import java.util.Optional; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java b/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java index 3237b60588a..7300ce43a21 100644 --- a/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java +++ b/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java @@ -1,15 +1,15 @@ package org.jabref.logic.journals; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + import java.io.BufferedWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Set; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import static org.junit.jupiter.api.Assertions.assertEquals; public class AbbreviationParserTest { diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationWriterTest.java b/src/test/java/org/jabref/logic/journals/AbbreviationWriterTest.java index feb8eb97665..1359f9da7b1 100644 --- a/src/test/java/org/jabref/logic/journals/AbbreviationWriterTest.java +++ b/src/test/java/org/jabref/logic/journals/AbbreviationWriterTest.java @@ -1,14 +1,14 @@ package org.jabref.logic.journals; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; @Execution(ExecutionMode.CONCURRENT) diff --git a/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java b/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java index 7f5dd314db3..a10d6176b2c 100644 --- a/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java +++ b/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java @@ -1,9 +1,5 @@ package org.jabref.logic.journals; -import java.util.Set; - -import javax.swing.undo.CompoundEdit; - import org.jabref.architecture.AllowedToUseSwing; import org.jabref.gui.journals.AbbreviationType; import org.jabref.gui.journals.UndoableAbbreviator; @@ -13,13 +9,13 @@ import org.jabref.model.entry.field.AMSField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import javax.swing.undo.CompoundEdit; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.*; @AllowedToUseSwing( "UndoableUnabbreviator and UndoableAbbreviator requires Swing Compound Edit in order test the abbreviation and unabbreviation of journal titles") diff --git a/src/test/java/org/jabref/logic/journals/JournalInformationFetcherTest.java b/src/test/java/org/jabref/logic/journals/JournalInformationFetcherTest.java index 4037587a2ef..ec1fb5b0679 100644 --- a/src/test/java/org/jabref/logic/journals/JournalInformationFetcherTest.java +++ b/src/test/java/org/jabref/logic/journals/JournalInformationFetcherTest.java @@ -1,16 +1,14 @@ package org.jabref.logic.journals; -import java.util.List; -import java.util.Optional; - import javafx.util.Pair; - import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.fetcher.JournalInformationFetcher; import org.jabref.testutils.category.FetcherTest; - import org.junit.jupiter.api.Test; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java b/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java index 0fb90a3f5bd..b199eb60419 100644 --- a/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java +++ b/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java @@ -1,13 +1,13 @@ package org.jabref.logic.l10n; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/l10n/LanguageTest.java b/src/test/java/org/jabref/logic/l10n/LanguageTest.java index f505501b0d0..9fe69653ed0 100644 --- a/src/test/java/org/jabref/logic/l10n/LanguageTest.java +++ b/src/test/java/org/jabref/logic/l10n/LanguageTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.l10n; +import org.junit.jupiter.api.Test; + import java.util.Locale; import java.util.Optional; -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java index 1405d5422a7..dd10d41d693 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationConsistencyTest.java @@ -1,5 +1,11 @@ package org.jabref.logic.l10n; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.testfx.framework.junit5.ApplicationExtension; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -8,28 +14,12 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.Set; +import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import org.testfx.framework.junit5.ApplicationExtension; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; // Need to run on JavaFX thread since we are parsing FXML files @ExtendWith(ApplicationExtension.class) diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java index b1a1e9127c2..d9e820414b3 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.l10n; -import java.util.stream.Stream; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java index 359ec8fc287..382a5423759 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationKeyTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.l10n; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class LocalizationKeyTest { diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationParser.java b/src/test/java/org/jabref/logic/l10n/LocalizationParser.java index 1a69b5a3bff..d908e45d6e3 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationParser.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationParser.java @@ -1,5 +1,11 @@ package org.jabref.logic.l10n; +import com.airhacks.afterburner.views.ViewLoader; +import javafx.fxml.FXMLLoader; +import org.mockito.Answers; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -9,25 +15,10 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.List; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import javafx.fxml.FXMLLoader; - -import com.airhacks.afterburner.views.ViewLoader; -import org.mockito.Answers; -import org.mockito.MockedStatic; -import org.mockito.Mockito; - public class LocalizationParser { public static SortedSet findMissingKeys(LocalizationBundleForTest type) throws IOException { diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationTest.java index e37af73c725..49a153b157a 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.l10n; -import java.util.Locale; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Locale; + import static org.junit.jupiter.api.Assertions.assertEquals; class LocalizationTest { diff --git a/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java b/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java index 189fccd855d..5d32b683ef4 100644 --- a/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java +++ b/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java @@ -1,17 +1,16 @@ package org.jabref.logic.layout; -import java.io.IOException; -import java.io.StringReader; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.SpecialField; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.io.StringReader; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/layout/LayoutHelperTest.java b/src/test/java/org/jabref/logic/layout/LayoutHelperTest.java index dec5ab5d781..0b10f161ef8 100644 --- a/src/test/java/org/jabref/logic/layout/LayoutHelperTest.java +++ b/src/test/java/org/jabref/logic/layout/LayoutHelperTest.java @@ -1,12 +1,11 @@ package org.jabref.logic.layout; -import java.io.IOException; -import java.io.StringReader; - import org.jabref.logic.journals.JournalAbbreviationRepository; - import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.io.StringReader; + import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/layout/LayoutTest.java b/src/test/java/org/jabref/logic/layout/LayoutTest.java index a0ab0e42d6e..42ddb9fd30b 100644 --- a/src/test/java/org/jabref/logic/layout/LayoutTest.java +++ b/src/test/java/org/jabref/logic/layout/LayoutTest.java @@ -1,12 +1,5 @@ package org.jabref.logic.layout; -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.logic.journals.JournalAbbreviationRepository; import org.jabref.logic.layout.format.NameFormatterPreferences; import org.jabref.model.entry.BibEntry; @@ -14,11 +7,17 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.entry.types.UnknownEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.File; +import java.io.IOException; +import java.io.StringReader; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java index 20b3faffda3..45a641b20c2 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java index a1131bae4d7..515385e3474 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; class AuthorAndToSemicolonReplacerTest { diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java index d0c365044b6..057c4fd3f25 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java index 9e6915f27a4..85d5d4e9213 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java index ac5836fa876..0e61b0fae86 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java index 86db64645ef..68a3bc27236 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java index e80b5d0b474..8f2d26539c8 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastCommasTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class AuthorFirstLastCommasTest { diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java index c014f2ecdcf..3cbf755f1ed 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java index 747e7373ba8..0d29badd85e 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java index 4488d426200..b31b5a4e8f1 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java index e06b8c54d9a..bccedaf8795 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java index 12bdbd132b6..c25e14495c5 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java index 802d0f99d9e..fcfa5cd2d5c 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java index 47f31efbed5..6131b8bee41 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorNatBibTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class AuthorNatBibTest { diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java index a17169aa662..f2f03007440 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorOrgSciTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class AuthorOrgSciTest { diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java index 45217120bda..382af20e853 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java b/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java index a1797532e2f..ef63b7cf16a 100644 --- a/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java +++ b/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java b/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java index 205be761f3b..b0fc60eac60 100644 --- a/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DOICheckTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DOICheckTest { diff --git a/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java b/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java index 35f2c6e00f4..11f59e017a4 100644 --- a/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DOIStripTest { diff --git a/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java index d6a1f6d39b5..20f0409b0ee 100644 --- a/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/jabref/logic/layout/format/DefaultTest.java b/src/test/java/org/jabref/logic/layout/format/DefaultTest.java index a067be0f395..338a463d15e 100644 --- a/src/test/java/org/jabref/logic/layout/format/DefaultTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DefaultTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DefaultTest { diff --git a/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java index fd215e79a90..ea2cb53df51 100644 --- a/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class EntryTypeFormatterTest { diff --git a/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java b/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java index cb03742aca0..b74bd84549f 100644 --- a/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java +++ b/src/test/java/org/jabref/logic/layout/format/FileLinkTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.layout.format; -import java.util.Collections; -import java.util.stream.Stream; - import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.Collections; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FileLinkTest { diff --git a/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java b/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java index ad513cb5782..83dc5ad3fd1 100644 --- a/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java +++ b/src/test/java/org/jabref/logic/layout/format/FirstPageTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class FirstPageTest { diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java b/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java index 82ff34ee0c0..b86751afb2c 100644 --- a/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java b/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java index e3c4ec0fa28..0753cc94572 100644 --- a/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class HTMLParagraphsTest { diff --git a/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java b/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java index bb5dbbaceff..2b3fe452746 100644 --- a/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java +++ b/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/LastPageTest.java b/src/test/java/org/jabref/logic/layout/format/LastPageTest.java index 55a0222001a..7844b231ec2 100644 --- a/src/test/java/org/jabref/logic/layout/format/LastPageTest.java +++ b/src/test/java/org/jabref/logic/layout/format/LastPageTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class LastPageTest { diff --git a/src/test/java/org/jabref/logic/layout/format/MarkdownFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/MarkdownFormatterTest.java index f0c55bdd17e..546b65e7f8e 100644 --- a/src/test/java/org/jabref/logic/layout/format/MarkdownFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/MarkdownFormatterTest.java @@ -3,9 +3,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.*; class MarkdownFormatterTest { diff --git a/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java b/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java index ca583e9f061..4c03ef3efcc 100644 --- a/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/NoSpaceBetweenAbbreviationsTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class NoSpaceBetweenAbbreviationsTest { 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 3a576b6fb69..52d8a36358b 100644 --- a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java b/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java index 83925322f72..e5981cc82bc 100644 --- a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RemoveBracketsAddCommaTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class RemoveBracketsAddCommaTest { diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java b/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java index 000cc393d32..b75878b73b8 100644 --- a/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RemoveBracketsTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java b/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java index f4750511184..d268b7ec099 100644 --- a/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RemoveTildeTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class RemoveTildeTest { diff --git a/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java b/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java index 3d1eb4ebb9b..8dcc1435d97 100644 --- a/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java b/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java index 736b173367f..43eb963c6fd 100644 --- a/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.layout.format; import org.jabref.logic.util.OS; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/layout/format/ShortMonthFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/ShortMonthFormatterTest.java index c2b6b714561..61c87fca25f 100644 --- a/src/test/java/org/jabref/logic/layout/format/ShortMonthFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ShortMonthFormatterTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.LayoutFormatter; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ShortMonthFormatterTest { diff --git a/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java b/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java index 19bd487c916..1c0591dd87c 100644 --- a/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ToLowerCaseTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java b/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java index e6c109ab547..99d9f4b4e6f 100644 --- a/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ToUpperCaseTest.java @@ -1,11 +1,11 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class ToUpperCaseTest { diff --git a/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java b/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java index 903059aa6c1..3c7cb66573e 100644 --- a/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java +++ b/src/test/java/org/jabref/logic/layout/format/WrapContentTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.layout.format; -import java.util.stream.Stream; - import org.jabref.logic.layout.ParamLayoutFormatter; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class WrapContentTest { diff --git a/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java b/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java index 4f9e63e390a..646ffe6e273 100644 --- a/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java +++ b/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java @@ -1,13 +1,13 @@ package org.jabref.logic.layout.format; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.Collections; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/org/jabref/logic/msbib/MSBibConverterTest.java b/src/test/java/org/jabref/logic/msbib/MSBibConverterTest.java index 4a75f92932a..2b62e1e5641 100644 --- a/src/test/java/org/jabref/logic/msbib/MSBibConverterTest.java +++ b/src/test/java/org/jabref/logic/msbib/MSBibConverterTest.java @@ -1,13 +1,12 @@ package org.jabref.logic.msbib; -import java.util.Optional; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; class MSBibConverterTest { diff --git a/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java b/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java index 3b09b26c7d9..243d3ab63d5 100644 --- a/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java +++ b/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.msbib; import org.jabref.model.entry.Author; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/net/URLDownloadTest.java b/src/test/java/org/jabref/logic/net/URLDownloadTest.java index 51c3bb06942..248718c1ee1 100644 --- a/src/test/java/org/jabref/logic/net/URLDownloadTest.java +++ b/src/test/java/org/jabref/logic/net/URLDownloadTest.java @@ -1,26 +1,22 @@ package org.jabref.logic.net; -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; - +import kong.unirest.UnirestException; import org.jabref.logic.importer.FetcherClientException; import org.jabref.logic.importer.FetcherServerException; import org.jabref.support.DisabledOnCIServer; import org.jabref.testutils.category.FetcherTest; - -import kong.unirest.UnirestException; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.junit.jupiter.api.Assertions.assertInstanceOf; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.*; @FetcherTest public class URLDownloadTest { diff --git a/src/test/java/org/jabref/logic/net/URLUtilTest.java b/src/test/java/org/jabref/logic/net/URLUtilTest.java index f329ba3bbd5..40614c272d9 100644 --- a/src/test/java/org/jabref/logic/net/URLUtilTest.java +++ b/src/test/java/org/jabref/logic/net/URLUtilTest.java @@ -1,12 +1,9 @@ package org.jabref.logic.net; import org.jabref.gui.fieldeditors.URLUtil; - import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; class URLUtilTest { diff --git a/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java b/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java index 714f76569f5..2911d62da54 100644 --- a/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java +++ b/src/test/java/org/jabref/logic/pdf/EntryAnnotationImporterTest.java @@ -1,19 +1,18 @@ package org.jabref.logic.pdf; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.pdf.FileAnnotation; import org.jabref.preferences.FilePreferences; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Map; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java b/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java index 3b520c87414..26c2737c805 100644 --- a/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java +++ b/src/test/java/org/jabref/logic/pdf/PdfAnnotationImporterTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.pdf; +import org.jabref.model.pdf.FileAnnotation; +import org.jabref.model.pdf.FileAnnotationType; +import org.junit.jupiter.api.Test; + import java.nio.file.Path; import java.time.LocalDateTime; import java.util.Collections; import java.util.Optional; -import org.jabref.model.pdf.FileAnnotation; -import org.jabref.model.pdf.FileAnnotationType; - -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertEquals; public class PdfAnnotationImporterTest { diff --git a/src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java b/src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java index cf538839f70..f88f0c184c6 100644 --- a/src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java +++ b/src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java @@ -1,17 +1,10 @@ package org.jabref.logic.pdf.search.indexing; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - +import org.apache.lucene.document.Document; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.preferences.FilePreferences; - -import org.apache.lucene.document.Document; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -19,6 +12,12 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/pdf/search/indexing/PdfIndexerTest.java b/src/test/java/org/jabref/logic/pdf/search/indexing/PdfIndexerTest.java index ec2c12345de..a6d4f9483d6 100644 --- a/src/test/java/org/jabref/logic/pdf/search/indexing/PdfIndexerTest.java +++ b/src/test/java/org/jabref/logic/pdf/search/indexing/PdfIndexerTest.java @@ -1,10 +1,8 @@ package org.jabref.logic.pdf.search.indexing; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.Optional; - +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.store.NIOFSDirectory; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabase; import org.jabref.model.database.BibDatabaseContext; @@ -12,15 +10,16 @@ import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.preferences.FilePreferences; - -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.store.NIOFSDirectory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Mockito; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/pdf/search/retrieval/PdfSearcherTest.java b/src/test/java/org/jabref/logic/pdf/search/retrieval/PdfSearcherTest.java index 6204c28ca34..31d6f55a505 100644 --- a/src/test/java/org/jabref/logic/pdf/search/retrieval/PdfSearcherTest.java +++ b/src/test/java/org/jabref/logic/pdf/search/retrieval/PdfSearcherTest.java @@ -1,9 +1,6 @@ package org.jabref.logic.pdf.search.retrieval; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Collections; - +import org.apache.lucene.queryparser.classic.ParseException; import org.jabref.logic.pdf.search.indexing.PdfIndexer; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabase; @@ -13,13 +10,15 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.pdf.search.PdfSearchResults; import org.jabref.preferences.FilePreferences; - -import org.apache.lucene.queryparser.classic.ParseException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.Mockito; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Collections; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; diff --git a/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java b/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java index 168571c7f92..f1872a19502 100644 --- a/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java +++ b/src/test/java/org/jabref/logic/remote/RemoteCommunicationTest.java @@ -1,16 +1,15 @@ package org.jabref.logic.remote; -import java.io.IOException; - import org.jabref.logic.remote.client.RemoteClient; import org.jabref.logic.remote.server.RemoteListenerServerManager; import org.jabref.logic.remote.server.RemoteMessageHandler; import org.jabref.support.DisabledOnCIServer; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; + import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java b/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java index a1a5aab1a72..3f6f4651be8 100644 --- a/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java +++ b/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java @@ -3,9 +3,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class RemotePreferencesTest { diff --git a/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java b/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java index 6b7fdb8928e..ebfbb9f9f91 100644 --- a/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java +++ b/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java @@ -1,27 +1,24 @@ package org.jabref.logic.remote; -import java.io.IOException; -import java.io.OutputStream; -import java.net.ServerSocket; -import java.net.Socket; -import java.nio.charset.StandardCharsets; - import org.jabref.logic.remote.client.RemoteClient; import org.jabref.logic.remote.server.RemoteListenerServerManager; import org.jabref.logic.remote.server.RemoteMessageHandler; import org.jabref.logic.util.OS; import org.jabref.support.DisabledOnCIServer; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.io.OutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.charset.StandardCharsets; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.*; @DisabledOnCIServer("Tests fails sporadically on CI server") class RemoteSetupTest { diff --git a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java index 19cc3b529c4..4ba70e03863 100644 --- a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java +++ b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.search; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; - import org.jabref.model.database.BibDatabase; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.search.rules.SearchRules; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; public class DatabaseSearcherTest { diff --git a/src/test/java/org/jabref/logic/search/SearchQueryTest.java b/src/test/java/org/jabref/logic/search/SearchQueryTest.java index 3a34d895fa7..1fc08355263 100644 --- a/src/test/java/org/jabref/logic/search/SearchQueryTest.java +++ b/src/test/java/org/jabref/logic/search/SearchQueryTest.java @@ -1,20 +1,17 @@ package org.jabref.logic.search; -import java.util.EnumSet; -import java.util.Optional; -import java.util.regex.Pattern; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.search.rules.SearchRules; import org.jabref.model.search.rules.SearchRules.SearchFlags; - import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.EnumSet; +import java.util.Optional; +import java.util.regex.Pattern; + +import static org.junit.jupiter.api.Assertions.*; public class SearchQueryTest { diff --git a/src/test/java/org/jabref/logic/shared/ConnectorTest.java b/src/test/java/org/jabref/logic/shared/ConnectorTest.java index 1e90557b3ca..cfefa728e45 100644 --- a/src/test/java/org/jabref/logic/shared/ConnectorTest.java +++ b/src/test/java/org/jabref/logic/shared/ConnectorTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.shared; -import java.sql.SQLException; - import org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException; import org.jabref.testutils.category.DatabaseTest; +import java.sql.SQLException; + /** * Stores the credentials for the test systems */ diff --git a/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java b/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java index fa8e7fc6861..903cc00ec85 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSConnectionTest.java @@ -1,12 +1,11 @@ package org.jabref.logic.shared; -import java.sql.SQLException; - import org.jabref.testutils.category.DatabaseTest; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; +import java.sql.SQLException; + import static org.junit.jupiter.api.Assertions.assertThrows; @DatabaseTest diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java index 6d6392ebf08..0f647fa14cf 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java @@ -1,16 +1,5 @@ package org.jabref.logic.shared; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - import org.jabref.logic.shared.exception.OfflineLockException; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.InternalField; @@ -18,7 +7,6 @@ import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.DatabaseTest; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -26,11 +14,12 @@ import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.*; @DatabaseTest @Execution(ExecutionMode.SAME_THREAD) diff --git a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java index 277bb0d6653..8acd3de7062 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java @@ -1,10 +1,5 @@ package org.jabref.logic.shared; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.logic.cleanup.FieldFormatterCleanup; import org.jabref.logic.cleanup.FieldFormatterCleanups; @@ -21,13 +16,17 @@ import org.jabref.model.metadata.MetaData; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.testutils.category.DatabaseTest; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java b/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java index 9b087519da1..a9bb48e0f0e 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSTypeTest.java @@ -1,11 +1,10 @@ package org.jabref.logic.shared; -import java.util.Optional; - import org.jabref.testutils.category.DatabaseTest; - import org.junit.jupiter.api.Test; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationEventListenerTest.java b/src/test/java/org/jabref/logic/shared/SynchronizationEventListenerTest.java index 2846bb6688a..ceec3b2c0e7 100644 --- a/src/test/java/org/jabref/logic/shared/SynchronizationEventListenerTest.java +++ b/src/test/java/org/jabref/logic/shared/SynchronizationEventListenerTest.java @@ -1,11 +1,10 @@ package org.jabref.logic.shared; +import com.google.common.eventbus.Subscribe; import org.jabref.logic.shared.event.SharedEntriesNotPresentEvent; import org.jabref.logic.shared.event.UpdateRefusedEvent; import org.jabref.testutils.category.DatabaseTest; -import com.google.common.eventbus.Subscribe; - @DatabaseTest public class SynchronizationEventListenerTest { diff --git a/src/test/java/org/jabref/logic/shared/SynchronizationSimulatorTest.java b/src/test/java/org/jabref/logic/shared/SynchronizationSimulatorTest.java index cd8359fde53..7ef6bdc868d 100644 --- a/src/test/java/org/jabref/logic/shared/SynchronizationSimulatorTest.java +++ b/src/test/java/org/jabref/logic/shared/SynchronizationSimulatorTest.java @@ -1,8 +1,5 @@ package org.jabref.logic.shared; -import java.sql.SQLException; -import java.util.List; - import org.jabref.logic.citationkeypattern.GlobalCitationKeyPattern; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -11,18 +8,16 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.util.DummyFileUpdateMonitor; import org.jabref.testutils.category.DatabaseTest; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.sql.SQLException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; @DatabaseTest @Execution(ExecutionMode.SAME_THREAD) diff --git a/src/test/java/org/jabref/logic/shared/security/PasswordTest.java b/src/test/java/org/jabref/logic/shared/security/PasswordTest.java index d315d0d1e88..27bdc66bcb8 100644 --- a/src/test/java/org/jabref/logic/shared/security/PasswordTest.java +++ b/src/test/java/org/jabref/logic/shared/security/PasswordTest.java @@ -1,10 +1,10 @@ package org.jabref.logic.shared.security; +import org.junit.jupiter.api.Test; + import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; -import org.junit.jupiter.api.Test; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/util/ExternalLinkCreatorTest.java b/src/test/java/org/jabref/logic/util/ExternalLinkCreatorTest.java index 736518e843d..03a8014e62c 100644 --- a/src/test/java/org/jabref/logic/util/ExternalLinkCreatorTest.java +++ b/src/test/java/org/jabref/logic/util/ExternalLinkCreatorTest.java @@ -1,15 +1,14 @@ package org.jabref.logic.util; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.field.StandardField; +import org.junit.jupiter.api.Test; + import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.util.Optional; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.field.StandardField; - -import org.junit.jupiter.api.Test; - import static org.jabref.logic.util.ExternalLinkCreator.getShortScienceSearchURL; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java b/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java index 33c83d12eb8..bccd543a0f1 100644 --- a/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java +++ b/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java @@ -1,7 +1,6 @@ package org.jabref.logic.util; import org.jabref.logic.util.io.FileNameCleaner; - import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/jabref/logic/util/UpdateFieldTest.java b/src/test/java/org/jabref/logic/util/UpdateFieldTest.java index c09921cd357..ca53f33f736 100644 --- a/src/test/java/org/jabref/logic/util/UpdateFieldTest.java +++ b/src/test/java/org/jabref/logic/util/UpdateFieldTest.java @@ -1,24 +1,19 @@ package org.jabref.logic.util; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Optional; - import org.jabref.logic.preferences.OwnerPreferences; import org.jabref.logic.preferences.TimestampPreferences; import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; public class UpdateFieldTest { diff --git a/src/test/java/org/jabref/logic/util/VersionTest.java b/src/test/java/org/jabref/logic/util/VersionTest.java index 5e04e7d234a..2da74f73781 100644 --- a/src/test/java/org/jabref/logic/util/VersionTest.java +++ b/src/test/java/org/jabref/logic/util/VersionTest.java @@ -1,19 +1,15 @@ package org.jabref.logic.util; +import org.jabref.support.DisabledOnCIServer; +import org.jabref.testutils.category.FetcherTest; +import org.junit.jupiter.api.Test; + import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; -import org.jabref.support.DisabledOnCIServer; -import org.jabref.testutils.category.FetcherTest; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class VersionTest { diff --git a/src/test/java/org/jabref/logic/util/io/BackupFileUtilTest.java b/src/test/java/org/jabref/logic/util/io/BackupFileUtilTest.java index 5ec3858977d..1b6c3325cf2 100644 --- a/src/test/java/org/jabref/logic/util/io/BackupFileUtilTest.java +++ b/src/test/java/org/jabref/logic/util/io/BackupFileUtilTest.java @@ -1,12 +1,7 @@ package org.jabref.logic.util.io; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; - import org.jabref.logic.util.BackupFileType; import org.jabref.logic.util.OS; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -14,6 +9,10 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/util/io/CitationKeyBasedFileFinderTest.java b/src/test/java/org/jabref/logic/util/io/CitationKeyBasedFileFinderTest.java index ad1d07c1fc1..f2c81df3c83 100644 --- a/src/test/java/org/jabref/logic/util/io/CitationKeyBasedFileFinderTest.java +++ b/src/test/java/org/jabref/logic/util/io/CitationKeyBasedFileFinderTest.java @@ -1,5 +1,11 @@ package org.jabref.logic.util.io; +import org.jabref.model.entry.BibEntry; +import org.jabref.model.entry.types.StandardEntryType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -7,13 +13,6 @@ import java.util.Collections; import java.util.List; -import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.types.StandardEntryType; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java b/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java index 9f66099cdda..3a051ba871b 100644 --- a/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java @@ -1,15 +1,13 @@ package org.jabref.logic.util.io; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.nio.file.Path; import java.util.Arrays; import java.util.Collections; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; class FileHistoryTest { private FileHistory history; diff --git a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java index a54aadf58b4..44103dfc825 100644 --- a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java @@ -1,17 +1,14 @@ package org.jabref.logic.util.io; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; - import org.jabref.gui.DialogService; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; public class FileNameUniquenessTest { diff --git a/src/test/java/org/jabref/logic/util/io/FileUtilTest.java b/src/test/java/org/jabref/logic/util/io/FileUtilTest.java index 28306916046..bd296728ec8 100644 --- a/src/test/java/org/jabref/logic/util/io/FileUtilTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileUtilTest.java @@ -1,30 +1,26 @@ package org.jabref.logic.util.io; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - import org.jabref.architecture.AllowedToUseLogic; import org.jabref.logic.util.OS; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; @AllowedToUseLogic("uses OS from logic package") class FileUtilTest { diff --git a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java index 527ba6413aa..93870c40547 100644 --- a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java +++ b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java @@ -1,18 +1,17 @@ package org.jabref.logic.util.io; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.List; - import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java b/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java index 174b2de8238..2b9c5366a3d 100644 --- a/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java +++ b/src/test/java/org/jabref/logic/util/strings/StringLengthComparatorTest.java @@ -1,12 +1,12 @@ package org.jabref.logic.util.strings; -import java.util.stream.Stream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class StringLengthComparatorTest { diff --git a/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java b/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java index 15d4607c66c..636d87fc1a0 100644 --- a/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java +++ b/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java @@ -1,14 +1,13 @@ package org.jabref.logic.util.strings; -import java.util.stream.Stream; - import org.jabref.model.util.ResultingStringState; - import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.stream.Stream; + import static org.junit.jupiter.api.Assertions.assertEquals; public class StringManipulatorTest { diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java b/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java index ead49aa1bcb..c97ce9b5cba 100644 --- a/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java +++ b/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java @@ -1,26 +1,25 @@ package org.jabref.logic.xmp; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - +import org.apache.xmpbox.XMPMetadata; +import org.apache.xmpbox.schema.DublinCoreSchema; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.fileformat.BibtexImporter; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.schema.DublinCoreSchemaCustom; import org.jabref.model.util.DummyFileUpdateMonitor; - -import org.apache.xmpbox.XMPMetadata; -import org.apache.xmpbox.schema.DublinCoreSchema; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Answers; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java index b42e90e9c89..34e594c26b8 100644 --- a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java +++ b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java @@ -1,8 +1,7 @@ package org.jabref.logic.xmp; -import java.nio.file.Path; -import java.util.List; - +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDPage; import org.jabref.logic.exporter.XmpExporterTest; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; @@ -10,16 +9,14 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; - -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.PDPage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import static org.jabref.logic.xmp.DublinCoreExtractor.DC_COVERAGE; -import static org.jabref.logic.xmp.DublinCoreExtractor.DC_RIGHTS; -import static org.jabref.logic.xmp.DublinCoreExtractor.DC_SOURCE; +import java.nio.file.Path; +import java.util.List; + +import static org.jabref.logic.xmp.DublinCoreExtractor.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when;