Skip to content

Commit a3c5171

Browse files
committed
Updating to checkstyle 10.20.1
1 parent 98d729a commit a3c5171

File tree

11 files changed

+61
-41
lines changed

11 files changed

+61
-41
lines changed

AutoComplete/src/main/java/org/fife/ui/autocomplete/AutoCompleteDescWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public String toString() {
553553
/**
554554
* Action that actually updates the summary text displayed.
555555
*/
556-
private class TimerAction extends AbstractAction {
556+
private final class TimerAction extends AbstractAction {
557557

558558
private Completion completion;
559559
private String anchor;

AutoComplete/src/main/java/org/fife/ui/autocomplete/AutoCompletion.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ else if (oldTriggerAction != null) {
14371437
* Listens for LookAndFeel changes and updates the various popup windows
14381438
* involved in auto-completion accordingly.
14391439
*/
1440-
private class LookAndFeelChangeListener implements PropertyChangeListener {
1440+
private final class LookAndFeelChangeListener implements PropertyChangeListener {
14411441

14421442
@Override
14431443
public void propertyChange(PropertyChangeEvent e) {
@@ -1486,7 +1486,7 @@ public void actionPerformed(ActionEvent e) {
14861486
* Listens for events in the parent window of the text component with
14871487
* auto-completion enabled.
14881488
*/
1489-
private class ParentWindowListener extends ComponentAdapter implements
1489+
private final class ParentWindowListener extends ComponentAdapter implements
14901490
WindowFocusListener {
14911491

14921492
public void addTo(Window w) {
@@ -1530,7 +1530,7 @@ public void windowLostFocus(WindowEvent e) {
15301530
/**
15311531
* Listens for events from the popup window.
15321532
*/
1533-
private class PopupWindowListener extends ComponentAdapter {
1533+
private final class PopupWindowListener extends ComponentAdapter {
15341534

15351535
@Override
15361536
public void componentHidden(ComponentEvent e) {
@@ -1558,7 +1558,7 @@ public void uninstall(AutoCompletePopupWindow popupWindow) {
15581558
/**
15591559
* Listens for events from the text component we're installed on.
15601560
*/
1561-
private class TextComponentListener extends FocusAdapter implements
1561+
private final class TextComponentListener extends FocusAdapter implements
15621562
HierarchyListener {
15631563

15641564
void addTo(JTextComponent tc) {

AutoComplete/src/main/java/org/fife/ui/autocomplete/ParameterizedCompletionContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public void updateUI() {
867867
/**
868868
* Called when the user presses Enter while entering parameters.
869869
*/
870-
private class GotoEndAction extends AbstractAction {
870+
private final class GotoEndAction extends AbstractAction {
871871

872872
@Override
873873
public void actionPerformed(ActionEvent e) {
@@ -912,7 +912,7 @@ private Action getDefaultEnterAction(JTextComponent tc) {
912912
* Called when the user types the character marking the closing of the
913913
* parameter list, such as '<code>)</code>'.
914914
*/
915-
private class ClosingAction extends AbstractAction {
915+
private final class ClosingAction extends AbstractAction {
916916

917917
@Override
918918
public void actionPerformed(ActionEvent e) {
@@ -969,7 +969,7 @@ public int getCount(String text, char ch) {
969969
/**
970970
* Action performed when the user hits the escape key.
971971
*/
972-
private class HideAction extends AbstractAction {
972+
private final class HideAction extends AbstractAction {
973973

974974
@Override
975975
public void actionPerformed(ActionEvent e) {
@@ -993,7 +993,7 @@ public void actionPerformed(ActionEvent e) {
993993
* Listens for various events in the text component while this tool tip
994994
* is visible.
995995
*/
996-
private class Listener implements FocusListener, CaretListener,
996+
private final class Listener implements FocusListener, CaretListener,
997997
DocumentListener {
998998

999999
private boolean markOccurrencesEnabled;
@@ -1209,7 +1209,7 @@ else if (oldAction!=null) {
12091209
/**
12101210
* Action performed when the user hits the tab key.
12111211
*/
1212-
private class NextParamAction extends AbstractAction {
1212+
private final class NextParamAction extends AbstractAction {
12131213

12141214
@Override
12151215
public void actionPerformed(ActionEvent e) {
@@ -1238,7 +1238,7 @@ private static class ParamCopyInfo {
12381238
/**
12391239
* Action performed when the user hits shift+tab.
12401240
*/
1241-
private class PrevParamAction extends AbstractAction {
1241+
private final class PrevParamAction extends AbstractAction {
12421242

12431243
@Override
12441244
public void actionPerformed(ActionEvent e) {

AutoComplete/src/main/java/org/fife/ui/autocomplete/RoundRobinAutoCompletion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void resetProvider() {
116116
* <code>CompletionProvider</code> is displayed based on the context in
117117
* which the user presses the trigger key.
118118
*/
119-
private class CycleAutoCompleteAction extends AutoCompleteAction {
119+
private final class CycleAutoCompleteAction extends AutoCompleteAction {
120120

121121
@Override
122122
public void actionPerformed(ActionEvent e) {
@@ -141,7 +141,7 @@ public void actionPerformed(ActionEvent e) {
141141
//nothing to do, just let the current provider display
142142
break;
143143
}
144-
else{
144+
else {
145145
//search for non-empty completions
146146
advanceProvider();
147147
}

AutoComplete/src/main/java/org/fife/ui/autocomplete/SizeGrip.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void updateUI() {
205205
* Listens for mouse events on this panel and resizes the parent window
206206
* appropriately.
207207
*/
208-
private class MouseHandler extends MouseInputAdapter {
208+
private final class MouseHandler extends MouseInputAdapter {
209209

210210
private Point origPos;
211211

AutoComplete/src/main/java/org/fife/ui/autocomplete/SuppressFBWarnings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* This library is distributed under a modified BSD license. See the included
3+
* LICENSE.md file for details.
4+
*/
15
package org.fife.ui.autocomplete;
26

37
import java.lang.annotation.Retention;

AutoComplete/src/main/java/org/fife/ui/autocomplete/package-info.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* This library is distributed under a modified BSD license. See the included
3+
* LICENSE.md file for details.
4+
*/
15
/**
26
* The auto-completion library.
37
*/

AutoCompleteDemo/src/main/java/org/fife/ui/autocomplete/demo/package-info.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* This library is distributed under a modified BSD license. See the included
3+
* LICENSE.md file for details.
4+
*/
15
/**
26
* A package that demonstrates features of the AutoComplete library.
37
*/

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ subprojects {
4747
}
4848

4949
checkstyle {
50-
toolVersion = '9.3'
50+
toolVersion = '10.20.1'
5151
configDirectory = file("$rootProject.projectDir/config/checkstyle")
5252
}
5353

config/checkstyle/checkstyle.xml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@
7575
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
7676
<!--<module name="FileTabCharacter"/>-->
7777

78-
<!-- Miscellaneous other checks. -->
79-
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
78+
<!-- Miscellaneous other checks. -->
79+
<!-- See https://checkstyle.sourceforge.io/checks/regexp/regexpsingleline.html -->
8080
<module name="RegexpSingleline">
8181
<property name="format" value="\s+$"/>
8282
<property name="minimum" value="0"/>
8383
<property name="maximum" value="0"/>
8484
<property name="message" value="Line has trailing spaces."/>
8585
</module>
8686

87-
<!-- Checks for Headers -->
88-
<!-- See https://checkstyle.sourceforge.io/config_header.html -->
89-
<!-- <module name="Header"> -->
90-
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
91-
<!-- <property name="fileExtensions" value="java"/> -->
92-
<!-- </module> -->
87+
<!-- Checks for Headers -->
88+
<!-- See https://checkstyle.sourceforge.io/checks/header/index.html -->
89+
<module name="Header">
90+
<property name="headerFile" value="${config_loc}/javaHeader.txt"/>
91+
<property name="fileExtensions" value="java"/>
92+
</module>
9393

9494
<module name="TreeWalker">
9595

@@ -127,8 +127,8 @@
127127

128128
<module name="JavadocContentLocationCheck"/>
129129

130-
<!-- Checks for Naming Conventions. -->
131-
<!-- See https://checkstyle.sourceforge.io/config_naming.html -->
130+
<!-- Checks for Naming Conventions. -->
131+
<!-- See https://checkstyle.sourceforge.io/checks/naming/index.html -->
132132
<module name="ConstantName"/>
133133
<module name="LocalFinalVariableName"/>
134134
<module name="LocalVariableName"/>
@@ -139,8 +139,8 @@
139139
<module name="StaticVariableName"/>
140140
<module name="TypeName"/>
141141

142-
<!-- Checks for annotations. -->
143-
<!-- See https://checkstyle.sourceforge.io/config_annotation.html -->
142+
<!-- Checks for annotations. -->
143+
<!-- See https://checkstyle.sourceforge.io/checks/annotation/index.html -->
144144
<module name="AnnotationLocation"/>
145145
<module name="AnnotationUseStyle"/>
146146
<module name="MissingDeprecated"/>
@@ -154,8 +154,8 @@
154154
<module name="UnusedImports"/>
155155

156156

157-
<!-- Checks for Size Violations. -->
158-
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
157+
<!-- Checks for Size Violations. -->
158+
<!-- See https://checkstyle.sourceforge.io/checks/sizes/index.html -->
159159
<module name="MethodLength">
160160
<property name="max" value="300"/>
161161
</module>
@@ -165,8 +165,8 @@
165165
</module>
166166

167167

168-
<!-- Checks for whitespace -->
169-
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
168+
<!-- Checks for whitespace -->
169+
<!-- See https://checkstyle.sourceforge.io/checks/whitespace/index.html -->
170170
<module name="EmptyForIteratorPad"/>
171171
<module name="GenericWhitespace"/>
172172
<module name="MethodParamPad"/>
@@ -177,6 +177,12 @@
177177
</module>
178178
<module name="ParenPad"/>
179179
<module name="TypecastParenPad"/>
180+
<module name="WhitespaceAfter">
181+
<!-- TODO: Add COMMA and possibly SEMI, but it'll be a big diff -->
182+
<property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR,
183+
LITERAL_FINALLY, LITERAL_CATCH, DO_WHILE, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY,
184+
LITERAL_CASE, LAMBDA, LITERAL_WHEN"/>
185+
</module>
180186
<!--<module name="WhitespaceAround"/>-->
181187

182188

@@ -186,8 +192,8 @@
186192
<module name="RedundantModifier"/>
187193

188194

189-
<!-- Checks for blocks. You know, those {}'s -->
190-
<!-- See https://checkstyle.sourceforge.io/config_blocks.html -->
195+
<!-- Checks for blocks. You know, those {}'s -->
196+
<!-- See https://checkstyle.sourceforge.io/checks/blocks/index.html -->
191197
<module name="AvoidNestedBlocks"/>
192198
<module name="EmptyBlock"/>
193199
<module name="LeftCurly"/>
@@ -196,13 +202,14 @@
196202
</module>
197203
<module name="RightCurly"> <!-- Right curlies should be alone in if/else -->
198204
<property name="option" value="alone"/>
199-
<property name="tokens" value="LITERAL_ELSE, METHOD_DEF"/>
205+
<property name="tokens" value="CLASS_DEF, ENUM_DEF, LITERAL_ELSE, LITERAL_SWITCH, METHOD_DEF"/>
200206
</module>
201207

202-
<!-- Checks for common coding problems -->
203-
<!-- See https://checkstyle.sourceforge.io/config_coding.html -->
208+
<!-- Checks for common coding problems -->
209+
<!-- See https://checkstyle.sourceforge.io/checks/coding/index.html -->
204210
<!--<module name="AvoidInlineConditionals"/>-->
205211
<!--<module name="EmptyStatement"/> Removed to allow "while (doSomething());" -->
212+
<module name="ConstructorsDeclarationGrouping"/>
206213
<module name="EqualsAvoidNull"/>
207214
<module name="EqualsHashCode"/>
208215
<module name="ExplicitInitialization"/>
@@ -229,8 +236,8 @@
229236
<module name="UnnecessarySemicolonInTryWithResources"/>
230237
<module name="UnusedLocalVariable"/>
231238

232-
<!-- Checks for class design -->
233-
<!-- See https://checkstyle.sourceforge.io/config_design.html -->
239+
<!-- Checks for class design -->
240+
<!-- See https://checkstyle.sourceforge.io/checks/design/index.html -->
234241
<!--<module name="DesignForExtension"/>-->
235242
<module name="FinalClass"/>
236243
<module name="HideUtilityClassConstructor"/>
@@ -241,8 +248,8 @@
241248
</module>
242249

243250

244-
<!-- Miscellaneous other checks. -->
245-
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
251+
<!-- Miscellaneous other checks. -->
252+
<!-- See https://checkstyle.sourceforge.io/checks/misc/index.html -->
246253
<module name="ArrayTypeStyle"/>
247254
<module name="AvoidEscapedUnicodeCharacters"/>
248255
<module name="CommentsIndentation"/>
@@ -251,7 +258,7 @@
251258
<module name="UpperEll"/>
252259

253260
<!-- Checks for metrics. -->
254-
<!-- See https://checkstyle.sourceforge.io/config_metrics.html -->
261+
<!-- See https://checkstyle.sourceforge.io/checks/metrics/index.html -->
255262
<!-- <module name="CyclomaticComplexity"/>-->
256263

257264
</module>

0 commit comments

Comments
 (0)