Skip to content

Commit

Permalink
Updating to checkstyle 10.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbylight committed Dec 4, 2024
1 parent 98d729a commit a3c5171
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public String toString() {
/**
* Action that actually updates the summary text displayed.
*/
private class TimerAction extends AbstractAction {
private final class TimerAction extends AbstractAction {

private Completion completion;
private String anchor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ else if (oldTriggerAction != null) {
* Listens for LookAndFeel changes and updates the various popup windows
* involved in auto-completion accordingly.
*/
private class LookAndFeelChangeListener implements PropertyChangeListener {
private final class LookAndFeelChangeListener implements PropertyChangeListener {

@Override
public void propertyChange(PropertyChangeEvent e) {
Expand Down Expand Up @@ -1486,7 +1486,7 @@ public void actionPerformed(ActionEvent e) {
* Listens for events in the parent window of the text component with
* auto-completion enabled.
*/
private class ParentWindowListener extends ComponentAdapter implements
private final class ParentWindowListener extends ComponentAdapter implements
WindowFocusListener {

public void addTo(Window w) {
Expand Down Expand Up @@ -1530,7 +1530,7 @@ public void windowLostFocus(WindowEvent e) {
/**
* Listens for events from the popup window.
*/
private class PopupWindowListener extends ComponentAdapter {
private final class PopupWindowListener extends ComponentAdapter {

@Override
public void componentHidden(ComponentEvent e) {
Expand Down Expand Up @@ -1558,7 +1558,7 @@ public void uninstall(AutoCompletePopupWindow popupWindow) {
/**
* Listens for events from the text component we're installed on.
*/
private class TextComponentListener extends FocusAdapter implements
private final class TextComponentListener extends FocusAdapter implements
HierarchyListener {

void addTo(JTextComponent tc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public void updateUI() {
/**
* Called when the user presses Enter while entering parameters.
*/
private class GotoEndAction extends AbstractAction {
private final class GotoEndAction extends AbstractAction {

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

@Override
public void actionPerformed(ActionEvent e) {
Expand Down Expand Up @@ -969,7 +969,7 @@ public int getCount(String text, char ch) {
/**
* Action performed when the user hits the escape key.
*/
private class HideAction extends AbstractAction {
private final class HideAction extends AbstractAction {

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

private boolean markOccurrencesEnabled;
Expand Down Expand Up @@ -1209,7 +1209,7 @@ else if (oldAction!=null) {
/**
* Action performed when the user hits the tab key.
*/
private class NextParamAction extends AbstractAction {
private final class NextParamAction extends AbstractAction {

@Override
public void actionPerformed(ActionEvent e) {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ private static class ParamCopyInfo {
/**
* Action performed when the user hits shift+tab.
*/
private class PrevParamAction extends AbstractAction {
private final class PrevParamAction extends AbstractAction {

@Override
public void actionPerformed(ActionEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void resetProvider() {
* <code>CompletionProvider</code> is displayed based on the context in
* which the user presses the trigger key.
*/
private class CycleAutoCompleteAction extends AutoCompleteAction {
private final class CycleAutoCompleteAction extends AutoCompleteAction {

@Override
public void actionPerformed(ActionEvent e) {
Expand All @@ -141,7 +141,7 @@ public void actionPerformed(ActionEvent e) {
//nothing to do, just let the current provider display
break;
}
else{
else {
//search for non-empty completions
advanceProvider();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void updateUI() {
* Listens for mouse events on this panel and resizes the parent window
* appropriately.
*/
private class MouseHandler extends MouseInputAdapter {
private final class MouseHandler extends MouseInputAdapter {

private Point origPos;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* This library is distributed under a modified BSD license. See the included
* LICENSE.md file for details.
*/
package org.fife.ui.autocomplete;

import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* This library is distributed under a modified BSD license. See the included
* LICENSE.md file for details.
*/
/**
* The auto-completion library.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* This library is distributed under a modified BSD license. See the included
* LICENSE.md file for details.
*/
/**
* A package that demonstrates features of the AutoComplete library.
*/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ subprojects {
}

checkstyle {
toolVersion = '9.3'
toolVersion = '10.20.1'
configDirectory = file("$rootProject.projectDir/config/checkstyle")
}

Expand Down
59 changes: 33 additions & 26 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
<!--<module name="FileTabCharacter"/>-->

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

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

<module name="TreeWalker">

Expand Down Expand Up @@ -127,8 +127,8 @@

<module name="JavadocContentLocationCheck"/>

<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.sourceforge.io/config_naming.html -->
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.sourceforge.io/checks/naming/index.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
Expand All @@ -139,8 +139,8 @@
<module name="StaticVariableName"/>
<module name="TypeName"/>

<!-- Checks for annotations. -->
<!-- See https://checkstyle.sourceforge.io/config_annotation.html -->
<!-- Checks for annotations. -->
<!-- See https://checkstyle.sourceforge.io/checks/annotation/index.html -->
<module name="AnnotationLocation"/>
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
Expand All @@ -154,8 +154,8 @@
<module name="UnusedImports"/>


<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.sourceforge.io/checks/sizes/index.html -->
<module name="MethodLength">
<property name="max" value="300"/>
</module>
Expand All @@ -165,8 +165,8 @@
</module>


<!-- Checks for whitespace -->
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
<!-- Checks for whitespace -->
<!-- See https://checkstyle.sourceforge.io/checks/whitespace/index.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
Expand All @@ -177,6 +177,12 @@
</module>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<!-- TODO: Add COMMA and possibly SEMI, but it'll be a big diff -->
<property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_WHILE, LITERAL_DO, LITERAL_FOR,
LITERAL_FINALLY, LITERAL_CATCH, DO_WHILE, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY,
LITERAL_CASE, LAMBDA, LITERAL_WHEN"/>
</module>
<!--<module name="WhitespaceAround"/>-->


Expand All @@ -186,8 +192,8 @@
<module name="RedundantModifier"/>


<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.sourceforge.io/config_blocks.html -->
<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.sourceforge.io/checks/blocks/index.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
Expand All @@ -196,13 +202,14 @@
</module>
<module name="RightCurly"> <!-- Right curlies should be alone in if/else -->
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_ELSE, METHOD_DEF"/>
<property name="tokens" value="CLASS_DEF, ENUM_DEF, LITERAL_ELSE, LITERAL_SWITCH, METHOD_DEF"/>
</module>

<!-- Checks for common coding problems -->
<!-- See https://checkstyle.sourceforge.io/config_coding.html -->
<!-- Checks for common coding problems -->
<!-- See https://checkstyle.sourceforge.io/checks/coding/index.html -->
<!--<module name="AvoidInlineConditionals"/>-->
<!--<module name="EmptyStatement"/> Removed to allow "while (doSomething());" -->
<module name="ConstructorsDeclarationGrouping"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
Expand All @@ -229,8 +236,8 @@
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedLocalVariable"/>

<!-- Checks for class design -->
<!-- See https://checkstyle.sourceforge.io/config_design.html -->
<!-- Checks for class design -->
<!-- See https://checkstyle.sourceforge.io/checks/design/index.html -->
<!--<module name="DesignForExtension"/>-->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
Expand All @@ -241,8 +248,8 @@
</module>


<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.sourceforge.io/checks/misc/index.html -->
<module name="ArrayTypeStyle"/>
<module name="AvoidEscapedUnicodeCharacters"/>
<module name="CommentsIndentation"/>
Expand All @@ -251,7 +258,7 @@
<module name="UpperEll"/>

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

</module>
Expand Down
1 change: 1 addition & 0 deletions config/checkstyle/javaHeader.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*

0 comments on commit a3c5171

Please sign in to comment.