Skip to content

Commit 2fcbc69

Browse files
zhtttylzsteveloughranslfan1989szetszwo
authored
HADOOP-19731. Fix SpotBugs warnings introduced after SpotBugs version upgrade. (#8053)
* HADOOP-19731. Fix SpotBugs warnings introduced after SpotBugs version upgrade. Co-authored-by: Steve Loughran <[email protected]> Co-authored-by: Shilun Fan <[email protected]> Co-authored-by: Tsz-wo Sze <[email protected]> Reviewed-by: Steve Loughran <[email protected]> Reviewed-by: Shilun Fan <[email protected]> Reviewed-by: Tsz-wo Sze <[email protected]>
1 parent 7b8b3e4 commit 2fcbc69

File tree

32 files changed

+389
-41
lines changed

32 files changed

+389
-41
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. See accompanying LICENSE file.
14+
-->
15+
<FindBugsFilter>
16+
<Match>
17+
<Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE,
18+
AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE,
19+
AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
20+
</Match>
21+
<Match>
22+
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
23+
</Match>
24+
<Match>
25+
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
26+
</Match>
27+
<Match>
28+
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
29+
</Match>
30+
<Match>
31+
<Bug pattern="SING_SINGLETON_IMPLEMENTS_SERIALIZABLE"/>
32+
</Match>
33+
<Match>
34+
<Bug pattern="NN_NAKED_NOTIFY"/>
35+
</Match>
36+
<Match>
37+
<Bug pattern="MS_EXPOSE_REP"/>
38+
</Match>
39+
<Match>
40+
<Bug pattern="HSM_HIDING_METHOD"/>
41+
</Match>
42+
<Match>
43+
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
44+
</Match>
45+
<Match>
46+
<Bug pattern="DCN_NULLPOINTER_EXCEPTION"/>
47+
</Match>
48+
<Match>
49+
<Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/>
50+
</Match>
51+
<Match>
52+
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
53+
</Match>
54+
<Match>
55+
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
56+
</Match>
57+
<Match>
58+
<Bug pattern="SS_SHOULD_BE_STATIC"/>
59+
</Match>
60+
<Match>
61+
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
62+
</Match>
63+
<Match>
64+
<Bug pattern="REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS"/>
65+
</Match>
66+
<Match>
67+
<Bug pattern="SING_SINGLETON_GETTER_NOT_SYNCHRONIZED"/>
68+
</Match>
69+
</FindBugsFilter>

hadoop-cloud-storage-project/hadoop-cos/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@
6969
<artifactId>spotbugs-maven-plugin</artifactId>
7070
<configuration>
7171
<xmlOutput>true</xmlOutput>
72-
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
73-
</excludeFilterFile>
72+
<excludeFilterFiles>
73+
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
74+
</excludeFilterFile>
75+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
76+
</excludeFilterFile>
77+
</excludeFilterFiles>
7478
<effort>Max</effort>
7579
</configuration>
7680
</plugin>

hadoop-cloud-storage-project/hadoop-huaweicloud/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@
6464
<artifactId>spotbugs-maven-plugin</artifactId>
6565
<configuration>
6666
<xmlOutput>true</xmlOutput>
67-
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
68-
</excludeFilterFile>
67+
<excludeFilterFiles>
68+
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
69+
</excludeFilterFile>
70+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
71+
</excludeFilterFile>
72+
</excludeFilterFiles>
6973
<effort>Max</effort>
7074
</configuration>
7175
</plugin>

hadoop-cloud-storage-project/hadoop-tos/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@
174174
<artifactId>spotbugs-maven-plugin</artifactId>
175175
<configuration>
176176
<xmlOutput>true</xmlOutput>
177-
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
178-
</excludeFilterFile>
177+
<excludeFilterFiles>
178+
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
179+
</excludeFilterFile>
180+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
181+
</excludeFilterFile>
182+
</excludeFilterFiles>
179183
<effort>Max</effort>
180184
</configuration>
181185
</plugin>

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@
267267
<groupId>com.github.spotbugs</groupId>
268268
<artifactId>spotbugs-maven-plugin</artifactId>
269269
<configuration>
270-
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
270+
<excludeFilterFiles>
271+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
272+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
273+
</excludeFilterFile>
274+
</excludeFilterFiles>
271275
</configuration>
272276
</plugin>
273277
</plugins>

hadoop-common-project/hadoop-kms/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,12 @@
244244
<groupId>com.github.spotbugs</groupId>
245245
<artifactId>spotbugs-maven-plugin</artifactId>
246246
<configuration>
247-
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
248-
</excludeFilterFile>
247+
<excludeFilterFiles>
248+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
249+
</excludeFilterFile>
250+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
251+
</excludeFilterFile>
252+
</excludeFilterFiles>
249253
</configuration>
250254
</plugin>
251255
</plugins>

hadoop-common-project/hadoop-minikdc/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@
7676
<groupId>com.github.spotbugs</groupId>
7777
<artifactId>spotbugs-maven-plugin</artifactId>
7878
<configuration>
79-
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
80-
</excludeFilterFile>
79+
<excludeFilterFiles>
80+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
81+
</excludeFilterFile>
82+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
83+
</excludeFilterFile>
84+
</excludeFilterFiles>
8185
</configuration>
8286
</plugin>
8387
</plugins>

hadoop-common-project/hadoop-nfs/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,12 @@
125125
<groupId>com.github.spotbugs</groupId>
126126
<artifactId>spotbugs-maven-plugin</artifactId>
127127
<configuration>
128-
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
129-
</excludeFilterFile>
128+
<excludeFilterFiles>
129+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
130+
</excludeFilterFile>
131+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
132+
</excludeFilterFile>
133+
</excludeFilterFiles>
130134
</configuration>
131135
</plugin>
132136
</plugins>

hadoop-common-project/hadoop-registry/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@
193193
<artifactId>spotbugs-maven-plugin</artifactId>
194194
<configuration>
195195
<xmlOutput>true</xmlOutput>
196-
<excludeFilterFile>${project.basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
196+
<excludeFilterFiles>
197+
<excludeFilterFile>${project.basedir}/dev-support/findbugs-exclude.xml
198+
</excludeFilterFile>
199+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
200+
</excludeFilterFile>
201+
</excludeFilterFiles>
197202
<effort>Max</effort>
198203
</configuration>
199204
</plugin>

hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,11 @@
365365
<groupId>com.github.spotbugs</groupId>
366366
<artifactId>spotbugs-maven-plugin</artifactId>
367367
<configuration>
368-
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
368+
<excludeFilterFiles>
369+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
370+
<excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml
371+
</excludeFilterFile>
372+
</excludeFilterFiles>
369373
</configuration>
370374
</plugin>
371375
</plugins>

0 commit comments

Comments
 (0)