Skip to content

Commit 4bb6455

Browse files
authored
chore: configure SpotBugs (#5122)
1 parent de18d0d commit 4bb6455

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ jobs:
3131
fail_ci_if_error: true
3232
- name: Checkstyle
3333
run: mvn checkstyle:check
34+
- name: SpotBugs
35+
run: mvn spotbugs:check

pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@
114114
</dependency>
115115
</dependencies>
116116
</plugin>
117+
<plugin>
118+
<groupId>com.github.spotbugs</groupId>
119+
<artifactId>spotbugs-maven-plugin</artifactId>
120+
<version>4.8.4.0</version>
121+
<configuration>
122+
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
123+
<includeTests>true</includeTests>
124+
</configuration>
125+
</plugin>
117126
</plugins>
118127
</build>
119128
</project>

spotbugs-exclude.xml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<FindBugsFilter>
2+
<Match>
3+
<Bug pattern="DM_DEFAULT_ENCODING" />
4+
</Match>
5+
<Match>
6+
<Bug pattern="EI_EXPOSE_REP2" />
7+
</Match>
8+
<Match>
9+
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
10+
</Match>
11+
<Match>
12+
<Bug pattern="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW" />
13+
</Match>
14+
<Match>
15+
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" />
16+
</Match>
17+
<Match>
18+
<Bug pattern="VA_FORMAT_STRING_USES_NEWLINE" />
19+
</Match>
20+
<Match>
21+
<Bug pattern="SF_SWITCH_NO_DEFAULT" />
22+
</Match>
23+
<Match>
24+
<Bug pattern="UC_USELESS_OBJECT" />
25+
</Match>
26+
<Match>
27+
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
28+
</Match>
29+
<Match>
30+
<Bug pattern="DM_NEXTINT_VIA_NEXTDOUBLE" />
31+
</Match>
32+
<Match>
33+
<Bug pattern="NM_CLASS_NAMING_CONVENTION" />
34+
</Match>
35+
<Match>
36+
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC" />
37+
</Match>
38+
<Match>
39+
<Bug pattern="EI_EXPOSE_REP" />
40+
</Match>
41+
<Match>
42+
<Bug pattern="EI_EXPOSE_REP" />
43+
</Match>
44+
<Match>
45+
<Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION" />
46+
</Match>
47+
<Match>
48+
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
49+
</Match>
50+
<Match>
51+
<Bug pattern="MS_PKGPROTECT" />
52+
</Match>
53+
<Match>
54+
<Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
55+
</Match>
56+
<Match>
57+
<Bug pattern="INT_BAD_REM_BY_1" />
58+
</Match>
59+
<Match>
60+
<Bug pattern="NM_METHOD_NAMING_CONVENTION" />
61+
</Match>
62+
<Match>
63+
<Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE" />
64+
</Match>
65+
<Match>
66+
<Bug pattern="FE_FLOATING_POINT_EQUALITY" />
67+
</Match>
68+
<Match>
69+
<Bug pattern="CT_CONSTRUCTOR_THROW" />
70+
</Match>
71+
<Match>
72+
<Bug pattern="URF_UNREAD_FIELD" />
73+
</Match>
74+
<Match>
75+
<Bug pattern="RC_REF_COMPARISON" />
76+
</Match>
77+
<Match>
78+
<Bug pattern="MS_EXPOSE_REP" />
79+
</Match>
80+
<Match>
81+
<Bug pattern="IM_BAD_CHECK_FOR_ODD" />
82+
</Match>
83+
<Match>
84+
<Bug pattern="WMI_WRONG_MAP_ITERATOR" />
85+
</Match>
86+
<Match>
87+
<Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING" />
88+
</Match>
89+
<Match>
90+
<Bug pattern="MS_SHOULD_BE_FINAL" />
91+
</Match>
92+
<Match>
93+
<Bug pattern="UWF_UNWRITTEN_FIELD" />
94+
</Match>
95+
<Match>
96+
<Bug pattern="SS_SHOULD_BE_STATIC" />
97+
</Match>
98+
<Match>
99+
<Bug pattern="HE_EQUALS_USE_HASHCODE" />
100+
</Match>
101+
<Match>
102+
<Bug pattern="IT_NO_SUCH_ELEMENT" />
103+
</Match>
104+
<Match>
105+
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
106+
</Match>
107+
<Match>
108+
<Bug pattern="UWF_NULL_FIELD" />
109+
</Match>
110+
<Match>
111+
<Bug pattern="NP_UNWRITTEN_FIELD" />
112+
</Match>
113+
<Match>
114+
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
115+
</Match>
116+
<Match>
117+
<Bug pattern="NP_IMMEDIATE_DEREFERENCE_OF_READLINE" />
118+
</Match>
119+
<Match>
120+
<Bug pattern="RV_RETURN_VALUE_IGNORED" />
121+
</Match>
122+
<Match>
123+
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS" />
124+
</Match>
125+
<Match>
126+
<Bug pattern="SA_FIELD_SELF_ASSIGNMENT" />
127+
</Match>
128+
<Match>
129+
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
130+
</Match>
131+
<Match>
132+
<Bug pattern="RV_ABSOLUTE_VALUE_OF_HASHCODE" />
133+
</Match>
134+
</FindBugsFilter>

0 commit comments

Comments
 (0)