diff --git a/src/main/java/org/jabref/Globals.java b/src/main/java/org/jabref/Globals.java index f013ed3ddb6..5b36e854012 100644 --- a/src/main/java/org/jabref/Globals.java +++ b/src/main/java/org/jabref/Globals.java @@ -49,6 +49,9 @@ public class Globals { private static GlobalFocusListener focusListener; private static FileUpdateMonitor fileUpdateMonitor; + private Globals() { + } + // Key binding preferences public static KeyBindingPreferences getKeyPrefs() { if (keyPrefs == null) { diff --git a/src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java b/src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java index a4ce0f8d270..46be53da4dc 100644 --- a/src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java +++ b/src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java @@ -25,6 +25,9 @@ */ public class CrossrefFetcherEvaluator { + private CrossrefFetcherEvaluator() { + } + public static void main(String[] args) throws IOException, InterruptedException { Globals.prefs = JabRefPreferences.getInstance(); try (FileReader reader = new FileReader(args[0])) { diff --git a/src/main/java/org/jabref/cli/GenerateCharacterTable.java b/src/main/java/org/jabref/cli/GenerateCharacterTable.java index 4d51ee075ce..babd5bbca00 100644 --- a/src/main/java/org/jabref/cli/GenerateCharacterTable.java +++ b/src/main/java/org/jabref/cli/GenerateCharacterTable.java @@ -7,6 +7,9 @@ public class GenerateCharacterTable { + private GenerateCharacterTable() { + } + public static void main(String[] args) { Map characterMap = new TreeMap<>(HTMLUnicodeConversionMaps.NUMERICAL_LATEX_CONVERSION_MAP); System.out.println("\\documentclass[10pt, a4paper]{article}"); diff --git a/src/main/java/org/jabref/cli/XMPUtilMain.java b/src/main/java/org/jabref/cli/XMPUtilMain.java index f1a5e041556..366e6506365 100644 --- a/src/main/java/org/jabref/cli/XMPUtilMain.java +++ b/src/main/java/org/jabref/cli/XMPUtilMain.java @@ -28,6 +28,9 @@ public class XMPUtilMain { + private XMPUtilMain() { + } + /** * Command-line tool for working with XMP-data. * diff --git a/src/main/java/org/jabref/gui/EntryMarker.java b/src/main/java/org/jabref/gui/EntryMarker.java index 9a29b776e66..8237304aced 100644 --- a/src/main/java/org/jabref/gui/EntryMarker.java +++ b/src/main/java/org/jabref/gui/EntryMarker.java @@ -21,6 +21,8 @@ public class EntryMarker { private static final Pattern MARK_NUMBER_PATTERN = Pattern.compile(JabRefPreferences.getInstance().MARKING_WITH_NUMBER_PATTERN); + private EntryMarker() { + } /** * @param increment whether the given increment should be added to the current one. Currently never used in JabRef. Could be used to increase marking color ("Mark in specific color"). diff --git a/src/main/java/org/jabref/gui/GUIGlobals.java b/src/main/java/org/jabref/gui/GUIGlobals.java index dce93bbbaa1..566905acec5 100644 --- a/src/main/java/org/jabref/gui/GUIGlobals.java +++ b/src/main/java/org/jabref/gui/GUIGlobals.java @@ -47,6 +47,9 @@ public class GUIGlobals { public static final int MAX_BACK_HISTORY_SIZE = 10; // The maximum number of "Back" operations stored. + private GUIGlobals() { + } + public static JLabel getTableIcon(String fieldType) { JLabel label = GUIGlobals.TABLE_ICONS.get(fieldType); if (label == null) { diff --git a/src/main/java/org/jabref/gui/actions/Actions.java b/src/main/java/org/jabref/gui/actions/Actions.java index 1c573d42d6f..8f93cd76970 100644 --- a/src/main/java/org/jabref/gui/actions/Actions.java +++ b/src/main/java/org/jabref/gui/actions/Actions.java @@ -69,4 +69,7 @@ public class Actions { public static final String UNMARK_ENTRIES = "unmarkEntries"; public static final String WRITE_XMP = "writeXMP"; public static final String PRINT_PREVIEW = "printPreview"; + + private Actions() { + } } diff --git a/src/main/java/org/jabref/gui/autosaveandbackup/BackupUIManager.java b/src/main/java/org/jabref/gui/autosaveandbackup/BackupUIManager.java index 06279edbbae..3e0e3be4571 100644 --- a/src/main/java/org/jabref/gui/autosaveandbackup/BackupUIManager.java +++ b/src/main/java/org/jabref/gui/autosaveandbackup/BackupUIManager.java @@ -13,6 +13,9 @@ */ public class BackupUIManager { + private BackupUIManager() { + } + public static void showRestoreBackupDialog(JFrame frame, Path originalPath) { int answer = JOptionPane.showConfirmDialog(frame, new StringBuilder() diff --git a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypesManager.java b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypesManager.java index e84f609c676..e3bf628cadc 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypesManager.java +++ b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypesManager.java @@ -10,6 +10,9 @@ public class CustomEntryTypesManager { + private CustomEntryTypesManager() { + } + /** * Iterate through all entry types, and store those that are * custom defined to preferences. This method is called from diff --git a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java index cc87b921cef..d41224bb357 100644 --- a/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java +++ b/src/main/java/org/jabref/gui/desktop/JabRefDesktop.java @@ -52,6 +52,9 @@ public class JabRefDesktop { private static final NativeDesktop NATIVE_DESKTOP = getNativeDesktop(); private static final Pattern REMOTE_LINK_PATTERN = Pattern.compile("[a-z]+://.*"); + private JabRefDesktop() { + } + /** * Open a http/pdf/ps viewer for the given link string. */ diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditorTabRelatedArticles.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditorTabRelatedArticles.java index a29173b0adb..d8a4401d9d1 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditorTabRelatedArticles.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditorTabRelatedArticles.java @@ -117,7 +117,7 @@ private void registerHyperlinkListener() { this.addHyperlinkListener(e -> { try { if ((e.getURL() != null) && (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)) { - new JabRefDesktop().openBrowser(e.getURL().toString()); + JabRefDesktop.openBrowser(e.getURL().toString()); } } catch (IOException e1) { LOGGER.error(e1.getMessage(), e1); diff --git a/src/main/java/org/jabref/gui/entryeditor/FieldExtraComponents.java b/src/main/java/org/jabref/gui/entryeditor/FieldExtraComponents.java index 3c40faa414c..8ad1f980be1 100644 --- a/src/main/java/org/jabref/gui/entryeditor/FieldExtraComponents.java +++ b/src/main/java/org/jabref/gui/entryeditor/FieldExtraComponents.java @@ -51,6 +51,10 @@ public class FieldExtraComponents { + + private FieldExtraComponents() { + } + private static final Log LOGGER = LogFactory.getLog(FieldExtraComponents.class); private static final String ABBREVIATION_TOOLTIP_TEXT = "" diff --git a/src/main/java/org/jabref/gui/exporter/ExportAction.java b/src/main/java/org/jabref/gui/exporter/ExportAction.java index 7d55611c2df..51bfacbd1a1 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportAction.java +++ b/src/main/java/org/jabref/gui/exporter/ExportAction.java @@ -33,6 +33,9 @@ public class ExportAction { private static final Log LOGGER = LogFactory.getLog(ExportAction.class); + private ExportAction() { + } + /** * Create an AbstractAction for performing an export operation. diff --git a/src/main/java/org/jabref/gui/externalfiles/AutoSetLinks.java b/src/main/java/org/jabref/gui/externalfiles/AutoSetLinks.java index a9a003270d7..3c95eedec60 100644 --- a/src/main/java/org/jabref/gui/externalfiles/AutoSetLinks.java +++ b/src/main/java/org/jabref/gui/externalfiles/AutoSetLinks.java @@ -39,6 +39,9 @@ public class AutoSetLinks { + private AutoSetLinks() { + } + /** * Shortcut method if links are set without using the GUI * diff --git a/src/main/java/org/jabref/gui/groups/GroupDescriptions.java b/src/main/java/org/jabref/gui/groups/GroupDescriptions.java index 0918a5880a9..a894a004453 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDescriptions.java +++ b/src/main/java/org/jabref/gui/groups/GroupDescriptions.java @@ -8,6 +8,9 @@ public class GroupDescriptions { + private GroupDescriptions() { + } + public static String getDescriptionForPreview(String field, String expr, boolean caseSensitive, boolean regExp) { String header = regExp ? Localization.lang( "This group contains entries whose %0 field contains the regular expression %1", diff --git a/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java b/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java index 85bc697b0ef..248cedad68e 100644 --- a/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java +++ b/src/main/java/org/jabref/gui/groups/UndoableChangeEntriesOfGroup.java @@ -11,18 +11,20 @@ public class UndoableChangeEntriesOfGroup { - public static AbstractUndoableEdit getUndoableEdit(GroupTreeNodeViewModel node, List changes) { - boolean hasEntryChanges = false; - NamedCompound entryChangeCompound = new NamedCompound(Localization.lang("change entries of group")); - for (FieldChange fieldChange : changes) { - hasEntryChanges = true; - entryChangeCompound.addEdit(new UndoableFieldChange(fieldChange)); - } - if (hasEntryChanges) { - entryChangeCompound.end(); - return entryChangeCompound; - } + private UndoableChangeEntriesOfGroup() { + } - return null; + public static AbstractUndoableEdit getUndoableEdit(GroupTreeNodeViewModel node, List changes) { + boolean hasEntryChanges = false; + NamedCompound entryChangeCompound = new NamedCompound(Localization.lang("change entries of group")); + for(FieldChange fieldChange : changes) { + hasEntryChanges = true; + entryChangeCompound.addEdit(new UndoableFieldChange(fieldChange)); + } + if (hasEntryChanges) { + entryChangeCompound.end(); + return entryChangeCompound; + } + return null; } } diff --git a/src/main/java/org/jabref/gui/groups/WarnAssignmentSideEffects.java b/src/main/java/org/jabref/gui/groups/WarnAssignmentSideEffects.java index 749a350d135..2efb01a43f5 100644 --- a/src/main/java/org/jabref/gui/groups/WarnAssignmentSideEffects.java +++ b/src/main/java/org/jabref/gui/groups/WarnAssignmentSideEffects.java @@ -16,6 +16,9 @@ public class WarnAssignmentSideEffects { + private WarnAssignmentSideEffects() { + } + /** * Warns the user of undesired side effects of an explicit assignment/removal of entries to/from this group. * Currently there are four types of groups: AllEntriesGroup, SearchGroup - do not support explicit assignment. diff --git a/src/main/java/org/jabref/gui/importer/ImportFileFilter.java b/src/main/java/org/jabref/gui/importer/ImportFileFilter.java index f7f9d82989d..ccee0b85883 100644 --- a/src/main/java/org/jabref/gui/importer/ImportFileFilter.java +++ b/src/main/java/org/jabref/gui/importer/ImportFileFilter.java @@ -12,6 +12,9 @@ class ImportFileFilter { + private ImportFileFilter() { + } + public static FileChooser.ExtensionFilter convert(Importer format) { return new FileChooser.ExtensionFilter(format.getExtensions().getDescription(), format.getExtensions().getExtensions()); diff --git a/src/main/java/org/jabref/gui/importer/ImportFormats.java b/src/main/java/org/jabref/gui/importer/ImportFormats.java index 25aa23b7680..a9ec79746f4 100644 --- a/src/main/java/org/jabref/gui/importer/ImportFormats.java +++ b/src/main/java/org/jabref/gui/importer/ImportFormats.java @@ -32,6 +32,9 @@ public class ImportFormats { private static final Log LOGGER = LogFactory.getLog(ImportFormats.class); + private ImportFormats() { + } + /** * Create an AbstractAction for performing an Import operation. * @param frame The JabRefFrame of this JabRef instance. diff --git a/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java b/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java index a507b6bb9d1..90f489d7550 100644 --- a/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java +++ b/src/main/java/org/jabref/gui/importer/ParserResultWarningDialog.java @@ -18,6 +18,9 @@ */ public class ParserResultWarningDialog { + private ParserResultWarningDialog() { + } + /** * Shows a dialog with the warnings from an import or open of a file * diff --git a/src/main/java/org/jabref/gui/journals/JournalAbbreviationsUtil.java b/src/main/java/org/jabref/gui/journals/JournalAbbreviationsUtil.java index f8aeb67fe8f..86a284cd78f 100644 --- a/src/main/java/org/jabref/gui/journals/JournalAbbreviationsUtil.java +++ b/src/main/java/org/jabref/gui/journals/JournalAbbreviationsUtil.java @@ -10,6 +10,9 @@ public class JournalAbbreviationsUtil { + private JournalAbbreviationsUtil() { + } + public static TableModel getTableModel(Collection abbreviations) { Object[][] cells = new Object[abbreviations.size()][2]; int row = 0; diff --git a/src/main/java/org/jabref/gui/keyboard/EmacsKeyBindings.java b/src/main/java/org/jabref/gui/keyboard/EmacsKeyBindings.java index 79928ae6f08..2570d4035f9 100644 --- a/src/main/java/org/jabref/gui/keyboard/EmacsKeyBindings.java +++ b/src/main/java/org/jabref/gui/keyboard/EmacsKeyBindings.java @@ -188,6 +188,9 @@ public class EmacsKeyBindings { new JEditorPane(), }; + private EmacsKeyBindings() { + } + /** * Loads the emacs keybindings for all common JTextComponents. * diff --git a/src/main/java/org/jabref/gui/keyboard/KeyBinder.java b/src/main/java/org/jabref/gui/keyboard/KeyBinder.java index 34e3f06a720..b1a40c2a112 100644 --- a/src/main/java/org/jabref/gui/keyboard/KeyBinder.java +++ b/src/main/java/org/jabref/gui/keyboard/KeyBinder.java @@ -10,6 +10,9 @@ public class KeyBinder { + private KeyBinder() { + } + /** * Binds ESC-Key to cancel button * diff --git a/src/main/java/org/jabref/gui/maintable/MainTableNameFormatter.java b/src/main/java/org/jabref/gui/maintable/MainTableNameFormatter.java index dd5b88eec77..d04994bbdf2 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableNameFormatter.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableNameFormatter.java @@ -6,6 +6,8 @@ public class MainTableNameFormatter { + private MainTableNameFormatter(){} + /** * Format a name field for the table, according to user preferences. * diff --git a/src/main/java/org/jabref/gui/search/JTextFieldChangeListenerUtil.java b/src/main/java/org/jabref/gui/search/JTextFieldChangeListenerUtil.java index 428e4d36de7..643e2777d44 100644 --- a/src/main/java/org/jabref/gui/search/JTextFieldChangeListenerUtil.java +++ b/src/main/java/org/jabref/gui/search/JTextFieldChangeListenerUtil.java @@ -19,6 +19,9 @@ */ public class JTextFieldChangeListenerUtil { + private JTextFieldChangeListenerUtil() { + } + /** * Installs a listener to receive notification when the text of any * {@code JTextComponent} is changed. Internally, it installs a diff --git a/src/main/java/org/jabref/gui/specialfields/SpecialFieldDropDown.java b/src/main/java/org/jabref/gui/specialfields/SpecialFieldDropDown.java index 89aaf456a0f..636eb75656a 100644 --- a/src/main/java/org/jabref/gui/specialfields/SpecialFieldDropDown.java +++ b/src/main/java/org/jabref/gui/specialfields/SpecialFieldDropDown.java @@ -21,6 +21,9 @@ public class SpecialFieldDropDown { + private SpecialFieldDropDown() { + } + public static JButton generateSpecialFieldButtonWithDropDown(SpecialField field, JabRefFrame frame) { Dimension buttonDim = new Dimension(23, 23); SpecialFieldViewModel viewModel = new SpecialFieldViewModel(field); diff --git a/src/main/java/org/jabref/gui/util/BindingsHelper.java b/src/main/java/org/jabref/gui/util/BindingsHelper.java index a47f459043e..8378ba1c862 100644 --- a/src/main/java/org/jabref/gui/util/BindingsHelper.java +++ b/src/main/java/org/jabref/gui/util/BindingsHelper.java @@ -16,6 +16,10 @@ * Some methods are taken from https://bugs.openjdk.java.net/browse/JDK-8134679 */ public class BindingsHelper { + + private BindingsHelper() { + } + public static BooleanBinding any(ObservableList source, Predicate predicate) { return Bindings.createBooleanBinding(() -> source.stream().anyMatch(predicate), source); } diff --git a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtil.java b/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtil.java index 2d696b56534..7f2c56e6653 100644 --- a/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtil.java +++ b/src/main/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtil.java @@ -45,6 +45,9 @@ public class BibtexKeyPatternUtil { private static final int CHARS_OF_FIRST = 5; + private BibtexKeyPatternUtil() { + } + private static String normalize(String content) { List tokens = new ArrayList<>(); int b = 0; diff --git a/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java b/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java index bebf017169f..6afe53acbe0 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java +++ b/src/main/java/org/jabref/logic/bst/BibtexNameFormatter.java @@ -26,6 +26,9 @@ */ public class BibtexNameFormatter { + private BibtexNameFormatter() { + } + public static String formatName(String authorsNameList, int whichName, String formatString, Warn warn) { AuthorList al = AuthorList.parse(authorsNameList); diff --git a/src/main/java/org/jabref/logic/bst/BibtexPurify.java b/src/main/java/org/jabref/logic/bst/BibtexPurify.java index 09b248c2a10..04c697732e1 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexPurify.java +++ b/src/main/java/org/jabref/logic/bst/BibtexPurify.java @@ -12,6 +12,9 @@ */ public class BibtexPurify { + private BibtexPurify() { + } + /** * * @param toPurify diff --git a/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java b/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java index 2a12123fd40..59ff77d9b28 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java +++ b/src/main/java/org/jabref/logic/bst/BibtexTextPrefix.java @@ -16,6 +16,9 @@ */ public class BibtexTextPrefix { + private BibtexTextPrefix() { + } + /** * * @param numOfChars diff --git a/src/main/java/org/jabref/logic/bst/BibtexWidth.java b/src/main/java/org/jabref/logic/bst/BibtexWidth.java index a03369fcc9a..f81bae97627 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexWidth.java +++ b/src/main/java/org/jabref/logic/bst/BibtexWidth.java @@ -29,7 +29,6 @@ public class BibtexWidth { private static int[] widths; - static { if (BibtexWidth.widths == null) { BibtexWidth.widths = new int[128]; @@ -135,6 +134,9 @@ public class BibtexWidth { } } + private BibtexWidth() { + } + private static int getSpecialCharWidth(char[] c, int pos) { if ((pos + 1) < c.length) { if ((c[pos] == 'o') && (c[pos + 1] == 'e')) { diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java index 5a3ab56af38..064b947d447 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java @@ -29,6 +29,9 @@ public class CitationStyleGenerator { private static final Log LOGGER = LogFactory.getLog(CitationStyleGenerator.class); private static final BibTeXConverter BIBTEX_CONVERTER = new BibTeXConverter(); + private CitationStyleGenerator() { + } + /** * WARNING: the citation is generated using JavaScript which may take some time, better call it from outside the main Thread * Generates a Citation based on the given entry and style diff --git a/src/main/java/org/jabref/logic/cleanup/Cleanups.java b/src/main/java/org/jabref/logic/cleanup/Cleanups.java index d413ef98844..31af37bd341 100644 --- a/src/main/java/org/jabref/logic/cleanup/Cleanups.java +++ b/src/main/java/org/jabref/logic/cleanup/Cleanups.java @@ -56,6 +56,9 @@ public class Cleanups { RECOMMEND_BIBLATEX_ACTIONS = new FieldFormatterCleanups(false, recommendedBiblatexFormatters); } + private Cleanups() { + } + public static List getAvailableFormatters() { return Collections.unmodifiableList(availableFormatters); } diff --git a/src/main/java/org/jabref/logic/exporter/ExportFormats.java b/src/main/java/org/jabref/logic/exporter/ExportFormats.java index 1fc88a244e3..38c04466d76 100644 --- a/src/main/java/org/jabref/logic/exporter/ExportFormats.java +++ b/src/main/java/org/jabref/logic/exporter/ExportFormats.java @@ -15,6 +15,8 @@ public class ExportFormats { // Global variable that is used for counting output entries when exporting: public static int entryNumber; + private ExportFormats() { + } public static void initAllExports(Map customFormats, LayoutFormatterPreferences layoutPreferences, SavePreferences savePreferences) { diff --git a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java index f1d9a27a53c..c79e7b8ff13 100644 --- a/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java +++ b/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java @@ -18,6 +18,9 @@ public class MetaDataSerializer { + private MetaDataSerializer() { + } + /** * Writes all data in the format . */ @@ -90,7 +93,7 @@ private static Map> serializeCiteKeyPattern(MetaData metaDa stringyPattern.put(metaDataKey, data); } } - if (citeKeyPattern.getDefaultValue() != null && !citeKeyPattern.getDefaultValue().isEmpty()) { + if ((citeKeyPattern.getDefaultValue() != null) && !citeKeyPattern.getDefaultValue().isEmpty()) { List data = new ArrayList<>(); data.add(citeKeyPattern.getDefaultValue().get(0)); stringyPattern.put(MetaData.KEYPATTERNDEFAULT, data); diff --git a/src/main/java/org/jabref/logic/formatter/Formatters.java b/src/main/java/org/jabref/logic/formatter/Formatters.java index 9f6ac51bd35..862f97d65a9 100644 --- a/src/main/java/org/jabref/logic/formatter/Formatters.java +++ b/src/main/java/org/jabref/logic/formatter/Formatters.java @@ -63,6 +63,9 @@ public class Formatters { public static final List ALL = new ArrayList<>(); + private Formatters() { + } + public static Optional getFormatterForModifier(String modifier) { Objects.requireNonNull(modifier); Optional formatter = ALL.stream().filter(f -> f.getKey().equals(modifier)).findAny(); diff --git a/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java b/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java index 702f5053069..cfceabdce6c 100644 --- a/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java +++ b/src/main/java/org/jabref/logic/groups/DefaultGroupsFactory.java @@ -5,6 +5,9 @@ public class DefaultGroupsFactory { + private DefaultGroupsFactory() { + } + public static AllEntriesGroup getAllEntriesGroup() { AllEntriesGroup group = new AllEntriesGroup(Localization.lang("All entries")); group.setIconCode(org.jabref.gui.IconTheme.JabRefIcon.ALL_ENTRIES_GROUP_ICON.getCode()); diff --git a/src/main/java/org/jabref/logic/importer/OpenDatabase.java b/src/main/java/org/jabref/logic/importer/OpenDatabase.java index 6e037f2f666..62c22412f71 100644 --- a/src/main/java/org/jabref/logic/importer/OpenDatabase.java +++ b/src/main/java/org/jabref/logic/importer/OpenDatabase.java @@ -19,6 +19,9 @@ public class OpenDatabase { public static final Log LOGGER = LogFactory.getLog(OpenDatabase.class); + private OpenDatabase() { + } + /** * Load database (bib-file) * diff --git a/src/main/java/org/jabref/logic/importer/WebFetchers.java b/src/main/java/org/jabref/logic/importer/WebFetchers.java index 8025d16e827..5e4c3903531 100644 --- a/src/main/java/org/jabref/logic/importer/WebFetchers.java +++ b/src/main/java/org/jabref/logic/importer/WebFetchers.java @@ -24,6 +24,9 @@ public class WebFetchers { + private WebFetchers() { + } + public static Optional getIdBasedFetcherForField(String field, ImportFormatPreferences preferences) { IdBasedFetcher fetcher; switch (field) { 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 370867fe699..0c21b9c72b8 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/BibsonomyScraper.java @@ -24,6 +24,9 @@ public class BibsonomyScraper { private static final Log LOGGER = LogFactory.getLog(BibsonomyScraper.class); + private BibsonomyScraper() { + } + /** * Return a BibEntry by looking up the given url from the BibSonomy scraper. * @param entryUrl 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 1eb152fa33d..45cf9743383 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java @@ -43,6 +43,39 @@ public class CrossRef implements IdParserFetcher, EntryBasedParserFetcher, private static final RemoveBracesFormatter REMOVE_BRACES_FORMATTER = new RemoveBracesFormatter(); + public static Optional findDOI(BibEntry entry) { + Objects.requireNonNull(entry); + Optional doi = Optional.empty(); + + // title is minimum requirement + Optional title = entry.getLatexFreeField(FieldName.TITLE); + + if (!title.isPresent() || title.get().isEmpty()) { + return doi; + } + + String query = enhanceQuery(title.get(), entry); + + try { + HttpResponse response = Unirest.get(API_URL + "/works") + .queryString("query", query) + .queryString("rows", API_RESULTS) + .asJson(); + + JSONArray items = response.getBody().getObject().getJSONObject("message").getJSONArray("items"); + // quality check + Optional dataDoi = findMatchingEntry(entry, items); + + if (dataDoi.isPresent()) { + LOGGER.debug("DOI " + dataDoi.get() + " for " + title.get() + " found."); + return DOI.build(dataDoi.get()); + } + } catch (UnirestException e) { + LOGGER.warn("Unable to query CrossRef API: " + e.getMessage(), e); + } + return doi; + } + @Override public String getName() { return "Crossref"; 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 a769f6e7297..bfe04995bac 100644 --- a/src/main/java/org/jabref/logic/importer/util/GroupsParser.java +++ b/src/main/java/org/jabref/logic/importer/util/GroupsParser.java @@ -24,6 +24,9 @@ */ public class GroupsParser { + private GroupsParser() { + } + public static GroupTreeNode importGroups(List orderedData, Character keywordSeparator) throws ParseException { try { 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 f9e8b64e31a..1946871edef 100644 --- a/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java +++ b/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java @@ -25,6 +25,8 @@ public class MetaDataParser { private static final Log LOGGER = LogFactory.getLog(MetaDataParser.class); + private MetaDataParser() { + } /** * Parses the given data map and returns a new resulting {@link MetaData} instance. diff --git a/src/main/java/org/jabref/logic/integrity/FieldCheckers.java b/src/main/java/org/jabref/logic/integrity/FieldCheckers.java index f0c217a403d..f809d535cf2 100644 --- a/src/main/java/org/jabref/logic/integrity/FieldCheckers.java +++ b/src/main/java/org/jabref/logic/integrity/FieldCheckers.java @@ -12,6 +12,10 @@ import com.google.common.collect.Multimap; public class FieldCheckers { + + private FieldCheckers() { + } + static List getAll(BibDatabaseContext databaseContext, FileDirectoryPreferences fileDirectoryPreferences) { return getAllMap(databaseContext, fileDirectoryPreferences) .entries().stream() diff --git a/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java b/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java index 34009e32f2b..381f4ceb22b 100644 --- a/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java +++ b/src/main/java/org/jabref/logic/journals/AbbreviationWriter.java @@ -15,6 +15,9 @@ */ public class AbbreviationWriter { + private AbbreviationWriter() { + } + /** * This method will write the list of abbreviations to a file on the file system specified by the given path. * If the file already exists its content will be overridden, otherwise a new file will be created. diff --git a/src/main/java/org/jabref/logic/l10n/Encodings.java b/src/main/java/org/jabref/logic/l10n/Encodings.java index 1019c0bef04..76d57972745 100644 --- a/src/main/java/org/jabref/logic/l10n/Encodings.java +++ b/src/main/java/org/jabref/logic/l10n/Encodings.java @@ -17,4 +17,7 @@ public class Encodings { ENCODINGS = encodingsList.toArray(new Charset[encodingsList.size()]); ENCODINGS_DISPLAYNAMES = encodingsStringList.toArray(new String[encodingsStringList.size()]); } + + private Encodings() { + } } diff --git a/src/main/java/org/jabref/logic/l10n/Languages.java b/src/main/java/org/jabref/logic/l10n/Languages.java index 28611efdbaf..255dd5c44d0 100644 --- a/src/main/java/org/jabref/logic/l10n/Languages.java +++ b/src/main/java/org/jabref/logic/l10n/Languages.java @@ -33,6 +33,9 @@ public class Languages { LANGUAGES.put("Simplified Chinese", "zh"); } + private Languages() { + } + public static Optional convertToSupportedLocale(String language) { Objects.requireNonNull(language); diff --git a/src/main/java/org/jabref/logic/l10n/Localization.java b/src/main/java/org/jabref/logic/l10n/Localization.java index 32482b646e0..7667be55d25 100644 --- a/src/main/java/org/jabref/logic/l10n/Localization.java +++ b/src/main/java/org/jabref/logic/l10n/Localization.java @@ -20,6 +20,9 @@ public class Localization { private static ResourceBundle messages; private static ResourceBundle menuTitles; + private Localization() { + } + public static LocalizationBundle getMessages() { return new LocalizationBundle(messages); } diff --git a/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java b/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java index 1fa6b80cf78..1a40052b4f1 100644 --- a/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java +++ b/src/main/java/org/jabref/logic/layout/AbstractParamLayoutFormatter.java @@ -12,6 +12,9 @@ public abstract class AbstractParamLayoutFormatter implements ParamLayoutFormatt private static final char SEPARATOR = ','; + protected AbstractParamLayoutFormatter() { + } + /** * Parse an argument string and return the parts of the argument. The parts are * separated by commas, and escaped commas are reduced to literal commas. diff --git a/src/main/java/org/jabref/logic/logging/JabRefLogger.java b/src/main/java/org/jabref/logic/logging/JabRefLogger.java index 0ee6bfa3d4b..ee47c817439 100644 --- a/src/main/java/org/jabref/logic/logging/JabRefLogger.java +++ b/src/main/java/org/jabref/logic/logging/JabRefLogger.java @@ -11,6 +11,9 @@ public class JabRefLogger { private static final Log LOGGER = LogFactory.getLog(JabRefLogger.class); + private JabRefLogger() { + } + public static void setDebug() { setLogLevelToDebugForJabRefClasses(); LOGGER.debug("Showing debug messages"); diff --git a/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java b/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java index 73114b8d198..671db1ebdb0 100644 --- a/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java +++ b/src/main/java/org/jabref/logic/msbib/BibTeXConverter.java @@ -16,6 +16,9 @@ public class BibTeXConverter { private static final String MSBIB_PREFIX = "msbib-"; + private BibTeXConverter() { + } + /** * Converts an {@link MSBibEntry} to a {@link BibEntry} for import * @param entry The MsBibEntry to convert diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index b0f14ff9d64..a7bc4f49a4b 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -12,6 +12,9 @@ public class MSBibConverter { private static final String MSBIB_PREFIX = "msbib-"; private static final String BIBTEX_PREFIX = "BIBTEX_"; + private MSBibConverter() { + } + public static MSBibEntry convert(BibEntry entry) { MSBibEntry result = new MSBibEntry(); diff --git a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java index f4bfa2177e8..752484fd116 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibMapping.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibMapping.java @@ -80,6 +80,9 @@ public class MSBibMapping { biblatexToMsBib.put(MSBIB_PREFIX + "productioncompany", "ProductionCompany"); } + private MSBibMapping() { + } + public static String getBiblatexEntryType(String msbibType) { final String defaultType = BibtexEntryTypes.MISC.getName(); diff --git a/src/main/java/org/jabref/logic/net/ProxyRegisterer.java b/src/main/java/org/jabref/logic/net/ProxyRegisterer.java index ef646abca1a..ee2eac121fa 100644 --- a/src/main/java/org/jabref/logic/net/ProxyRegisterer.java +++ b/src/main/java/org/jabref/logic/net/ProxyRegisterer.java @@ -2,6 +2,9 @@ public class ProxyRegisterer { + private ProxyRegisterer() { + } + public static void register(ProxyPreferences proxyPrefs) { if (proxyPrefs.isUseProxy()) { // NetworkTab.java ensures that proxyHostname and proxyPort are not null diff --git a/src/main/java/org/jabref/logic/net/URLUtil.java b/src/main/java/org/jabref/logic/net/URLUtil.java index d82bb87adc2..0d86550eb1c 100644 --- a/src/main/java/org/jabref/logic/net/URLUtil.java +++ b/src/main/java/org/jabref/logic/net/URLUtil.java @@ -13,6 +13,9 @@ public class URLUtil { // Detect Google search URL private static final String GOOGLE_SEARCH_EXP = "^https?://(?:www\\.)?google\\.[\\.a-z]+?/url.*"; + private URLUtil() { + } + /** * Cleans URLs returned by Google search. * diff --git a/src/main/java/org/jabref/logic/remote/RemoteUtil.java b/src/main/java/org/jabref/logic/remote/RemoteUtil.java index 67649fba1ca..66e3a543c65 100644 --- a/src/main/java/org/jabref/logic/remote/RemoteUtil.java +++ b/src/main/java/org/jabref/logic/remote/RemoteUtil.java @@ -2,7 +2,10 @@ public class RemoteUtil { + private RemoteUtil() { + } + public static boolean isUserPort(int portNumber) { - return portNumber >= 1024 && portNumber <= 65535; + return (portNumber >= 1024) && (portNumber <= 65535); } } diff --git a/src/main/java/org/jabref/logic/remote/client/RemoteListenerClient.java b/src/main/java/org/jabref/logic/remote/client/RemoteListenerClient.java index 71ce5cad05a..dedf61bd817 100644 --- a/src/main/java/org/jabref/logic/remote/client/RemoteListenerClient.java +++ b/src/main/java/org/jabref/logic/remote/client/RemoteListenerClient.java @@ -16,6 +16,9 @@ public class RemoteListenerClient { private static final int TIMEOUT = 2000; + private RemoteListenerClient() { + } + /** * Attempt to send command line arguments to already running JabRef instance. * diff --git a/src/main/java/org/jabref/logic/search/rules/describer/SearchDescribers.java b/src/main/java/org/jabref/logic/search/rules/describer/SearchDescribers.java index 799c9cd371c..ef844983a7c 100644 --- a/src/main/java/org/jabref/logic/search/rules/describer/SearchDescribers.java +++ b/src/main/java/org/jabref/logic/search/rules/describer/SearchDescribers.java @@ -7,6 +7,9 @@ public class SearchDescribers { + private SearchDescribers() { + } + /** * Get the search describer for a given search rule and a given search query. * diff --git a/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java b/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java index d00ced1bdbb..c040f6ac5fd 100644 --- a/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java +++ b/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java @@ -57,4 +57,8 @@ public class MetadataSerializationConfiguration { * Identifier for {@link AutomaticKeywordGroup}. */ public static final String AUTOMATIC_KEYWORD_GROUP_ID = "AutomaticKeywordGroup:"; + + + private MetadataSerializationConfiguration() { + } } diff --git a/src/main/java/org/jabref/logic/util/OS.java b/src/main/java/org/jabref/logic/util/OS.java index bcb8db01858..bf284f4a054 100644 --- a/src/main/java/org/jabref/logic/util/OS.java +++ b/src/main/java/org/jabref/logic/util/OS.java @@ -19,4 +19,7 @@ public class OS { // Newlines // will be overridden in initialization due to feature #857 @ JabRef.java public static String NEWLINE = System.lineSeparator(); + + private OS() { + } } diff --git a/src/main/java/org/jabref/logic/util/TestEntry.java b/src/main/java/org/jabref/logic/util/TestEntry.java index 67ad4fbfbe4..8d2b3920b87 100644 --- a/src/main/java/org/jabref/logic/util/TestEntry.java +++ b/src/main/java/org/jabref/logic/util/TestEntry.java @@ -5,6 +5,9 @@ public class TestEntry { + private TestEntry() { + } + public static BibEntry getTestEntry() { BibEntry entry = new BibEntry("article"); diff --git a/src/main/java/org/jabref/logic/util/UpdateField.java b/src/main/java/org/jabref/logic/util/UpdateField.java index e3a62c5f0f8..d7a2437caab 100644 --- a/src/main/java/org/jabref/logic/util/UpdateField.java +++ b/src/main/java/org/jabref/logic/util/UpdateField.java @@ -11,6 +11,9 @@ public class UpdateField { + private UpdateField() { + } + /** * Updating a field will result in the entry being reformatted on save * diff --git a/src/main/java/org/jabref/logic/util/io/FileBasedLock.java b/src/main/java/org/jabref/logic/util/io/FileBasedLock.java index 4247b16d3be..904b79ef4f7 100644 --- a/src/main/java/org/jabref/logic/util/io/FileBasedLock.java +++ b/src/main/java/org/jabref/logic/util/io/FileBasedLock.java @@ -22,6 +22,9 @@ public class FileBasedLock { */ public static final long LOCKFILE_CRITICAL_AGE = 60000; + private FileBasedLock() { + } + /** * This method checks whether there is a lock file for the given file. If * there is, it waits for 500 ms. This is repeated until the lock is gone 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 6b962a9940a..522d39e1407 100644 --- a/src/main/java/org/jabref/logic/util/io/FileFinder.java +++ b/src/main/java/org/jabref/logic/util/io/FileFinder.java @@ -20,6 +20,9 @@ public class FileFinder { private static final Log LOGGER = LogFactory.getLog(FileFinder.class); + private FileFinder() { + } + public static Set findFiles(List extensions, List directories) { Objects.requireNonNull(directories, "Directories must not be null!"); diff --git a/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java b/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java index 411e7e8bb47..b783233f115 100644 --- a/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java +++ b/src/main/java/org/jabref/logic/util/io/FileNameCleaner.java @@ -26,6 +26,9 @@ public class FileNameCleaner { }; // @formatter:on + private FileNameCleaner() { + } + /** * Replaces illegal characters in given fileName by '_' 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 764d124f47d..5e5f7907e5b 100644 --- a/src/main/java/org/jabref/logic/util/io/FileUtil.java +++ b/src/main/java/org/jabref/logic/util/io/FileUtil.java @@ -44,6 +44,9 @@ public class FileUtil { public static final boolean isPosixCompilant = FileSystems.getDefault().supportedFileAttributeViews().contains("posix"); + private FileUtil() { + } + /** * Returns the extension of a file or Optional.empty() if the file does not have one (no . in name). * diff --git a/src/main/java/org/jabref/logic/util/io/RegExpFileSearch.java b/src/main/java/org/jabref/logic/util/io/RegExpFileSearch.java index 56ba2101dbb..0b43ee0b2cd 100644 --- a/src/main/java/org/jabref/logic/util/io/RegExpFileSearch.java +++ b/src/main/java/org/jabref/logic/util/io/RegExpFileSearch.java @@ -31,6 +31,9 @@ public class RegExpFileSearch { private static final Pattern SQUARE_BRACKETS_PATTERN = Pattern.compile("\\[.*?\\]"); + private RegExpFileSearch() { + } + /** * Search for file links for a set of entries using regexp. Lists of extensions and directories * are given. 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 53228d64ef2..215af84ede7 100644 --- a/src/main/java/org/jabref/logic/util/io/XMLUtil.java +++ b/src/main/java/org/jabref/logic/util/io/XMLUtil.java @@ -28,6 +28,9 @@ public class XMLUtil { private static final Log LOGGER = LogFactory.getLog(XMLUtil.class); + private XMLUtil() { + } + /** * Prints out the document to standard out. Used to generate files for test cases. */ diff --git a/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java b/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java index b16efbf7614..b7fe2213291 100644 --- a/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java +++ b/src/main/java/org/jabref/logic/util/strings/DiffHighlighting.java @@ -19,6 +19,9 @@ public class DiffHighlighting { public static final String HTML_START = ""; public static final String HTML_END = ""; + private DiffHighlighting() { + } + public static String generateDiffHighlighting(String baseString, String modifiedString, String separator) { Objects.requireNonNull(separator); diff --git a/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java b/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java index 2a3409ae399..8f9cfb5290e 100644 --- a/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java +++ b/src/main/java/org/jabref/logic/util/strings/HTMLUnicodeConversionMaps.java @@ -897,6 +897,9 @@ public class HTMLUnicodeConversionMaps { } + private HTMLUnicodeConversionMaps() { + } + private static String cleanLaTeX(String escapedString) { // Get rid of \{}$ from the LaTeX-string return escapedString.replaceAll("[\\\\\\{\\}\\$]", ""); diff --git a/src/main/java/org/jabref/logic/xmp/XMPUtil.java b/src/main/java/org/jabref/logic/xmp/XMPUtil.java index 97d5b6ccb88..f0036214e26 100644 --- a/src/main/java/org/jabref/logic/xmp/XMPUtil.java +++ b/src/main/java/org/jabref/logic/xmp/XMPUtil.java @@ -62,6 +62,8 @@ public class XMPUtil { private static final Log LOGGER = LogFactory.getLog(XMPUtil.class); + private XMPUtil() { + } /** * Convenience method for readXMP(File). diff --git a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java index cdd366de51c..f4573c62236 100644 --- a/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java +++ b/src/main/java/org/jabref/migrations/CustomEntryTypePreferenceMigration.java @@ -22,6 +22,9 @@ class CustomEntryTypePreferenceMigration { private static JabRefPreferences prefs = Globals.prefs; + private CustomEntryTypePreferenceMigration() { + } + static void upgradeStoredCustomEntryTypes(BibDatabaseMode defaultBibDatabaseMode) { List storedOldTypes = new ArrayList<>(); diff --git a/src/main/java/org/jabref/migrations/PreferencesMigrations.java b/src/main/java/org/jabref/migrations/PreferencesMigrations.java index a0ca4d25009..65e38b4187f 100644 --- a/src/main/java/org/jabref/migrations/PreferencesMigrations.java +++ b/src/main/java/org/jabref/migrations/PreferencesMigrations.java @@ -18,6 +18,9 @@ public class PreferencesMigrations { private static final Log LOGGER = LogFactory.getLog(PreferencesMigrations.class); + private PreferencesMigrations() { + } + /** * Migrate all preferences from net/sf/jabref to org/jabref */ diff --git a/src/main/java/org/jabref/model/DuplicateCheck.java b/src/main/java/org/jabref/model/DuplicateCheck.java index 143a6769499..de68ddfd6a9 100644 --- a/src/main/java/org/jabref/model/DuplicateCheck.java +++ b/src/main/java/org/jabref/model/DuplicateCheck.java @@ -55,6 +55,8 @@ public class DuplicateCheck { DuplicateCheck.FIELD_WEIGHTS.put(FieldName.JOURNAL, 2.); } + private DuplicateCheck() { + } /** * Checks if the two entries represent the same publication. diff --git a/src/main/java/org/jabref/model/EntryTypes.java b/src/main/java/org/jabref/model/EntryTypes.java index 812e9c7118a..6405138a6fd 100644 --- a/src/main/java/org/jabref/model/EntryTypes.java +++ b/src/main/java/org/jabref/model/EntryTypes.java @@ -105,6 +105,9 @@ public void removeType(String name) { public static final InternalEntryTypes BIBLATEX = new InternalEntryTypes(BiblatexEntryTypes.MISC, Arrays.asList(BiblatexEntryTypes.ALL)); + private EntryTypes() { + } + /** * This method returns the BibtexEntryType for the name of a type, * or null if it does not exist. @@ -228,15 +231,16 @@ public static void loadCustomEntryTypes(List customBibtexEntryT * @return returns true if the two compared entry types have the same name and equal required and optional fields */ public static boolean isEqualNameAndFieldBased(EntryType type1, EntryType type2) { - if (type1 == null && type2 == null) { + if ((type1 == null) && (type2 == null)) { return true; - } else if (type1 == null || type2 == null) { + } else if ((type1 == null) || (type2 == null)) { return false; - } else + } else { return type1.getName().equals(type2.getName()) && type1.getRequiredFields().equals(type2.getRequiredFields()) && type1.getOptionalFields().equals(type2.getOptionalFields()) && type1.getSecondaryOptionalFields().equals(type2.getSecondaryOptionalFields()); + } } public static boolean isExclusiveBiblatex(String type) { diff --git a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java index d2374d29f6e..7649fa6887c 100644 --- a/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java +++ b/src/main/java/org/jabref/model/database/BibDatabaseModeDetection.java @@ -7,6 +7,9 @@ import org.jabref.model.entry.BibEntry; public class BibDatabaseModeDetection { + + private BibDatabaseModeDetection() { + } /** * Tries to infer the database type by examining a BibDatabase database. * diff --git a/src/main/java/org/jabref/model/database/BibDatabases.java b/src/main/java/org/jabref/model/database/BibDatabases.java index 30fe24b0236..9d64696d43f 100644 --- a/src/main/java/org/jabref/model/database/BibDatabases.java +++ b/src/main/java/org/jabref/model/database/BibDatabases.java @@ -9,6 +9,9 @@ public class BibDatabases { + private BibDatabases() { + } + /** * Gets a collection of bibentries and sets an ID for every entry. After that * all entries will be inserted into a new BibDatabase. diff --git a/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java b/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java index b65f04b63b5..a418d1e1d45 100644 --- a/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java +++ b/src/main/java/org/jabref/model/entry/BiblatexEntryTypes.java @@ -950,6 +950,9 @@ public String getName() { THESIS, UNPUBLISHED, CONFERENCE, ELECTRONIC, MASTERSTHESIS, PHDTHESIS, TECHREPORT, WWW, IEEETRANBSTCTL); + private BiblatexEntryTypes() { + } + public static Optional getType(String name) { return ALL.stream().filter(e -> e.getName().equalsIgnoreCase(name)).findFirst(); } diff --git a/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java b/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java index 988544f60f4..352411976e5 100644 --- a/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java +++ b/src/main/java/org/jabref/model/entry/BibtexEntryTypes.java @@ -281,6 +281,9 @@ public String getName() { public static final List ALL = Arrays.asList(ARTICLE, INBOOK, BOOK, BOOKLET, INCOLLECTION, CONFERENCE, INPROCEEDINGS, PROCEEDINGS, MANUAL, MASTERSTHESIS, PHDTHESIS, TECHREPORT, UNPUBLISHED, MISC); + private BibtexEntryTypes() { + } + public static Optional getType(String name) { return ALL.stream().filter(e -> e.getName().equalsIgnoreCase(name)).findFirst(); } diff --git a/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java b/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java index d2a2b4c5553..04dbff71414 100644 --- a/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java +++ b/src/main/java/org/jabref/model/entry/CanonicalBibtexEntry.java @@ -10,6 +10,9 @@ public class CanonicalBibtexEntry { + private CanonicalBibtexEntry() { + } + /** * This returns a canonical BibTeX serialization. Special characters such as "{" or "&" are NOT escaped, but written * as is diff --git a/src/main/java/org/jabref/model/entry/EntryConverter.java b/src/main/java/org/jabref/model/entry/EntryConverter.java index e15b9ace112..131ef12bb1a 100644 --- a/src/main/java/org/jabref/model/entry/EntryConverter.java +++ b/src/main/java/org/jabref/model/entry/EntryConverter.java @@ -40,4 +40,6 @@ public class EntryConverter { FIELD_ALIASES.putAll(EntryConverter.FIELD_ALIASES_LTX_TO_TEX); } + private EntryConverter() { + } } diff --git a/src/main/java/org/jabref/model/entry/EntryLinkList.java b/src/main/java/org/jabref/model/entry/EntryLinkList.java index 93ac6e90534..a1b50882b25 100644 --- a/src/main/java/org/jabref/model/entry/EntryLinkList.java +++ b/src/main/java/org/jabref/model/entry/EntryLinkList.java @@ -10,6 +10,8 @@ public class EntryLinkList { private static String SEPARATOR = ","; + private EntryLinkList() { + } public static List parse(String fieldValue, BibDatabase database) { List result = new ArrayList<>(); diff --git a/src/main/java/org/jabref/model/entry/FieldName.java b/src/main/java/org/jabref/model/entry/FieldName.java index 27371ac5ebd..b15b8b5f513 100644 --- a/src/main/java/org/jabref/model/entry/FieldName.java +++ b/src/main/java/org/jabref/model/entry/FieldName.java @@ -155,6 +155,9 @@ public class FieldName { // Map to hold alternative display names private static final Map displayNames = new HashMap<>(); + private FieldName() { + } + public static String orFields(String... fields) { return String.join(FieldName.FIELD_SEPARATOR, fields); } diff --git a/src/main/java/org/jabref/model/entry/FileField.java b/src/main/java/org/jabref/model/entry/FileField.java index c6cc392816f..bb9c4c21c20 100644 --- a/src/main/java/org/jabref/model/entry/FileField.java +++ b/src/main/java/org/jabref/model/entry/FileField.java @@ -8,6 +8,9 @@ public class FileField { + private FileField() { + } + public static List parse(String value) { if ((value == null) || value.trim().isEmpty()) { return Collections.emptyList(); diff --git a/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java b/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java index 477d13428e0..ce51f752b07 100644 --- a/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java +++ b/src/main/java/org/jabref/model/entry/IEEETranEntryTypes.java @@ -115,6 +115,9 @@ public String getName() { public static final List ALL = Arrays.asList(ELECTRONIC, IEEETRANBSTCTL, PERIODICAL, PATENT, STANDARD); + private IEEETranEntryTypes() { + } + public static Optional getType(String name) { return ALL.stream().filter(e -> e.getName().equalsIgnoreCase(name)).findFirst(); } diff --git a/src/main/java/org/jabref/model/entry/IdGenerator.java b/src/main/java/org/jabref/model/entry/IdGenerator.java index 29eb787722b..68a4260bcca 100644 --- a/src/main/java/org/jabref/model/entry/IdGenerator.java +++ b/src/main/java/org/jabref/model/entry/IdGenerator.java @@ -19,6 +19,9 @@ public class IdGenerator { private static int idCounter; + private IdGenerator() { + } + public static synchronized String next() { String result = idFormat.format(idCounter); idCounter++; diff --git a/src/main/java/org/jabref/model/entry/MonthUtil.java b/src/main/java/org/jabref/model/entry/MonthUtil.java index 68d48a263c1..802542be146 100644 --- a/src/main/java/org/jabref/model/entry/MonthUtil.java +++ b/src/main/java/org/jabref/model/entry/MonthUtil.java @@ -63,6 +63,8 @@ public boolean isValid() { } } + private MonthUtil() { + } /** * Find month by number diff --git a/src/main/java/org/jabref/model/search/rules/SearchRules.java b/src/main/java/org/jabref/model/search/rules/SearchRules.java index 91d60de1f3b..f4046d1a2a7 100644 --- a/src/main/java/org/jabref/model/search/rules/SearchRules.java +++ b/src/main/java/org/jabref/model/search/rules/SearchRules.java @@ -4,6 +4,9 @@ public class SearchRules { + private SearchRules() { + } + /** * Returns the appropriate search rule that fits best to the given parameter. */