Skip to content

Commit 275691f

Browse files
bric3nikita-tkachenko-datadogjandro996manuel-alvarez-alvarez
authored
chore: Apply PR suggestions from code review
Co-authored-by: Nikita Tkachenko <[email protected]> Co-authored-by: Alejandro González García <[email protected]> Co-authored-by: Manuel Álvarez Álvarez <[email protected]>
1 parent 6b2478d commit 275691f

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RetryUntilSuccessful.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/** Retries a test case if it failed, up to a maximum number of times. */
1010
@SuppressFBWarnings(
1111
value = {"AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"},
12-
justification = "TODO")
12+
justification = "TestExecutionPolicy instances are confined to a single thread and are not meant to be thread-safe")
1313
public class RetryUntilSuccessful implements TestExecutionPolicy {
1414

1515
private final int maxExecutions;

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/taint/TaintedMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class TaintedMapImpl implements TaintedMap, Runnable {
103103
/**
104104
* Flag for the current alive tainted objects (red/black style marking for max age calculation).
105105
*/
106-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
106+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "The design explicitly tolerates losses in high-concurrency scenarios. The delayed visibility of the generation flag can cause some entries to be purged a bit earlier or later than ideal, but this is still within the acceptable boundaries of the design.")
107107
protected boolean generation;
108108

109109
/** Whether to collect the {@link IastMetric#TAINTED_FLAT_MODE} metric or not */

dd-java-agent/appsec/src/main/java/com/datadog/appsec/config/AppSecConfigServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ public class AppSecConfigServiceImpl implements AppSecConfigService {
101101
.build()
102102
.adapter(Types.newParameterizedType(Map.class, String.class, Object.class));
103103

104-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
104+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "The variable is only read and written by the single configuration-poller thread.")
105105
private boolean hasUserWafConfig;
106106

107-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
107+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "The variable is only read and written by the single configuration-poller thread.")
108108
private boolean defaultConfigActivated;
109109

110110
private final AtomicBoolean subscribedToRulesAndData = new AtomicBoolean();

dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ abstract class InstrumentationSpecification extends DDSpecification implements A
252252
}
253253
}
254254

255-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
255+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "The variable is accessed only by the test thread in setup and cleanup.")
256256
boolean originalAppSecRuntimeValue
257257

258258
@Shared

dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/execution/RetryAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class RetryAnalyzer implements IRetryAnalyzer {
1515

1616
private volatile TestExecutionPolicy executionPolicy;
1717

18-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
18+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "the field is confined to a single thread")
1919
private boolean suppressFailures;
2020

2121
public void createExecutionPolicy(ITestResult result) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Aggregator implements Runnable {
3535

3636
private final long sleepMillis;
3737

38-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
38+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "the field is confined to the agent thread running the Aggregator")
3939
private boolean dirty;
4040

4141
Aggregator(

dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static DDSpan create(
9292
*/
9393
private volatile long durationNano;
9494

95-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
95+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "This field is never accessed concurrently")
9696
private boolean forceKeep;
9797

9898
private volatile EndpointTracker endpointTracker;

dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static class PTags extends PropagationTags {
7676
// tags that don't require any modifications and propagated as-is
7777
private final List<TagElement> tagPairs;
7878

79-
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "TODO")
79+
@SuppressFBWarnings(value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "This field is never accessed concurrently")
8080
private boolean canChangeDecisionMaker;
8181

8282
// extracted decision maker tag for easier updates

0 commit comments

Comments
 (0)