You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/05/20 10:32:25 UTC

[commons-statistics] branch master updated: Update findbugs to spotbugs.

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

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git


The following commit(s) were added to refs/heads/master by this push:
     new d45bbb2  Update findbugs to spotbugs.
d45bbb2 is described below

commit d45bbb2d0d17b20fc0a7e086e39c673c273e8bb3
Author: aherbert <ah...@apache.org>
AuthorDate: Mon May 20 11:32:21 2019 +0100

    Update findbugs to spotbugs.
    
    Update spotbugs exclude filter to allow intentional float-point equality
    tests.
---
 pom.xml                                            | 23 +++++++++++-------
 .../spotbugs-exclude-filter.xml}                   | 28 ++++++++++++++++++----
 2 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1ee61da..e8335d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,7 +88,7 @@
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
     <statistics.pmd.version>3.8</statistics.pmd.version>
-    <statistics.findbugs.version>3.0.5</statistics.findbugs.version>
+    <statistics.spotbugs.version>3.1.11</statistics.spotbugs.version>
     <statistics.checkstyle.version>2.17</statistics.checkstyle.version>
     <statistics.clirr.version>2.8</statistics.clirr.version>
     <!-- Workaround to avoid duplicating config files. -->
@@ -176,7 +176,7 @@
   </dependencies>
 
   <build>
-    <defaultGoal>clean verify apache-rat:check clirr:check checkstyle:check pmd:pmd spotbugs:check javadoc:javadoc</defaultGoal>
+    <defaultGoal>clean verify apache-rat:check clirr:check checkstyle:check spotbugs:check javadoc:javadoc</defaultGoal>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -239,9 +239,14 @@
         </executions>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <version>${statistics.findbugs.version}</version>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <version>${statistics.spotbugs.version}</version>
+        <configuration>
+          <threshold>Normal</threshold>
+          <effort>Default</effort>
+          <excludeFilterFile>${statistics.parent.dir}/src/main/resources/spotbugs/spotbugs-exclude-filter.xml</excludeFilterFile>
+        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.rat</groupId>
@@ -339,13 +344,13 @@
         </reportSets>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <version>${statistics.findbugs.version}</version>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <version>${statistics.spotbugs.version}</version>
         <configuration>
           <threshold>Normal</threshold>
           <effort>Default</effort>
-          <excludeFilterFile>${statistics.parent.dir}/src/main/resources/findbugs/findbugs-exclude-filter.xml</excludeFilterFile>
+          <excludeFilterFile>${statistics.parent.dir}/src/main/resources/spotbugs/spotbugs-exclude-filter.xml</excludeFilterFile>
         </configuration>
       </plugin>
       <plugin>
diff --git a/src/main/resources/findbugs/findbugs-exclude-filter.xml b/src/main/resources/spotbugs/spotbugs-exclude-filter.xml
similarity index 50%
rename from src/main/resources/findbugs/findbugs-exclude-filter.xml
rename to src/main/resources/spotbugs/spotbugs-exclude-filter.xml
index 8a9c858..f90cbd4 100644
--- a/src/main/resources/findbugs/findbugs-exclude-filter.xml
+++ b/src/main/resources/spotbugs/spotbugs-exclude-filter.xml
@@ -17,12 +17,32 @@
 -->
 
 <!--
-  This file contains some false positive bugs detected by findbugs. Their
+  This file contains some false positive bugs detected by spotbugs. Their
   false positive nature has been analyzed individually and they have been
-  put here to instruct findbugs it must ignore them.
+  put here to instruct spotbugs it must ignore them.
 -->
-<FindBugsFilter>
+<FindBugsFilter
+    xmlns="https://github.com/spotbugs/filter/3.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
 
-  <Class name="~.*\.jmh\.generated\..*" />
+  <Match>
+    <Class name="~.*\.jmh\..*generated\..*" />
+  </Match>
+
+  <Match>
+    <Class name="org.apache.commons.statistics.distribution.SaddlePointExpansion" />
+    <Or>
+      <Method name="getStirlingError" />
+      <Method name="getDeviancePart" />
+    </Or>
+    <Bug pattern="FE_FLOATING_POINT_EQUALITY" />
+  </Match>
+
+  <Match>
+    <Class name="org.apache.commons.statistics.distribution.AbstractContinuousDistribution$BrentSolver" />
+    <Method name="brent" />
+    <Bug pattern="FE_FLOATING_POINT_EQUALITY" />
+  </Match>
 
 </FindBugsFilter>