Skip to content

Commit 3eccfe4

Browse files
committed
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).
1 parent abe8cb0 commit 3eccfe4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/resources/spotbugs/spotbugs-exclude-filter.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
<Class name="org.apache.commons.math4.core.jdkmath.AccurateMath$CodyWaite"/>
4848
<BugPattern name="CNT_ROUGH_CONSTANT_VALUE"/>
4949
</Match>
50+
<Match>
51+
<!-- The DfpField is shared by instances of Dfp computing with the same radix.
52+
Any multi-threaded computations will share the same ieeeFlags used for
53+
the most recent error code. -->
54+
<Class name="org.apache.commons.math4.legacy.core.dfp.DfpField"/>
55+
<BugPattern name="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
56+
</Match>
5057

5158
<!-- Disable checks for exposure of internal references.
5259
TODO: Revise this to use more targeted exclusions. -->

0 commit comments

Comments
 (0)