Skip to content

Commit 2cca29d

Browse files
committed
Enforce the checkstyle FinalClass rule
1 parent 029433a commit 2cca29d

89 files changed

Lines changed: 258 additions & 275 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

checkstyle.xml

Lines changed: 169 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -3,193 +3,176 @@
33
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
44
"https://checkstyle.org/dtds/configuration_1_3.dtd">
55

6-
<!--
7-
8-
Checkstyle configuration that checks the sun coding conventions from:
9-
10-
- the Java Language Specification at
11-
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
12-
13-
- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
14-
15-
- the Javadoc guidelines at
16-
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
17-
18-
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
19-
20-
- some best practices
21-
22-
Checkstyle is very configurable. Be sure to read the documentation at
23-
https://checkstyle.org (or in your downloaded distribution).
24-
25-
Most Checks are configurable, be sure to consult the documentation.
26-
27-
To completely disable a check, just comment it out or delete it from the file.
28-
To suppress certain violations please review suppression filters.
29-
30-
Finally, it is worth reading the documentation.
31-
32-
-->
6+
<!-- Checkstyle configuration that checks the sun coding conventions from:
7+
- the Java Language Specification at https://docs.oracle.com/javase/specs/jls/se11/html/index.html
8+
- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
9+
- the Javadoc guidelines at https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
10+
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/ -
11+
some best practices Checkstyle is very configurable. Be sure to read the
12+
documentation at https://checkstyle.org (or in your downloaded distribution).
13+
Most Checks are configurable, be sure to consult the documentation. To completely
14+
disable a check, just comment it out or delete it from the file. To suppress
15+
certain violations please review suppression filters. Finally, it is worth
16+
reading the documentation. -->
3317

