Skip to content

Commit 8a5feb4

Browse files
authored
Merge pull request #5288 from JabRef/javadocCheckstyle
Add checkstyle for JavaDoc and fix related issues
2 parents fc4201d + 502f400 commit 8a5feb4

17 files changed

+74
-92
lines changed

config/checkstyle/checkstyle.xml

+26-17
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,30 @@
88
<property name="header" value=""/>
99
</module>
1010

11+
<module name="SuppressionFilter">
12+
<property name="file" value="${config_loc}/suppressions.xml"/>
13+
</module>
14+
15+
<module name="BeforeExecutionExclusionFileFilter">
16+
<property name="fileNamePattern" value="module\-info\.java$"/>
17+
</module>
18+
1119
<module name="TreeWalker">
20+
<!-- Checks for Javadoc comments: https://checkstyle.org/config_javadoc.html -->
21+
<module name="InvalidJavadocPosition"/>
22+
<module name="JavadocMethod">
23+
<property name="allowUndeclaredRTE" value="true"/>
24+
<property name="allowMissingParamTags" value="true"/>
25+
<property name="allowMissingThrowsTags" value="true"/>
26+
<property name="allowMissingReturnTag" value="true"/>
27+
<property name="validateThrows" value="true"/>
28+
</module>
1229

30+
<!-- Checks for imports: https://checkstyle.org/config_import.html -->
1331
<module name="UnusedImports"/>
14-
1532
<module name="RedundantImport"/>
16-
1733
<module name="AvoidStarImport"/>
18-
1934
<module name="IllegalImport"/>
20-
2135
<module name="ImportOrder">
2236
<property name="groups" value="java,javax,javafx,org.jabref,*"/>
2337
<property name="ordered" value="true"/>
@@ -26,17 +40,18 @@
2640
<property name="sortStaticImportsAlphabetically" value="true"/>
2741
</module>
2842

43+
<!-- Checks for common coding problems: https://checkstyle.org/config_coding.html -->
44+
<module name="DeclarationOrder"/>
45+
46+
<!-- Checks for whitespace: https://checkstyle.org/config_whitespace.html -->
2947
<module name="EmptyLineSeparator">
3048
<property name="tokens"
3149
value="IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF"/>
3250
<property name="allowMultipleEmptyLines" value="false"/>
3351
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
3452
</module>
35-
36-
<module name="DeclarationOrder"/>
37-
38-
<!-- RCULRY causes issues if classes are nested within arrays, therefore not activated -->
3953
<module name="WhitespaceAround">
54+
<!-- RCULRY causes issues if classes are nested within arrays, therefore not activated -->
4055
<property name="tokens"
4156
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV,
4257
DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
@@ -46,18 +61,12 @@
4661
SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
4762
</module>
4863

64+
<!-- Checks for Naming Conventions: https://checkstyle.org/config_naming.html -->
4965
<module name="ConstantName">
5066
<property name="format" value="^log(ger)?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
5167
</module>
52-
53-
<module name="NeedBraces"/>
54-
</module>
5568

56-
<module name="SuppressionFilter">
57-
<property name="file" value="${config_loc}/suppressions.xml"/>
58-
</module>
59-
60-
<module name="BeforeExecutionExclusionFileFilter">
61-
<property name="fileNamePattern" value="module\-info\.java$"/>
69+
<!-- Checks for blocks: https://checkstyle.org/config_blocks.html -->
70+
<module name="NeedBraces"/>
6271
</module>
6372
</module>

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
import javafx.util.Callback;
1616

1717
/**
18-
* Taken from https://gist.github.com/lestard/011e9ed4433f9eb791a8
19-
*/
20-
21-
/**
18+
* @implNote Taken from https://gist.github.com/lestard/011e9ed4433f9eb791a8
2219
* @implNote As CheckBoxTreeItem extends TreeItem, this class will work for both.
2320
*/
2421
public class RecursiveTreeItem<T> extends CheckBoxTreeItem<T> {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private String doChangeCase(String s, FORMAT_MODE format) {
137137
* special with |colon|s.
138138
*
139139
* @param c
140-
* @param i the current position. It points to the opening brace
140+
* @param start the current position. It points to the opening brace
141141
* @param format
142142
* @return
143143
*/

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

-7
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ public static int getCharWidth(char c) {
167167
}
168168
}
169169

170-
/**
171-
*
172-
* @param toMeasure
173-
* @param warn
174-
* may-be-null
175-
* @return
176-
*/
177170
public static int width(String toMeasure) {
178171

179172
/*

0 commit comments

Comments
 (0)