This is an automated email from the ASF dual-hosted git repository.

pradeep pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 3388a41  RANGER-3030: Replace Findbugs with Spotbugs maven plugin
3388a41 is described below

commit 3388a4113e597f22438e1070718e4a30b3895f46
Author: Bhavik Patel <[email protected]>
AuthorDate: Tue Jan 5 11:33:40 2021 +0530

    RANGER-3030: Replace Findbugs with Spotbugs maven plugin
    
    Signed-off-by: pradeep <[email protected]>
---
 dev-support/findbugsIncludeFile.xml | 25 ---------------
 dev-support/spotbugsIncludeFile.xml | 61 +++++++++++++++++++++++++++++++++++++
 pom.xml                             | 10 +++---
 3 files changed, 66 insertions(+), 30 deletions(-)

diff --git a/dev-support/findbugsIncludeFile.xml 
b/dev-support/findbugsIncludeFile.xml
deleted file mode 100644
index 8623906..0000000
--- a/dev-support/findbugsIncludeFile.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-   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>
-  <!--
-       For now, lets find only critical bugs from static code analyzer
-  -->
-  <Match>
-    <Bug Rank="1" />
-  </Match>
-
-</FindBugsFilter>
diff --git a/dev-support/spotbugsIncludeFile.xml 
b/dev-support/spotbugsIncludeFile.xml
new file mode 100644
index 0000000..f762453
--- /dev/null
+++ b/dev-support/spotbugsIncludeFile.xml
@@ -0,0 +1,61 @@
+<!--
+   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>
+  <!--
+        For now, lets find only critical bugs from static code analyzer
+  -->
+  <Match>
+    <Priority value="1"/>
+    <Not>
+      <Or>
+        <Bug pattern="DM_DEFAULT_ENCODING" />
+        <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
+        <Bug pattern="MS_SHOULD_BE_FINAL" />
+        <Bug pattern="RU_INVOKE_RUN" />
+        <Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING" />
+        <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
+        <Bug pattern="SE_BAD_FIELD" />
+        <Bug pattern="NP_NULL_ON_SOME_PATH" />
+        <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
+        <Bug pattern="HE_EQUALS_USE_HASHCODE" />
+        <Bug pattern="RC_REF_COMPARISON" />
+        <Bug pattern="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL" />
+        <Bug pattern="RV_EXCEPTION_NOT_THROWN" />
+        <Bug pattern="DMI_INVOKING_TOSTRING_ON_ARRAY" />
+        <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
+        <Bug pattern="UC_USELESS_CONDITION" />
+        <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
+        <Bug pattern="MS_MUTABLE_COLLECTION" />
+        <Bug pattern="DM_BOXED_PRIMITIVE_TOSTRING" />
+        <Bug pattern="NP_NULL_PARAM_DEREF" />
+        <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
+      </Or>
+    </Not>
+  </Match>
+  <!-- TODO: enable each priority one by one
+  <Match>
+      <Priority value="2"/>
+  </Match>
+  <Match>
+      <Priority value="3"/>
+  </Match>
+  <Match>
+      <Priority value="4"/>
+  </Match>
+  -->
+
+</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index 5b90051..6d3cafc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -113,7 +113,7 @@
         <eclipse.jpa.version>2.5.2</eclipse.jpa.version>
         <elasticsearch.version>7.6.0</elasticsearch.version>
         <enunciate.version>2.11.1</enunciate.version>
-        <findbugs.plugin.version>3.0.3</findbugs.plugin.version>
+        <spotbugs.plugin.version>4.5.0.0</spotbugs.plugin.version>
         <google.guava.version>27.0-jre</google.guava.version>
         <googlecode.log4jdbc.version>1.2</googlecode.log4jdbc.version>
         <gson.version>2.2.4</gson.version>
@@ -1068,11 +1068,11 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>findbugs-maven-plugin</artifactId>
-                <version>${findbugs.plugin.version}</version>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <version>${spotbugs.plugin.version}</version>
                 <configuration>
-                    
<includeFilterFile>./dev-support/findbugsIncludeFile.xml</includeFilterFile>
+                    
<includeFilterFile>./dev-support/spotbugsIncludeFile.xml</includeFilterFile>
                 </configuration>
             </plugin>
 

Reply via email to