Skip to content

Commit 04bd20d

Browse files
symiousYiyang Zhou
andauthored
RATIS-2352. Update spotbugs to 4.8.6 and suppress new warnings (#1307)
Co-authored-by: Yiyang Zhou <[email protected]>
1 parent 1b64422 commit 04bd20d

File tree

23 files changed

+598
-2
lines changed

23 files changed

+598
-2
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@
164164
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
165165
<cyclonedx.version>2.8.0</cyclonedx.version>
166166

167-
<spotbugs.version>4.2.1</spotbugs.version>
168-
<spotbugs-plugin.version>4.2.0</spotbugs-plugin.version>
167+
<spotbugs.version>4.8.6</spotbugs.version>
168+
<spotbugs-plugin.version>4.8.6.2</spotbugs-plugin.version>
169169

170170
<distMgmtSnapshotsId>apache.snapshots.https</distMgmtSnapshotsId>
171171
<distMgmtSnapshotsName>Apache Development Snapshot Repository</distMgmtSnapshotsName>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<FindBugsFilter>
18+
<Match>
19+
<Class name="org.apache.ratis.client.DataStreamClient$Builder" />
20+
<Bug pattern="EI_EXPOSE_REP2" />
21+
</Match>
22+
<Match>
23+
<Class name="org.apache.ratis.client.RaftClient$Builder" />
24+
<Bug pattern="EI_EXPOSE_REP2" />
25+
</Match>
26+
<Match>
27+
<Class name="org.apache.ratis.client.impl.DataStreamClientImpl$DataStreamOutputImpl" />
28+
<Bug pattern="EI_EXPOSE_REP" />
29+
</Match>
30+
<Match>
31+
<Class name="org.apache.ratis.client.impl.RaftClientRpcWithProxy" />
32+
<Bug pattern="EI_EXPOSE_REP" />
33+
</Match>
34+
<Match>
35+
<Class name="org.apache.ratis.client.retry.ClientRetryEvent" />
36+
<Bug pattern="EI_EXPOSE_REP" />
37+
</Match>
38+
<Match>
39+
<Class name="org.apache.ratis.client.retry.ClientRetryEvent" />
40+
<Bug pattern="EI_EXPOSE_REP2" />
41+
</Match>
42+
</FindBugsFilter>

ratis-client/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,15 @@
5959
<scope>test</scope>
6060
</dependency>
6161
</dependencies>
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<groupId>com.github.spotbugs</groupId>
66+
<artifactId>spotbugs-maven-plugin</artifactId>
67+
<configuration>
68+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
6273
</project>
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<FindBugsFilter>
18+
<Match>
19+
<Class name="org.apache.ratis.datastream.impl.DataStreamReplyByteBuffer$Builder" />
20+
<Bug pattern="EI_EXPOSE_REP2" />
21+
</Match>
22+
<Match>
23+
<Class name="org.apache.ratis.io.MD5Hash" />
24+
<Bug pattern="CT_CONSTRUCTOR_THROW" />
25+
</Match>
26+
<Match>
27+
<Class name="org.apache.ratis.protocol.GroupInfoReply" />
28+
<Bug pattern="EI_EXPOSE_REP2" />
29+
</Match>
30+
<Match>
31+
<Class name="org.apache.ratis.retry.MultipleLinearRandomRetry" />
32+
<Bug pattern="CT_CONSTRUCTOR_THROW" />
33+
</Match>
34+
<Match>
35+
<Class name="org.apache.ratis.util.AtomicFileOutputStream" />
36+
<Bug pattern="CT_CONSTRUCTOR_THROW" />
37+
</Match>
38+
<Match>
39+
<Class name="org.apache.ratis.util.Daemon" />
40+
<Bug pattern="EI_EXPOSE_REP2" />
41+
</Match>
42+
<Match>
43+
<Class name="org.apache.ratis.retry.MultipleLinearRandomRetry$Pair" />
44+
<Bug pattern="CT_CONSTRUCTOR_THROW" />
45+
</Match>
46+
<Match>
47+
<Class name="org.apache.ratis.util.Daemon$Builder" />
48+
<Bug pattern="EI_EXPOSE_REP2" />
49+
</Match>
50+
<Match>
51+
<Class name="org.apache.ratis.conf.ReconfigurationBase" />
52+
<Bug pattern="EI_EXPOSE_REP" />
53+
</Match>
54+
<Match>
55+
<Class name="org.apache.ratis.conf.ReconfigurationStatus" />
56+
<Bug pattern="EI_EXPOSE_REP" />
57+
</Match>
58+
<Match>
59+
<Class name="org.apache.ratis.datastream.impl.DataStreamReplyByteBuffer" />
60+
<Bug pattern="EI_EXPOSE_REP" />
61+
</Match>
62+
<Match>
63+
<Class name="org.apache.ratis.datastream.impl.DataStreamRequestByteBuffer" />
64+
<Bug pattern="EI_EXPOSE_REP" />
65+
</Match>
66+
<Match>
67+
<Class name="org.apache.ratis.datastream.impl.DataStreamRequestFilePositionCount" />
68+
<Bug pattern="EI_EXPOSE_REP" />
69+
</Match>
70+
<Match>
71+
<Class name="org.apache.ratis.protocol.DataStreamReplyHeader" />
72+
<Bug pattern="EI_EXPOSE_REP" />
73+
</Match>
74+
<Match>
75+
<Class name="org.apache.ratis.protocol.GroupInfoReply" />
76+
<Bug pattern="EI_EXPOSE_REP" />
77+
</Match>
78+
<Match>
79+
<Class name="org.apache.ratis.protocol.RaftClientReply" />
80+
<Bug pattern="EI_EXPOSE_REP" />
81+
</Match>
82+
<Match>
83+
<Class name="org.apache.ratis.protocol.RaftClientReply$Builder" />
84+
<Bug pattern="EI_EXPOSE_REP2" />
85+
</Match>
86+
<Match>
87+
<Class name="org.apache.ratis.protocol.RaftClientRequest" />
88+
<Bug pattern="EI_EXPOSE_REP" />
89+
</Match>
90+
<Match>
91+
<Class name="org.apache.ratis.protocol.RaftClientRequest$Builder" />
92+
<Bug pattern="EI_EXPOSE_REP2" />
93+
</Match>
94+
<Match>
95+
<Class name="org.apache.ratis.protocol.RaftPeerId" />
96+
<Bug pattern="EI_EXPOSE_REP" />
97+
</Match>
98+
<Match>
99+
<Class name="org.apache.ratis.protocol.SetConfigurationRequest$Arguments" />
100+
<Bug pattern="EI_EXPOSE_REP" />
101+
</Match>
102+
<Match>
103+
<Class name="org.apache.ratis.protocol.SetConfigurationRequest$Arguments$Builder" />
104+
<Bug pattern="EI_EXPOSE_REP2" />
105+
</Match>
106+
<Match>
107+
<Class name="org.apache.ratis.protocol.exceptions.LeaderNotReadyException" />
108+
<Bug pattern="EI_EXPOSE_REP" />
109+
</Match>
110+
<Match>
111+
<Class name="org.apache.ratis.protocol.exceptions.NotLeaderException" />
112+
<Bug pattern="EI_EXPOSE_REP" />
113+
</Match>
114+
<Match>
115+
<Class name="org.apache.ratis.protocol.exceptions.NotReplicatedException" />
116+
<Bug pattern="EI_EXPOSE_REP" />
117+
</Match>
118+
<Match>
119+
<Class name="org.apache.ratis.protocol.exceptions.NotReplicatedException" />
120+
<Bug pattern="EI_EXPOSE_REP2" />
121+
</Match>
122+
<Match>
123+
<Class name="org.apache.ratis.util.SlidingWindow$Client" />
124+
<Bug pattern="EI_EXPOSE_REP2" />
125+
</Match>
126+
<Match>
127+
<Class name="org.apache.ratis.util.TimeDuration$Abbreviation" />
128+
<Bug pattern="EI_EXPOSE_REP" />
129+
</Match>
130+
</FindBugsFilter>

ratis-common/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,15 @@
5959
<scope>test</scope>
6060
</dependency>
6161
</dependencies>
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<groupId>com.github.spotbugs</groupId>
66+
<artifactId>spotbugs-maven-plugin</artifactId>
67+
<configuration>
68+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
6273
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<FindBugsFilter>
18+
<Match>
19+
<Class name="org.apache.ratis.examples.arithmetic.expression.Variable"/>
20+
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
21+
</Match>
22+
<Match>
23+
<Class name="org.apache.ratis.examples.membership.server.CServer"/>
24+
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
25+
</Match>
26+
</FindBugsFilter>

ratis-examples/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@
179179
</roots>
180180
</configuration>
181181
</plugin>
182+
<plugin>
183+
<groupId>com.github.spotbugs</groupId>
184+
<artifactId>spotbugs-maven-plugin</artifactId>
185+
<configuration>
186+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
187+
</configuration>
188+
</plugin>
182189
</plugins>
183190
</build>
184191
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<FindBugsFilter>
18+
<Match>
19+
<Class name="org.apache.ratis.grpc.server.GrpcAdminProtocolService"/>
20+
<Bug pattern="EI_EXPOSE_REP2"/>
21+
</Match>
22+
<Match>
23+
<Class name="org.apache.ratis.grpc.server.GrpcServicesImpl"/>
24+
<Bug pattern="EI_EXPOSE_REP"/>
25+
</Match>
26+
</FindBugsFilter>

ratis-grpc/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,15 @@
7474
<scope>test</scope>
7575
</dependency>
7676
</dependencies>
77+
<build>
78+
<plugins>
79+
<plugin>
80+
<groupId>com.github.spotbugs</groupId>
81+
<artifactId>spotbugs-maven-plugin</artifactId>
82+
<configuration>
83+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
84+
</configuration>
85+
</plugin>
86+
</plugins>
87+
</build>
7788
</project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<FindBugsFilter>
18+
<Match>
19+
<Class name="org.apache.ratis.metrics.RatisMetrics"/>
20+
<Bug pattern="EI_EXPOSE_REP"/>
21+
</Match>
22+
</FindBugsFilter>

0 commit comments

Comments
 (0)