3418
<module name="Checker">
35-
<!--
36-
If you set the basedir property below, then all reported file
37-
names will be relative to the specified directory. See
38-
https://checkstyle.org/config.html#Checker
39-
40-
<property name="basedir" value="${basedir}"/>
41-
-->
42-
<property name="severity" value="error"/>
43-
44-
<property name="fileExtensions" value="java, properties, xml"/>
45-
46-
<!-- Excludes all 'module-info.java' files -->
47-
<!-- See https://checkstyle.org/config_filefilters.html -->
48-
<module name="BeforeExecutionExclusionFileFilter">
49-
<property name="fileNamePattern" value="module\-info\.java$"/>
50-
</module>
51-
52-
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
53-
<module name="SuppressionFilter">
54-
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
55-
default="checkstyle-suppressions.xml" />
56-
<property name="optional" value="true"/>
57-
</module>
58-
59-
<!-- Checks that a package-info.java file exists for each package. -->
60-
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
61-
<!-- TODO: <module name="JavadocPackage"/> -->
62-
63-
<!-- Checks whether files end with a new line. -->
64-
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
65-
<module name="NewlineAtEndOfFile"/>
66-
67-
<!-- Checks that property files contain the same keys. -->
68-
<!-- See https://checkstyle.org/config_misc.html#Translation -->
69-
<module name="Translation"/>
70-
71-
<!-- Checks for Size Violations. -->
72-
<!-- See https://checkstyle.org/config_sizes.html -->
73-
<module name="FileLength"/>
74-
<!-- we do not care about the line length: <module name="LineLength">
75-
<property name="fileExtensions" value="java"/>
76-
</module> -->
77-
78-
<!-- Checks for whitespace -->
79-
<!-- See https://checkstyle.org/config_whitespace.html -->
80-
<module name="FileTabCharacter"/>
81-
82-
<!-- Miscellaneous other checks. -->
83-
<!-- See https://checkstyle.org/config_misc.html -->
84-
<module name="RegexpSingleline">
85-
<property name="format" value="\s+$"/>
86-
<property name="minimum" value="0"/>
87-
<property name="maximum" value="0"/>
88-
<property name="message" value="Line has trailing spaces."/>
89-
</module>
90-
91-
<!-- Checks for Headers -->
92-
<!-- See https://checkstyle.org/config_header.html -->
93-
<!-- <module name="Header"> -->
94-
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
95-
<!-- <property name="fileExtensions" value="java"/> -->
96-
<!-- </module> -->
97-
98-
<module name="TreeWalker">
99-
100-
<!-- Checks for Javadoc comments. -->
101-
<!-- See https://checkstyle.org/config_javadoc.html -->
102-
<module name="InvalidJavadocPosition"/>
103-
<!-- <module name="JavadocMethod"/> -->
104-
<!-- <module name="JavadocType"/>
105-
<module name="JavadocVariable"/>
106-
<module name="JavadocStyle"/>
107-
<module name="MissingJavadocMethod"/> -->
108-
109-
<!-- Checks for Naming Conventions. -->
110-
<!-- See https://checkstyle.org/config_naming.html -->
111-
<module name="ConstantName"/>
112-
<module name="LocalFinalVariableName"/>
113-
<module name="LocalVariableName"/>
114-
<module name="MemberName"/>
115-
<module name="MethodName"/>
116-
<module name="PackageName"/>
117-
<module name="ParameterName"/>
118-
<module name="StaticVariableName"/>
119-
<module name="TypeName"/>
120-
121-
<!-- Checks for imports -->
122-
<!-- See https://checkstyle.org/config_imports.html -->
123-
<module name="AvoidStarImport"/>
124-
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
125-
<module name="RedundantImport"/>
126-
<module name="UnusedImports">
127-
<property name="processJavadoc" value="false"/>
128-
</module>
129-
130-
<!-- Checks for Size Violations. -->
131-
<!-- See https://checkstyle.org/config_sizes.html -->
132-
<!-- <module name="MethodLength"/> -->
133-
<!-- TODO: <module name="ParameterNumber"/> -->
134-
135-
<!-- Checks for whitespace -->
136-
<!-- See https://checkstyle.org/config_whitespace.html -->
137-
<module name="EmptyForIteratorPad"/>
138-
<module name="GenericWhitespace"/>
139-
<module name="MethodParamPad"/>
140-
<!-- <module name="NoWhitespaceAfter"/> -->
141-
<module name="NoWhitespaceBefore"/>
142-
<module name="OperatorWrap"/>
143-
<module name="ParenPad"/>
144-
<module name="TypecastParenPad"/>
145-
<module name="WhitespaceAfter"/>
146-
<module name="WhitespaceAround"/>
147-
148-
<!-- Modifier Checks -->
149-
<!-- See https://checkstyle.org/config_modifiers.html -->
150-
<module name="ModifierOrder"/>
151-
<module name="RedundantModifier"/>
152-
153-
<!-- Checks for blocks. You know, those {}'s -->
154-
<!-- See https://checkstyle.org/config_blocks.html -->
155-
<module name="AvoidNestedBlocks"/>
156-
<module name="EmptyBlock"/>
157-
<module name="LeftCurly"/>
158-
<module name="NeedBraces"/>
159-
<module name="RightCurly"/>
160-
161-
<!-- Checks for common coding problems -->
162-
<!-- See https://checkstyle.org/config_coding.html -->
163-
<module name="EmptyStatement"/>
164-
<module name="EqualsHashCode"/>
165-
<!-- TODO: <module name="HiddenField"/> -->
166-
<module name="IllegalInstantiation"/>
167-
<module name="InnerAssignment"/>
168-
<!-- TODO: enable and add exceptions: <module name="MagicNumber"/> -->
169-
<module name="MissingSwitchDefault"/>
170-
<module name="MultipleVariableDeclarations"/>
171-
<module name="SimplifyBooleanExpression"/>
172-
<module name="SimplifyBooleanReturn"/>
173-
174-
<!-- Checks for class design -->
175-
<!-- See https://checkstyle.org/config_design.html -->
176-
<!-- TODO: enable <module name="DesignForExtension"/> -->
177-
<!-- TODO: <module name="FinalClass"/> -->
178-
<module name="HideUtilityClassConstructor"/>
179-
<module name="InterfaceIsType"/>
180-
<!-- TODO: <module name="VisibilityModifier"/> -->
181-
182-
<!-- Miscellaneous other checks. -->
183-
<!-- See https://checkstyle.org/config_misc.html -->
184-
<module name="ArrayTypeStyle"/>
185-
<!-- <module name="FinalParameters"/> -->
186-
<!-- <module name="TodoComment"/> -->
187-
<module name="UpperEll"/>
188-
189-
190-
191-
<module name="SuppressionCommentFilter"/>
192-
193-
</module>
19+
<!-- If you set the basedir property below, then all reported file names
20+
will be relative to the specified directory. See https://checkstyle.org/config.html#Checker
21+
<property name="basedir" value="${basedir}"/> -->
22+
<property name="severity" value="error" />
23+
24+
<property name="fileExtensions" value="java, properties, xml" />
25+
26+
<!-- Excludes all 'module-info.java' files -->
27+
<!-- See https://checkstyle.org/config_filefilters.html -->
28+
<module name="BeforeExecutionExclusionFileFilter">
29+
<property name="fileNamePattern" value="module\-info\.java$" />
30+
</module>
31+
32+
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
33+
<module name="SuppressionFilter">
34+
<property name="file"
35+
value="${org.checkstyle.sun.suppressionfilter.config}"
36+
default="checkstyle-suppressions.xml" />
37+
<property name="optional" value="true" />
38+
</module>
39+
40+
<!-- Checks that a package-info.java file exists for each package. -->
41+
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
42+
<!-- TODO: <module name="JavadocPackage"/> -->
43+
44+
<!-- Checks whether files end with a new line. -->
45+
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
46+
<module name="NewlineAtEndOfFile" />
47+
48+
<!-- Checks that property files contain the same keys. -->
49+
<!-- See https://checkstyle.org/config_misc.html#Translation -->
50+
<module name="Translation" />
51+
52+
<!-- Checks for Size Violations. -->
53+
<!-- See https://checkstyle.org/config_sizes.html -->
54+
<module name="FileLength" />
55+
<!-- we do not care about the line length: <module name="LineLength"> <property
56+
name="fileExtensions" value="java"/> </module> -->
57+
58+
<!-- Checks for whitespace -->
59+
<!-- See https://checkstyle.org/config_whitespace.html -->
60+
<module name="FileTabCharacter" />
61+
62+
<!-- Miscellaneous other checks. -->
63+
<!-- See https://checkstyle.org/config_misc.html -->
64+
<module name="RegexpSingleline">
65+
<property name="format" value="\s+$" />
66+
<property name="minimum" value="0" />
67+
<property name="maximum" value="0" />
68+
<property name="message" value="Line has trailing spaces." />
69+
</module>
70+
71+
<!-- Checks for Headers -->
72+
<!-- See https://checkstyle.org/config_header.html -->
73+
<!-- <module name="Header"> -->
74+
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
75+
<!-- <property name="fileExtensions" value="java"/> -->
76+
<!-- </module> -->
77+
78+
<module name="TreeWalker">
79+
80+
<!-- Checks for Javadoc comments. -->
81+
<!-- See https://checkstyle.org/config_javadoc.html -->
82+
<module name="InvalidJavadocPosition" />
83+
<!-- <module name="JavadocMethod"/> -->
84+
<!-- <module name="JavadocType"/> <module name="JavadocVariable"/> <module
85+
name="JavadocStyle"/> <module name="MissingJavadocMethod"/> -->
86+
87+
<!-- Checks for Naming Conventions. -->
88+
<!-- See https://checkstyle.org/config_naming.html -->
89+
<module name="ConstantName" />
90+
<module name="LocalFinalVariableName" />
91+
<module name="LocalVariableName" />
92+
<module name="MemberName" />
93+
<module name="MethodName" />
94+
<module name="PackageName" />
95+
<module name="ParameterName" />
96+
<module name="StaticVariableName" />
97+
<module name="TypeName" />
98+
99+
<!-- Checks for imports -->
100+
<!-- See https://checkstyle.org/config_imports.html -->
101+
<module name="AvoidStarImport" />
102+
<module name="IllegalImport" /> <!-- defaults to sun.* packages -->
103+
<module name="RedundantImport" />
104+
<module name="UnusedImports">
105+
<property name="processJavadoc" value="false" />
106+
</module>
107+
108+
<!-- Checks for Size Violations. -->
109+
<!-- See https://checkstyle.org/config_sizes.html -->
110+
<!-- <module name="MethodLength"/> -->
111+
<!-- TODO: <module name="ParameterNumber"/> -->
112+
113+
<!-- Checks for whitespace -->
114+
<!-- See https://checkstyle.org/config_whitespace.html -->
115+
<module name="EmptyForIteratorPad" />
116+
<module name="GenericWhitespace" />
117+
<module name="MethodParamPad" />
118+
<!-- <module name="NoWhitespaceAfter"/> -->
119+
<module name="NoWhitespaceBefore" />
120+
<module name="OperatorWrap" />
121+
<module name="ParenPad" />
122+
<module name="TypecastParenPad" />
123+
<module name="WhitespaceAfter" />
124+
<module name="WhitespaceAround" />
125+
126+
<!-- Modifier Checks -->
127+
<!-- See https://checkstyle.org/config_modifiers.html -->
128+
<module name="ModifierOrder" />
129+
<module name="RedundantModifier" />
130+
131+
<!-- Checks for blocks. You know, those {}'s -->
132+
<!-- See https://checkstyle.org/config_blocks.html -->
133+
<module name="AvoidNestedBlocks" />
134+
<module name="EmptyBlock" />
135+
<module name="LeftCurly" />
136+
<module name="NeedBraces" />
137+
<module name="RightCurly" />
138+
139+
<!-- Checks for common coding problems -->
140+
<!-- See https://checkstyle.org/config_coding.html -->
141+
<module name="EmptyStatement" />
142+
<module name="EqualsHashCode" />
143+
<!-- TODO: <module name="HiddenField"/> -->
144+
<module name="IllegalInstantiation" />
145+
<module name="InnerAssignment" />
146+
<!-- TODO: enable and add exceptions: <module name="MagicNumber"/> -->
147+
<module name="MissingSwitchDefault" />
148+
<module name="MultipleVariableDeclarations" />
149+
<module name="SimplifyBooleanExpression" />
150+
<module name="SimplifyBooleanReturn" />
151+
152+
<!-- Checks for class design -->
153+
<!-- See https://checkstyle.org/config_design.html -->
154+
<!-- TODO: enable <module name="DesignForExtension"/> -->
155+
<module name="FinalClass" />
156+
<module name="HideUtilityClassConstructor" />
157+
<module name="InterfaceIsType" />
158+
<!-- TODO: <module name="VisibilityModifier"/> -->
159+
160+
<!-- Miscellaneous other checks. -->
161+
<!-- See https://checkstyle.org/config_misc.html -->
162+
<module name="ArrayTypeStyle" />
163+
<!-- <module name="FinalParameters"/> -->
164+
<!-- <module name="TodoComment"/> -->
165+
<module name="UpperEll" />
166+
167+
168+
169+
<module name="SuppressionCommentFilter" />
170+
171+
172+
173+
<!-- additional rules -->
174+
<module name="MissingOverride" />
175+
176+
</module>
194177

195178
</module>

src/sqlancer/LikeImplementationHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sqlancer;
22

3-
public class LikeImplementationHelper {
3+
public final class LikeImplementationHelper {
44

55
private LikeImplementationHelper() {
66
}

src/sqlancer/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import sqlancer.sqlite3.SQLite3Provider;
3838
import sqlancer.tidb.TiDBProvider;
3939

40-
public class Main {
40+
public final class Main {
4141

4242
public static final File LOG_DIRECTORY = new File("logs");
4343
public static volatile AtomicLong nrQueries = new AtomicLong();

src/sqlancer/clickhouse/ClickhouseErrors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.Set;
44

5-
public class ClickhouseErrors {
5+
public final class ClickhouseErrors {
66

77
private ClickhouseErrors() {
88
}

src/sqlancer/cockroachdb/CockroachDBBugs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sqlancer.cockroachdb;
22

3-
public class CockroachDBBugs {
3+
public final class CockroachDBBugs {
44

55
private CockroachDBBugs() {
66
}

0 commit comments

Comments
 (0)