commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [3/6] [math] Avoid a false positive findbugs warning.
Date Tue, 03 Nov 2015 11:06:48 GMT
Avoid a false positive findbugs warning.
    
The source code tests an angle using "angle > (FastMath.PI - 1.0e-10)".
As the compiler does the subtraction of the constants directly, findbugs
complains about a "Rough value of Math.PI found: 3.141592653489793".


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/fae8d868
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/fae8d868
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/fae8d868

Branch: refs/heads/MATH_3_X
Commit: fae8d86872ad332512f99c1edc75e7e35d7bcfbc
Parents: 8c2aa68
Author: Luc Maisonobe <luc@apache.org>
Authored: Tue Nov 3 11:18:59 2015 +0100
Committer: Luc Maisonobe <luc@apache.org>
Committed: Tue Nov 3 11:18:59 2015 +0100

----------------------------------------------------------------------
 findbugs-exclude-filter.xml | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/fae8d868/findbugs-exclude-filter.xml
----------------------------------------------------------------------
diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
index b971772..0216613 100644
--- a/findbugs-exclude-filter.xml
+++ b/findbugs-exclude-filter.xml
@@ -163,6 +163,13 @@
     <Bug pattern="DLS_DEAD_LOCAL_STORE" />
   </Match>
 
+  <!-- Spurious: Findbugs confused by FastMath.PI - 1.0e-10 -->
+  <Match>
+    <Class name="org.apache.commons.math3.geometry.euclidean.threed.Plane" />
+    <Method name="isSimilarTo" params="org.apache.commons.math3.geometry.euclidean.threed.Plane"
returns="boolean" />
+    <Bug pattern="CNT_ROUGH_CONSTANT_VALUE" />
+  </Match>
+
   <!-- the following expositions of internal representation are intentional and documented
-->
   <Match>
     <Class name="org.apache.commons.math3.stat.regression.RegressionResults"/>


Mime
View raw message