Skip to content

Commit 27bc29c

Browse files
dougqhclaude
andcommitted
Drop now-useless SpotBugs suppressions in AggregateEntry
Removing recordDurations took away the only AtomicLongArray access touching the recording counters, so SpotBugs no longer raises the AT_* atomicity warnings on recordOneDuration and clearAggregate. Their @SuppressFBWarnings annotations are now flagged as US_USELESS_SUPPRESSION; remove them (and the orphaned import). The single-writer invariant they documented remains described in the class javadoc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 86896d7 commit 27bc29c

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateEntry.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString;
55
import datadog.trace.util.Hashtable;
66
import datadog.trace.util.LongHashingUtils;
7-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
87
import java.util.Arrays;
98
import java.util.Collections;
109
import java.util.List;
@@ -297,11 +296,6 @@ private Histogram errorLatenciesForWrite() {
297296
* Records a single hit. {@code tagAndDuration} carries the duration nanos with optional {@link
298297
* #ERROR_TAG} / {@link #TOP_LEVEL_TAG} bits OR-ed in.
299298
*/
300-
@SuppressFBWarnings(
301-
value = "AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE",
302-
justification =
303-
"Single-writer by design: recording counters are mutated only on the aggregator thread"
304-
+ " (see class javadoc); no cross-thread atomicity guarantee is needed.")
305299
AggregateEntry recordOneDuration(long tagAndDuration) {
306300
hitCount++;
307301
if ((tagAndDuration & TOP_LEVEL_TAG) == TOP_LEVEL_TAG) {
@@ -324,11 +318,6 @@ AggregateEntry recordOneDuration(long tagAndDuration) {
324318
* Clears the recording state. The OK histogram is reused; the error histogram (if allocated) is
325319
* reused too, but entries that never saw an error keep their {@code errorLatencies} field null.
326320
*/
327-
@SuppressFBWarnings(
328-
value = {"AT_NONATOMIC_64BIT_PRIMITIVE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"},
329-
justification =
330-
"Single-writer by design: recording counters are reset only on the aggregator thread"
331-
+ " (see class javadoc); no cross-thread visibility guarantee is needed.")
332321
void clearAggregate() {
333322
this.errorCount = 0;
334323
this.hitCount = 0;

0 commit comments

Comments
 (0)