diff --git a/build.gradle b/build.gradle index d2548f37273..a45f7880af2 100644 --- a/build.gradle +++ b/build.gradle @@ -173,7 +173,7 @@ dependencies { testCompile "org.testfx:testfx-core:4.0.+" testCompile "org.testfx:testfx-junit5:4.0.+" - checkstyle 'com.puppycrawl.tools:checkstyle:8.19' + checkstyle 'com.puppycrawl.tools:checkstyle:8.20' } jacoco { diff --git a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java index 553b5c681a7..c8d781260af 100644 --- a/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java @@ -29,7 +29,6 @@ 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; @@ -55,7 +54,6 @@ public abstract class SuggestionProvider implements Callback SuggestionProvider create(Collection possibleSuggestions) { return create(null, possibleSuggestions); @@ -67,7 +65,6 @@ public static SuggestionProvider create(Collection possibleSuggestions * * @param stringConverter A stringConverter which converts generic T into a string * @param possibleSuggestions All possible suggestions - * @return */ public static SuggestionProvider create(Callback stringConverter, Collection possibleSuggestions) { SuggestionProviderString suggestionProvider = new SuggestionProviderString<>(stringConverter); @@ -77,7 +74,6 @@ public static SuggestionProvider create(Callback stringConvert /** * Add the given new possible suggestions to this SuggestionProvider - * @param newPossible */ public void addPossibleSuggestions(@SuppressWarnings("unchecked") T... newPossible) { addPossibleSuggestions(Arrays.asList(newPossible)); @@ -85,7 +81,6 @@ public void addPossibleSuggestions(@SuppressWarnings("unchecked") T... newPossib /** * Add the given new possible suggestions to this SuggestionProvider - * @param newPossible */ public void addPossibleSuggestions(Collection newPossible) { synchronized (possibleSuggestionsLock) { @@ -113,39 +108,21 @@ public final Collection call(final ISuggestionRequest request) { } } } - Collections.sort(suggestions, getComparator()); + suggestions.sort(getComparator()); } return suggestions; } - - /*************************************************************************** - * * - * Static methods * - * * - **************************************************************************/ - /** * Get the comparator to order the suggestions - * @return */ protected abstract Comparator getComparator(); /** * Check the given possible suggestion is a match (is a valid suggestion) - * @param suggestion - * @param request - * @return */ protected abstract boolean isMatch(T suggestion, ISuggestionRequest request); - - /*************************************************************************** - * * - * Default implementations * - * * - **************************************************************************/ - /** * This is a simple string based suggestion provider. * All generic suggestions T are turned into strings for processing. @@ -166,18 +143,14 @@ public int compare(T o1, T o2) { /** * Create a new SuggestionProviderString - * @param stringConverter */ public SuggestionProviderString(Callback stringConverter) { this.stringConverter = stringConverter; // In case no stringConverter was provided, use the default strategy if (this.stringConverter == null) { - this.stringConverter = new Callback() { - @Override - public String call(T obj) { - return obj != null ? obj.toString() : ""; //$NON-NLS-1$ - } + this.stringConverter = obj -> { + return obj != null ? obj.toString() : ""; //$NON-NLS-1$ }; } } diff --git a/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java b/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java index 88f4d200ed5..83d740105f6 100644 --- a/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java @@ -31,7 +31,6 @@ public void setAccepted(boolean a) { accepted = a; } - /** * This method returns a JComponent detailing the nature of the change. * @return JComponent diff --git a/src/main/java/org/jabref/gui/customentrytypes/FieldSetComponent.java b/src/main/java/org/jabref/gui/customentrytypes/FieldSetComponent.java index a8d8eddecce..be7dc8efc6f 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/FieldSetComponent.java +++ b/src/main/java/org/jabref/gui/customentrytypes/FieldSetComponent.java @@ -324,7 +324,6 @@ private void move(int dy) { list.setSelectedIndex(newInd); } - /** * FocusListener to select the first entry in the list of fields when they are focused */ diff --git a/src/main/java/org/jabref/gui/journals/ManageJournalAbbreviationsView.java b/src/main/java/org/jabref/gui/journals/ManageJournalAbbreviationsView.java index 1a0457af443..dcfbc6da392 100644 --- a/src/main/java/org/jabref/gui/journals/ManageJournalAbbreviationsView.java +++ b/src/main/java/org/jabref/gui/journals/ManageJournalAbbreviationsView.java @@ -188,7 +188,6 @@ private void saveAbbreviationsAndCloseDialog() { close(); } - /** * This class provides a editable text field that is used as table cell. * It handles the editing of the name column. diff --git a/src/main/java/org/jabref/gui/search/SearchWorker.java b/src/main/java/org/jabref/gui/search/SearchWorker.java index 816a17185e1..5e916e63ad6 100644 --- a/src/main/java/org/jabref/gui/search/SearchWorker.java +++ b/src/main/java/org/jabref/gui/search/SearchWorker.java @@ -18,7 +18,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - /** * Not reusable. Always create a new instance for each search! */ @@ -26,18 +25,14 @@ class SearchWorker extends SwingWorker, Void> { private static final Logger LOGGER = LoggerFactory.getLogger(SearchWorker.class); - private final BasePanel basePanel; private final BibDatabase database; private final SearchQuery searchQuery; - private final SearchDisplayMode searchDisplayMode; public SearchWorker(BasePanel basePanel, SearchQuery searchQuery, SearchDisplayMode searchDisplayMode) { - this.basePanel = Objects.requireNonNull(basePanel); this.database = Objects.requireNonNull(basePanel.getDatabase()); this.searchQuery = Objects.requireNonNull(searchQuery); - this.searchDisplayMode = Objects.requireNonNull(searchDisplayMode); - LOGGER.debug("Search (" + this.searchDisplayMode.getDisplayName() + "): " + this.searchQuery); + LOGGER.debug("Search (" + searchDisplayMode.getDisplayName() + "): " + this.searchQuery); } @Override diff --git a/src/main/java/org/jabref/gui/util/TooltipTextUtil.java b/src/main/java/org/jabref/gui/util/TooltipTextUtil.java index f23bacabb28..92f9695b494 100644 --- a/src/main/java/org/jabref/gui/util/TooltipTextUtil.java +++ b/src/main/java/org/jabref/gui/util/TooltipTextUtil.java @@ -52,7 +52,6 @@ public static String textToHTMLString(Text text) { return textString; } - /** * Formats a String to multiple Texts by replacing some parts and adding font characteristics. */ diff --git a/src/main/java/org/jabref/gui/util/component/Tag.java b/src/main/java/org/jabref/gui/util/component/Tag.java index 508ca1dcb8e..4a2661f0ba6 100644 --- a/src/main/java/org/jabref/gui/util/component/Tag.java +++ b/src/main/java/org/jabref/gui/util/component/Tag.java @@ -14,7 +14,6 @@ import com.airhacks.afterburner.views.ViewLoader; import org.fxmisc.easybind.EasyBind; - /** * A tag item in a {@link TagBar}. */ diff --git a/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java b/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java index 2d260b3f074..1e4897e9dda 100644 --- a/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java +++ b/src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java @@ -316,8 +316,7 @@ public static double correlateByWords(final String s1, final String s2) { return 1 - missRate; } - - /* + /** * Calculates the similarity (a number within 0 and 1) between two strings. * http://stackoverflow.com/questions/955110/similarity-string-comparison-in-java */ diff --git a/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java b/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java index a19b7de62e7..6f66284d85c 100644 --- a/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java +++ b/src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java @@ -48,7 +48,6 @@ public char asChar() { return asChar; } - /** * Convert bstFormat char into ENUM * @@ -72,7 +71,6 @@ private BibtexCaseChanger() { * * @param s the string to handle * @param format the format - * @return */ public static String changeCase(String s, FORMAT_MODE format) { return (new BibtexCaseChanger()).doChangeCase(s, format); diff --git a/src/main/java/org/jabref/logic/bst/VM.java b/src/main/java/org/jabref/logic/bst/VM.java index 5326e856338..e51183043c3 100644 --- a/src/main/java/org/jabref/logic/bst/VM.java +++ b/src/main/java/org/jabref/logic/bst/VM.java @@ -935,8 +935,6 @@ private void read() { * override any definition you define using this command. If you want to * define a string the user can't touch, use the FUNCTION command, which has * a compatible syntax. - * - * @param child */ private void macro(Tree child) { String name = child.getChild(0).getText(); @@ -959,8 +957,7 @@ public void execute(BstEntry context) { } } - - /* + /** * Declares the fields and entry variables. It has three arguments, each a * (possibly empty) list of variable names. The three lists are of: fields, * integer entry variables, and string entry variables. There is an diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java index 77d60f0f89a..6bd523cd082 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java @@ -12,7 +12,6 @@ import com.google.common.cache.LoadingCache; import com.google.common.eventbus.Subscribe; - /** * Caches the generated Citations for quicker access * {@link CitationStyleGenerator} generates the citation with JavaScript which may take some time diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java index 5e39b25e621..fa23ab8ba71 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java @@ -11,7 +11,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - /** * 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/exporter/ModsExporter.java b/src/main/java/org/jabref/logic/exporter/ModsExporter.java index 7a87782abee..0c3fa50c3d5 100644 --- a/src/main/java/org/jabref/logic/exporter/ModsExporter.java +++ b/src/main/java/org/jabref/logic/exporter/ModsExporter.java @@ -48,13 +48,12 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; - /** * TemplateExporter for exporting in MODS XML format. */ class ModsExporter extends Exporter { - protected static final String MODS_NAMESPACE_URI = "http://www.loc.gov/mods/v3"; + private static final String MODS_NAMESPACE_URI = "http://www.loc.gov/mods/v3"; private static final String MINUS = "-"; private static final String DOUBLE_MINUS = "--"; private static final String MODS_SCHEMA_LOCATION = "http://www.loc.gov/standards/mods/v3/mods-3-6.xsd"; @@ -320,7 +319,7 @@ private void handleAuthors(ModsDefinition mods, String value) { name.getNamePartOrDisplayFormOrAffiliation().add(element); //now take care of the forenames - String forename = author.substring(commaIndex + 1, author.length()); + String forename = author.substring(commaIndex + 1); String[] forenames = forename.split(" "); for (String given : forenames) { if (!given.isEmpty()) { 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 7fbe0f809ac..1a4a70aa94a 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java @@ -52,7 +52,6 @@ public class MedlineFetcher implements IdBasedParserFetcher, SearchBasedFetcher private int numberOfResultsFound; - /** * Replaces all commas in a given string with " AND " * diff --git a/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java b/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java index dcf94806637..6a2be4584ba 100644 --- a/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java +++ b/src/main/java/org/jabref/logic/openoffice/OOBibStyle.java @@ -730,7 +730,6 @@ private String getCitationMarkerField(BibEntry entry, BibDatabase database, Stri return ""; } - /** * Look up the nth author and return the proper last name for citation markers. * diff --git a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java index 12bf844cf1f..0906d7ed2cf 100644 --- a/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java +++ b/src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java @@ -12,7 +12,6 @@ import org.jabref.model.metadata.FilePreferences; import org.jabref.model.pdf.FileAnnotation; - /** * Here all PDF files attached to a BibEntry are scanned for annotations using a PdfAnnotationImporter. */ diff --git a/src/main/java/org/jabref/logic/shared/DBMSProcessor.java b/src/main/java/org/jabref/logic/shared/DBMSProcessor.java index 59d3deed123..6347b9fc247 100644 --- a/src/main/java/org/jabref/logic/shared/DBMSProcessor.java +++ b/src/main/java/org/jabref/logic/shared/DBMSProcessor.java @@ -129,7 +129,6 @@ public void setupSharedDatabase() throws SQLException { */ abstract String escape(String expression); - /** * Inserts the given bibEntry into shared database. * diff --git a/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java b/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java index 9a235e4c7b8..6c0a2f663c5 100644 --- a/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java +++ b/src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java @@ -1,6 +1,5 @@ package org.jabref.logic.shared.exception; - /** * This exception is thrown when a shared database is required, but it actually isn't one. */ diff --git a/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java b/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java index ea06ddbbaba..30040d513f3 100644 --- a/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java +++ b/src/main/java/org/jabref/logic/undo/UndoChangeEvent.java @@ -43,7 +43,6 @@ public boolean isCanRedo() { return canRedo; } - /** * * @return A description of the action to be redone diff --git a/src/main/java/org/jabref/logic/util/Version.java b/src/main/java/org/jabref/logic/util/Version.java index 52ed2b45795..11ecd279f17 100644 --- a/src/main/java/org/jabref/logic/util/Version.java +++ b/src/main/java/org/jabref/logic/util/Version.java @@ -144,7 +144,6 @@ public boolean isNewerThan(Version otherVersion) { return false; } - /** * Checks if this version should be updated to one of the given ones. * Ignoring the other Version if this one is Stable and the other one is not. 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 5b6e1f165fc..bbaa00159e3 100644 --- a/src/main/java/org/jabref/logic/util/io/FileUtil.java +++ b/src/main/java/org/jabref/logic/util/io/FileUtil.java @@ -53,7 +53,6 @@ public static Optional getFileExtension(String fileName) { } } - /** * 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/model/cleanup/Formatter.java b/src/main/java/org/jabref/model/cleanup/Formatter.java index 7fa32dacd94..17eb2d262e2 100644 --- a/src/main/java/org/jabref/model/cleanup/Formatter.java +++ b/src/main/java/org/jabref/model/cleanup/Formatter.java @@ -18,7 +18,6 @@ public abstract class Formatter { */ public abstract String getName(); - /** * Returns a unique key for the formatter that can be used for its identification * @return the key of the formatter, always not null diff --git a/src/main/java/org/jabref/model/database/DuplicationChecker.java b/src/main/java/org/jabref/model/database/DuplicationChecker.java index 619bbdb3889..01d5c3bc720 100644 --- a/src/main/java/org/jabref/model/database/DuplicationChecker.java +++ b/src/main/java/org/jabref/model/database/DuplicationChecker.java @@ -19,11 +19,10 @@ public class DuplicationChecker { /** use a map instead of a set since I need to know how many of each key is in there */ private final Map allKeys = new HashMap<>(); - /** * Checks if there is more than one occurrence of this key */ - public boolean isDuplicateCiteKeyExisting(String citeKey) { + private boolean isDuplicateCiteKeyExisting(String citeKey) { return getNumberOfKeyOccurrences(citeKey) > 1; } diff --git a/src/main/java/org/jabref/model/entry/Month.java b/src/main/java/org/jabref/model/entry/Month.java index 96241920ae0..3d7324b7369 100644 --- a/src/main/java/org/jabref/model/entry/Month.java +++ b/src/main/java/org/jabref/model/entry/Month.java @@ -38,7 +38,6 @@ public enum Month { this.number = number; } - /** * Find month by one-based number. * If the number is not in the valid range, then an empty Optional is returned. diff --git a/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java b/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java index 37f38c99f25..f89e843f3e7 100644 --- a/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java +++ b/src/main/java/org/jabref/model/entry/specialfields/SpecialField.java @@ -99,7 +99,6 @@ public static Optional getSpecialFieldInstanceFromFieldName(String } } - /** * @param fieldName the name of the field to check * @return true if given field is a special field, false otherwise