Skip to content

Commit 83d652c

Browse files
dependabot[bot]tobiasdiez
authored andcommitted
Bump checkstyle from 8.19 to 8.20 (#4928)
* Bump checkstyle from 8.19 to 8.20 Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 8.19 to 8.20. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-8.19...checkstyle-8.20) Signed-off-by: dependabot[bot] <[email protected]> * Fix checkstyle * Fix checkstyle
1 parent 8414457 commit 83d652c

26 files changed

+10
-68
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ dependencies {
173173
testCompile "org.testfx:testfx-core:4.0.+"
174174
testCompile "org.testfx:testfx-junit5:4.0.+"
175175

176-
checkstyle 'com.puppycrawl.tools:checkstyle:8.19'
176+
checkstyle 'com.puppycrawl.tools:checkstyle:8.20'
177177
}
178178

179179
jacoco {

src/main/java/org/jabref/gui/autocompleter/SuggestionProvider.java

+3-30
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.ArrayList;
3030
import java.util.Arrays;
3131
import java.util.Collection;
32-
import java.util.Collections;
3332
import java.util.Comparator;
3433
import java.util.HashSet;
3534
import java.util.List;
@@ -55,7 +54,6 @@ public abstract class SuggestionProvider<T> implements Callback<ISuggestionReque
5554
/**
5655
* Create a default suggestion provider based on the toString() method of the generic objects
5756
* @param possibleSuggestions All possible suggestions
58-
* @return
5957
*/
6058
public static <T> SuggestionProvider<T> create(Collection<T> possibleSuggestions) {
6159
return create(null, possibleSuggestions);
@@ -67,7 +65,6 @@ public static <T> SuggestionProvider<T> create(Collection<T> possibleSuggestions
6765
*
6866
* @param stringConverter A stringConverter which converts generic T into a string
6967
* @param possibleSuggestions All possible suggestions
70-
* @return
7168
*/
7269
public static <T> SuggestionProvider<T> create(Callback<T, String> stringConverter, Collection<T> possibleSuggestions) {
7370
SuggestionProviderString<T> suggestionProvider = new SuggestionProviderString<>(stringConverter);
@@ -77,15 +74,13 @@ public static <T> SuggestionProvider<T> create(Callback<T, String> stringConvert
7774

7875
/**
7976
* Add the given new possible suggestions to this SuggestionProvider
80-
* @param newPossible
8177
*/
8278
public void addPossibleSuggestions(@SuppressWarnings("unchecked") T... newPossible) {
8379
addPossibleSuggestions(Arrays.asList(newPossible));
8480
}
8581

8682
/**
8783
* Add the given new possible suggestions to this SuggestionProvider
88-
* @param newPossible
8984
*/
9085
public void addPossibleSuggestions(Collection<T> newPossible) {
9186
synchronized (possibleSuggestionsLock) {
@@ -113,39 +108,21 @@ public final Collection<T> call(final ISuggestionRequest request) {
113108
}
114109
}
115110
}
116-
Collections.sort(suggestions, getComparator());
111+
suggestions.sort(getComparator());
117112
}
118113
return suggestions;
119114
}
120115

121-
122-
/***************************************************************************
123-
* *
124-
* Static methods *
125-
* *
126-
**************************************************************************/
127-
128116
/**
129117
* Get the comparator to order the suggestions
130-
* @return
131118
*/
132119
protected abstract Comparator<T> getComparator();
133120

134121
/**
135122
* Check the given possible suggestion is a match (is a valid suggestion)
136-
* @param suggestion
137-
* @param request
138-
* @return
139123
*/
140124
protected abstract boolean isMatch(T suggestion, ISuggestionRequest request);
141125

142-
143-
/***************************************************************************
144-
* *
145-
* Default implementations *
146-
* *
147-
**************************************************************************/
148-
149126
/**
150127
* This is a simple string based suggestion provider.
151128
* All generic suggestions T are turned into strings for processing.
@@ -166,18 +143,14 @@ public int compare(T o1, T o2) {
166143

167144
/**
168145
* Create a new SuggestionProviderString
169-
* @param stringConverter
170146
*/
171147
public SuggestionProviderString(Callback<T, String> stringConverter) {
172148
this.stringConverter = stringConverter;
173149

174150
// In case no stringConverter was provided, use the default strategy
175151
if (this.stringConverter == null) {
176-
this.stringConverter = new Callback<T, String>() {
177-
@Override
178-
public String call(T obj) {
179-
return obj != null ? obj.toString() : ""; //$NON-NLS-1$
180-
}
152+
this.stringConverter = obj -> {
153+
return obj != null ? obj.toString() : ""; //$NON-NLS-1$
181154
};
182155
}
183156
}

src/main/java/org/jabref/gui/collab/DatabaseChangeViewModel.java

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public void setAccepted(boolean a) {
3131
accepted = a;
3232
}
3333

34-
3534
/**
3635
* This method returns a JComponent detailing the nature of the change.
3736
* @return JComponent

src/main/java/org/jabref/gui/customentrytypes/FieldSetComponent.java

-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ private void move(int dy) {
324324
list.setSelectedIndex(newInd);
325325
}
326326

327-
328327
/**
329328
* FocusListener to select the first entry in the list of fields when they are focused
330329
*/

src/main/java/org/jabref/gui/journals/ManageJournalAbbreviationsView.java

-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ private void saveAbbreviationsAndCloseDialog() {
188188
close();
189189
}
190190

191-
192191
/**
193192
* This class provides a editable text field that is used as table cell.
194193
* It handles the editing of the name column.

src/main/java/org/jabref/gui/search/SearchWorker.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,21 @@
1818
import org.slf4j.Logger;
1919
import org.slf4j.LoggerFactory;
2020

21-
2221
/**
2322
* Not reusable. Always create a new instance for each search!
2423
*/
2524
class SearchWorker extends SwingWorker<List<BibEntry>, Void> {
2625

2726
private static final Logger LOGGER = LoggerFactory.getLogger(SearchWorker.class);
2827

29-
private final BasePanel basePanel;
3028
private final BibDatabase database;
3129

3230
private final SearchQuery searchQuery;
33-
private final SearchDisplayMode searchDisplayMode;
3431

3532
public SearchWorker(BasePanel basePanel, SearchQuery searchQuery, SearchDisplayMode searchDisplayMode) {
36-
this.basePanel = Objects.requireNonNull(basePanel);
3733
this.database = Objects.requireNonNull(basePanel.getDatabase());
3834
this.searchQuery = Objects.requireNonNull(searchQuery);
39-
this.searchDisplayMode = Objects.requireNonNull(searchDisplayMode);
40-
LOGGER.debug("Search (" + this.searchDisplayMode.getDisplayName() + "): " + this.searchQuery);
35+
LOGGER.debug("Search (" + searchDisplayMode.getDisplayName() + "): " + this.searchQuery);
4136
}
4237

4338
@Override

src/main/java/org/jabref/gui/util/TooltipTextUtil.java

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public static String textToHTMLString(Text text) {
5252
return textString;
5353
}
5454

55-
5655
/**
5756
* Formats a String to multiple Texts by replacing some parts and adding font characteristics.
5857
*/

src/main/java/org/jabref/gui/util/component/Tag.java

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import com.airhacks.afterburner.views.ViewLoader;
1515
import org.fxmisc.easybind.EasyBind;
1616

17-
1817
/**
1918
* A tag item in a {@link TagBar}.
2019
*/

src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ public static double correlateByWords(final String s1, final String s2) {
316316
return 1 - missRate;
317317
}
318318

319-
320-
/*
319+
/**
321320
* Calculates the similarity (a number within 0 and 1) between two strings.
322321
* http://stackoverflow.com/questions/955110/similarity-string-comparison-in-java
323322
*/

src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java

-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public char asChar() {
4848
return asChar;
4949
}
5050

51-
5251
/**
5352
* Convert bstFormat char into ENUM
5453
*
@@ -72,7 +71,6 @@ private BibtexCaseChanger() {
7271
*
7372
* @param s the string to handle
7473
* @param format the format
75-
* @return
7674
*/
7775
public static String changeCase(String s, FORMAT_MODE format) {
7876
return (new BibtexCaseChanger()).doChangeCase(s, format);

src/main/java/org/jabref/logic/bst/VM.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,6 @@ private void read() {
935935
* override any definition you define using this command. If you want to
936936
* define a string the user can't touch, use the FUNCTION command, which has
937937
* a compatible syntax.
938-
*
939-
* @param child
940938
*/
941939
private void macro(Tree child) {
942940
String name = child.getChild(0).getText();
@@ -959,8 +957,7 @@ public void execute(BstEntry context) {
959957
}
960958
}
961959

962-
963-
/*
960+
/**
964961
* Declares the fields and entry variables. It has three arguments, each a
965962
* (possibly empty) list of variable names. The three lists are of: fields,
966963
* integer entry variables, and string entry variables. There is an

src/main/java/org/jabref/logic/citationstyle/CitationStyleCache.java

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.google.common.cache.LoadingCache;
1313
import com.google.common.eventbus.Subscribe;
1414

15-
1615
/**
1716
* Caches the generated Citations for quicker access
1817
* {@link CitationStyleGenerator} generates the citation with JavaScript which may take some time

src/main/java/org/jabref/logic/citationstyle/CitationStyleGenerator.java

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.slf4j.Logger;
1212
import org.slf4j.LoggerFactory;
1313

14-
1514
/**
1615
* Facade to unify the access to the citation style engine. Use these methods if you need rendered BibTeX item(s) in a
1716
* given journal style. This class uses {@link CSLAdapter} to create output.

src/main/java/org/jabref/logic/exporter/ModsExporter.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@
4848
import org.jabref.model.entry.BibEntry;
4949
import org.jabref.model.entry.FieldName;
5050

51-
5251
/**
5352
* TemplateExporter for exporting in MODS XML format.
5453
*/
5554
class ModsExporter extends Exporter {
5655

57-
protected static final String MODS_NAMESPACE_URI = "http://www.loc.gov/mods/v3";
56+
private static final String MODS_NAMESPACE_URI = "http://www.loc.gov/mods/v3";
5857
private static final String MINUS = "-";
5958
private static final String DOUBLE_MINUS = "--";
6059
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) {
320319
name.getNamePartOrDisplayFormOrAffiliation().add(element);
321320

322321
//now take care of the forenames
323-
String forename = author.substring(commaIndex + 1, author.length());
322+
String forename = author.substring(commaIndex + 1);
324323
String[] forenames = forename.split(" ");
325324
for (String given : forenames) {
326325
if (!given.isEmpty()) {

src/main/java/org/jabref/logic/importer/fetcher/MedlineFetcher.java

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class MedlineFetcher implements IdBasedParserFetcher, SearchBasedFetcher
5252

5353
private int numberOfResultsFound;
5454

55-
5655
/**
5756
* Replaces all commas in a given string with " AND "
5857
*

src/main/java/org/jabref/logic/openoffice/OOBibStyle.java

-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ private String getCitationMarkerField(BibEntry entry, BibDatabase database, Stri
730730
return "";
731731
}
732732

733-
734733
/**
735734
* Look up the nth author and return the proper last name for citation markers.
736735
*

src/main/java/org/jabref/logic/pdf/EntryAnnotationImporter.java

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.jabref.model.metadata.FilePreferences;
1313
import org.jabref.model.pdf.FileAnnotation;
1414

15-
1615
/**
1716
* Here all PDF files attached to a BibEntry are scanned for annotations using a PdfAnnotationImporter.
1817
*/

src/main/java/org/jabref/logic/shared/DBMSProcessor.java

-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public void setupSharedDatabase() throws SQLException {
129129
*/
130130
abstract String escape(String expression);
131131

132-
133132
/**
134133
* Inserts the given bibEntry into shared database.
135134
*

src/main/java/org/jabref/logic/shared/exception/NotASharedDatabaseException.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.jabref.logic.shared.exception;
22

3-
43
/**
54
* This exception is thrown when a shared database is required, but it actually isn't one.
65
*/

src/main/java/org/jabref/logic/undo/UndoChangeEvent.java

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public boolean isCanRedo() {
4343
return canRedo;
4444
}
4545

46-
4746
/**
4847
*
4948
* @return A description of the action to be redone

src/main/java/org/jabref/logic/util/Version.java

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public boolean isNewerThan(Version otherVersion) {
144144
return false;
145145
}
146146

147-
148147
/**
149148
* Checks if this version should be updated to one of the given ones.
150149
* Ignoring the other Version if this one is Stable and the other one is not.

src/main/java/org/jabref/logic/util/io/FileUtil.java

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public static Optional<String> getFileExtension(String fileName) {
5353
}
5454
}
5555

56-
5756
/**
5857
* Returns the extension of a file or Optional.empty() if the file does not have one (no . in name).
5958
*

src/main/java/org/jabref/model/cleanup/Formatter.java

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public abstract class Formatter {
1818
*/
1919
public abstract String getName();
2020

21-
2221
/**
2322
* Returns a unique key for the formatter that can be used for its identification
2423
* @return the key of the formatter, always not null

src/main/java/org/jabref/model/database/DuplicationChecker.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ public class DuplicationChecker {
1919
/** use a map instead of a set since I need to know how many of each key is in there */
2020
private final Map<String, Integer> allKeys = new HashMap<>();
2121

22-
2322
/**
2423
* Checks if there is more than one occurrence of this key
2524
*/
26-
public boolean isDuplicateCiteKeyExisting(String citeKey) {
25+
private boolean isDuplicateCiteKeyExisting(String citeKey) {
2726
return getNumberOfKeyOccurrences(citeKey) > 1;
2827
}
2928

src/main/java/org/jabref/model/entry/Month.java

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public enum Month {
3838
this.number = number;
3939
}
4040

41-
4241
/**
4342
* Find month by one-based number.
4443
* If the number is not in the valid range, then an empty Optional is returned.

src/main/java/org/jabref/model/entry/specialfields/SpecialField.java

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public static Optional<SpecialField> getSpecialFieldInstanceFromFieldName(String
9999
}
100100
}
101101

102-
103102
/**
104103
* @param fieldName the name of the field to check
105104
* @return true if given field is a special field, false otherwise

0 commit comments

Comments
 (0)