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-math.git

commit 3eccfe4c1a6a8878a7619d103bace0fc0b2cf55d
Author: Alex Herbert <aherb...@apache.org>
AuthorDate: Fri Jun 6 16:30:55 2025 +0100

    Exclude Spotbugs error in DfpField.
    
    The DfpField function used to obtain the most recent error code from a
    Dfp computation is not thread-safe. Fixing this requires reengineering
    (e.g. using a ThreadLocal).
---
 src/main/resources/spotbugs/spotbugs-exclude-filter.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/resources/spotbugs/spotbugs-exclude-filter.xml 
b/src/main/resources/spotbugs/spotbugs-exclude-filter.xml
index 3de690289..9457e6b09 100644
--- a/src/main/resources/spotbugs/spotbugs-exclude-filter.xml
+++ b/src/main/resources/spotbugs/spotbugs-exclude-filter.xml
@@ -47,6 +47,13 @@
     <Class 
name="org.apache.commons.math4.core.jdkmath.AccurateMath$CodyWaite"/>
     <BugPattern name="CNT_ROUGH_CONSTANT_VALUE"/>
   </Match>
+  <Match>
+    <!-- The DfpField is shared by instances of Dfp computing with the same 
radix.
+       Any multi-threaded computations will share the same ieeeFlags used for
+       the most recent error code. -->
+    <Class name="org.apache.commons.math4.legacy.core.dfp.DfpField"/>
+    <BugPattern name="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
+  </Match>
 
   <!-- Disable checks for exposure of internal references.
        TODO: Revise this to use more targeted exclusions. -->

Reply via email to