This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new 04bd20de3 RATIS-2352. Update spotbugs to 4.8.6 and suppress new
warnings (#1307)
04bd20de3 is described below
commit 04bd20de33f888c533b351a836e467d1432f5387
Author: Symious <[email protected]>
AuthorDate: Fri Nov 14 03:08:44 2025 +0800
RATIS-2352. Update spotbugs to 4.8.6 and suppress new warnings (#1307)
Co-authored-by: Yiyang Zhou <[email protected]>
---
pom.xml | 4 +-
ratis-client/dev-support/findbugsExcludeFile.xml | 42 +++++++
ratis-client/pom.xml | 11 ++
ratis-common/dev-support/findbugsExcludeFile.xml | 130 +++++++++++++++++++++
ratis-common/pom.xml | 11 ++
ratis-examples/dev-support/findbugsExcludeFile.xml | 26 +++++
ratis-examples/pom.xml | 7 ++
ratis-grpc/dev-support/findbugsExcludeFile.xml | 26 +++++
ratis-grpc/pom.xml | 11 ++
.../dev-support/findbugsExcludeFile.xml | 22 ++++
ratis-metrics-api/pom.xml | 11 ++
.../dev-support/findbugsExcludeFile.xml | 22 ++++
ratis-metrics-default/pom.xml | 11 ++
.../dev-support/findbugsExcludeFile.xml | 22 ++++
ratis-metrics-dropwizard3/pom.xml | 11 ++
ratis-netty/dev-support/findbugsExcludeFile.xml | 38 ++++++
ratis-netty/pom.xml | 12 ++
.../dev-support/findbugsExcludeFile.xml | 34 ++++++
ratis-server-api/pom.xml | 11 ++
ratis-server/dev-support/findbugsExcludeFile.xml | 90 ++++++++++++++
ratis-server/pom.xml | 11 ++
ratis-shell/dev-support/findbugsExcludeFile.xml | 30 +++++
ratis-shell/pom.xml | 7 ++
23 files changed, 598 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 04dc36635..718a1a3e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -164,8 +164,8 @@
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<cyclonedx.version>2.8.0</cyclonedx.version>
- <spotbugs.version>4.2.1</spotbugs.version>
- <spotbugs-plugin.version>4.2.0</spotbugs-plugin.version>
+ <spotbugs.version>4.8.6</spotbugs.version>
+ <spotbugs-plugin.version>4.8.6.2</spotbugs-plugin.version>
<distMgmtSnapshotsId>apache.snapshots.https</distMgmtSnapshotsId>
<distMgmtSnapshotsName>Apache Development Snapshot
Repository</distMgmtSnapshotsName>
diff --git a/ratis-client/dev-support/findbugsExcludeFile.xml
b/ratis-client/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..3a808c448
--- /dev/null
+++ b/ratis-client/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,42 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.client.DataStreamClient$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.client.RaftClient$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.client.impl.DataStreamClientImpl$DataStreamOutputImpl" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.client.impl.RaftClientRpcWithProxy" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.client.retry.ClientRetryEvent" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.client.retry.ClientRetryEvent" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-client/pom.xml b/ratis-client/pom.xml
index 89cd67e7e..26b203498 100644
--- a/ratis-client/pom.xml
+++ b/ratis-client/pom.xml
@@ -59,4 +59,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-common/dev-support/findbugsExcludeFile.xml
b/ratis-common/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..314875234
--- /dev/null
+++ b/ratis-common/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,130 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class
name="org.apache.ratis.datastream.impl.DataStreamReplyByteBuffer$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.io.MD5Hash" />
+ <Bug pattern="CT_CONSTRUCTOR_THROW" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.GroupInfoReply" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.retry.MultipleLinearRandomRetry" />
+ <Bug pattern="CT_CONSTRUCTOR_THROW" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.util.AtomicFileOutputStream" />
+ <Bug pattern="CT_CONSTRUCTOR_THROW" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.util.Daemon" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.retry.MultipleLinearRandomRetry$Pair" />
+ <Bug pattern="CT_CONSTRUCTOR_THROW" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.util.Daemon$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.conf.ReconfigurationBase" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.conf.ReconfigurationStatus" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.datastream.impl.DataStreamReplyByteBuffer" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.datastream.impl.DataStreamRequestByteBuffer"
/>
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.datastream.impl.DataStreamRequestFilePositionCount" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.DataStreamReplyHeader" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.GroupInfoReply" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.RaftClientReply" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.RaftClientReply$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.RaftClientRequest" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.RaftClientRequest$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.RaftPeerId" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.SetConfigurationRequest$Arguments"
/>
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.protocol.SetConfigurationRequest$Arguments$Builder" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.exceptions.LeaderNotReadyException"
/>
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.exceptions.NotLeaderException" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.exceptions.NotReplicatedException"
/>
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.protocol.exceptions.NotReplicatedException"
/>
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.util.SlidingWindow$Client" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.util.TimeDuration$Abbreviation" />
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-common/pom.xml b/ratis-common/pom.xml
index f60cc0240..f6bc0ee41 100644
--- a/ratis-common/pom.xml
+++ b/ratis-common/pom.xml
@@ -59,4 +59,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-examples/dev-support/findbugsExcludeFile.xml
b/ratis-examples/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..26260f03e
--- /dev/null
+++ b/ratis-examples/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,26 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.examples.arithmetic.expression.Variable"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.examples.membership.server.CServer"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-examples/pom.xml b/ratis-examples/pom.xml
index 8464f93c0..c52019334 100644
--- a/ratis-examples/pom.xml
+++ b/ratis-examples/pom.xml
@@ -179,6 +179,13 @@
</roots>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/ratis-grpc/dev-support/findbugsExcludeFile.xml
b/ratis-grpc/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..c13c34ade
--- /dev/null
+++ b/ratis-grpc/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,26 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.grpc.server.GrpcAdminProtocolService"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.grpc.server.GrpcServicesImpl"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-grpc/pom.xml b/ratis-grpc/pom.xml
index ba3110178..360131d55 100644
--- a/ratis-grpc/pom.xml
+++ b/ratis-grpc/pom.xml
@@ -74,4 +74,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-metrics-api/dev-support/findbugsExcludeFile.xml
b/ratis-metrics-api/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..2b3c140b1
--- /dev/null
+++ b/ratis-metrics-api/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.metrics.RatisMetrics"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-metrics-api/pom.xml b/ratis-metrics-api/pom.xml
index 16c368084..db368269e 100644
--- a/ratis-metrics-api/pom.xml
+++ b/ratis-metrics-api/pom.xml
@@ -51,4 +51,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-metrics-default/dev-support/findbugsExcludeFile.xml
b/ratis-metrics-default/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..3b4b52c66
--- /dev/null
+++ b/ratis-metrics-default/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.metrics.impl.RatisMetricRegistryImpl"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-metrics-default/pom.xml b/ratis-metrics-default/pom.xml
index ada045e96..b561cbe92 100644
--- a/ratis-metrics-default/pom.xml
+++ b/ratis-metrics-default/pom.xml
@@ -56,4 +56,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-metrics-dropwizard3/dev-support/findbugsExcludeFile.xml
b/ratis-metrics-dropwizard3/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..c413237ff
--- /dev/null
+++ b/ratis-metrics-dropwizard3/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class
name="org.apache.ratis.metrics.dropwizard3.Dm3RatisMetricRegistryImpl"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-metrics-dropwizard3/pom.xml
b/ratis-metrics-dropwizard3/pom.xml
index f50ee14a3..3d06f57cc 100644
--- a/ratis-metrics-dropwizard3/pom.xml
+++ b/ratis-metrics-dropwizard3/pom.xml
@@ -94,4 +94,15 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-netty/dev-support/findbugsExcludeFile.xml
b/ratis-netty/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..0e1646df7
--- /dev/null
+++ b/ratis-netty/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.RatisShell$Builder"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.command.Context"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.command.Context"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.netty.NettyRpcProxy$Connection"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.netty.server.DataStreamManagement$StreamInfo"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-netty/pom.xml b/ratis-netty/pom.xml
index f9d34fffc..5688a1fa4 100644
--- a/ratis-netty/pom.xml
+++ b/ratis-netty/pom.xml
@@ -90,4 +90,16 @@
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-server-api/dev-support/findbugsExcludeFile.xml
b/ratis-server-api/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..33c6d02a4
--- /dev/null
+++ b/ratis-server-api/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.server.RaftServer$Builder"/>
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.storage.FileInfo"/>
+ <Bug pattern="EI_EXPOSE_REP" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.storage.FileInfo"/>
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.statemachine.TransactionContext$Builder"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-server-api/pom.xml b/ratis-server-api/pom.xml
index 0dfb3cc1d..feed49190 100644
--- a/ratis-server-api/pom.xml
+++ b/ratis-server-api/pom.xml
@@ -64,4 +64,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-server/dev-support/findbugsExcludeFile.xml
b/ratis-server/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..918085620
--- /dev/null
+++ b/ratis-server/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,90 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.server.impl.LeaderElection"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.impl.LeaderStateImpl"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.impl.PeerConfiguration"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.leader.InstallSnapshotRequests"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.leader.LogAppenderBase"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogCache$EntryIterator"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogOutputStream"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog$Builder"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogWorker"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class
name="org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogWorker$WriteLog"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.storage.FileChunkReader"/>
+ <Bug pattern="CT_CONSTRUCTOR_THROW"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.server.storage.RaftStorageImpl"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.statemachine.impl.BaseStateMachine"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.statemachine.impl.TransactionContextImpl"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.statemachine.impl.TransactionContextImpl"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-server/pom.xml b/ratis-server/pom.xml
index f700ac6c5..2c0bc93a2 100644
--- a/ratis-server/pom.xml
+++ b/ratis-server/pom.xml
@@ -94,4 +94,15 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ratis-shell/dev-support/findbugsExcludeFile.xml
b/ratis-shell/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000..c29ededa0
--- /dev/null
+++ b/ratis-shell/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,30 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<FindBugsFilter>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.RatisShell$Builder"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.command.Context"/>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.ratis.shell.cli.sh.command.Context"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
diff --git a/ratis-shell/pom.xml b/ratis-shell/pom.xml
index 32361a46c..efa96a786 100644
--- a/ratis-shell/pom.xml
+++ b/ratis-shell/pom.xml
@@ -85,6 +85,13 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>