From cb44b2b18c474f80478184ff1665bc3fa5d2ced3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:31:09 -0500 Subject: [PATCH] Update errorProneVersion to v2.23.0 (#5927) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jack Berg --- .../api/GlobalOpenTelemetry.java | 5 ++++- .../events/GlobalEventEmitterProvider.java | 4 +++- .../context/BraveInOtelTest.java | 1 + .../opentelemetry/context/GrpcInOtelTest.java | 1 + .../context/ContextStorageWrappers.java | 1 + .../context/OtelAsBraveTest.java | 1 + .../context/OtelInBraveTest.java | 1 + .../opentelemetry/context/OtelInGrpcTest.java | 1 + dependencyManagement/build.gradle.kts | 2 +- .../thrift/JaegerThriftIntegrationTest.java | 2 +- .../jaeger/JaegerGrpcSpanExporterTest.java | 19 ++++++---------- .../jaeger/JaegerIntegrationTest.java | 2 +- .../otlp/trace/OltpExporterBenchmark.java | 1 + .../otlp/trace/SpanPipelineOtlpBenchmark.java | 22 +++++++++---------- .../prometheus/CollectorIntegrationTest.java | 1 + .../prometheus/PrometheusHttpServerTest.java | 3 +++ .../prometheus/PrometheusIntegrationTest.java | 3 +++ .../ZipkinSpanExporterEndToEndHttpTest.java | 2 +- .../OtlpExporterIntegrationTest.java | 3 +++ .../B3PropagationIntegrationTest.java | 3 +++ .../opentracingshim/TracerShimTest.java | 3 ++- .../perf/OtlpPipelineStressTest.java | 8 +++---- .../JaegerRemoteSamplerIntegrationTest.java | 2 +- .../metrics/internal/debug/DebugConfig.java | 2 ++ .../SettableContextStorageProvider.java | 1 + .../sdk/trace/ExceptionBenchmark.java | 1 + .../sdk/trace/SpanBenchmark.java | 2 ++ 27 files changed, 62 insertions(+), 35 deletions(-) diff --git a/api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java b/api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java index 3e2244a95bb..230a85e06a9 100644 --- a/api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java +++ b/api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java @@ -53,8 +53,11 @@ public final class GlobalOpenTelemetry { private static final Object mutex = new Object(); - @Nullable private static volatile ObfuscatedOpenTelemetry globalOpenTelemetry; + @SuppressWarnings("NonFinalStaticField") + @Nullable + private static volatile ObfuscatedOpenTelemetry globalOpenTelemetry; + @SuppressWarnings("NonFinalStaticField") @GuardedBy("mutex") @Nullable private static Throwable setGlobalCaller; diff --git a/api/events/src/main/java/io/opentelemetry/api/events/GlobalEventEmitterProvider.java b/api/events/src/main/java/io/opentelemetry/api/events/GlobalEventEmitterProvider.java index ddf62a6d5a0..b6b1685bbfa 100644 --- a/api/events/src/main/java/io/opentelemetry/api/events/GlobalEventEmitterProvider.java +++ b/api/events/src/main/java/io/opentelemetry/api/events/GlobalEventEmitterProvider.java @@ -20,7 +20,9 @@ public final class GlobalEventEmitterProvider { private static final AtomicReference instance = new AtomicReference<>(EventEmitterProvider.noop()); - @Nullable private static volatile Throwable setInstanceCaller; + @SuppressWarnings("NonFinalStaticField") + @Nullable + private static volatile Throwable setInstanceCaller; private GlobalEventEmitterProvider() {} diff --git a/context/src/braveInOtelTest/java/io/opentelemetry/context/BraveInOtelTest.java b/context/src/braveInOtelTest/java/io/opentelemetry/context/BraveInOtelTest.java index efaf20562d0..13298a341e2 100644 --- a/context/src/braveInOtelTest/java/io/opentelemetry/context/BraveInOtelTest.java +++ b/context/src/braveInOtelTest/java/io/opentelemetry/context/BraveInOtelTest.java @@ -27,6 +27,7 @@ class BraveInOtelTest { private static final TraceContext TRACE_CONTEXT = TraceContext.newBuilder().traceId(1).spanId(1).addExtra("japan").build(); + @SuppressWarnings("NonFinalStaticField") private static ExecutorService otherThread; @BeforeAll diff --git a/context/src/grpcInOtelTest/java/io/opentelemetry/context/GrpcInOtelTest.java b/context/src/grpcInOtelTest/java/io/opentelemetry/context/GrpcInOtelTest.java index 265c623ed4f..4d22ed765ee 100644 --- a/context/src/grpcInOtelTest/java/io/opentelemetry/context/GrpcInOtelTest.java +++ b/context/src/grpcInOtelTest/java/io/opentelemetry/context/GrpcInOtelTest.java @@ -21,6 +21,7 @@ class GrpcInOtelTest { private static final io.grpc.Context.Key FOOD = io.grpc.Context.key("food"); private static final io.grpc.Context.Key COUNTRY = io.grpc.Context.key("country"); + @SuppressWarnings("NonFinalStaticField") private static ExecutorService otherThread; @BeforeAll diff --git a/context/src/main/java/io/opentelemetry/context/ContextStorageWrappers.java b/context/src/main/java/io/opentelemetry/context/ContextStorageWrappers.java index 9f8eb3276a1..faa05a66c0b 100644 --- a/context/src/main/java/io/opentelemetry/context/ContextStorageWrappers.java +++ b/context/src/main/java/io/opentelemetry/context/ContextStorageWrappers.java @@ -19,6 +19,7 @@ final class ContextStorageWrappers { private static final Logger log = Logger.getLogger(ContextStorageWrappers.class.getName()); + @SuppressWarnings("NonFinalStaticField") private static boolean storageInitialized; private static final List> wrappers = diff --git a/context/src/otelAsBraveTest/java/io/opentelemetry/context/OtelAsBraveTest.java b/context/src/otelAsBraveTest/java/io/opentelemetry/context/OtelAsBraveTest.java index 6acad3d0e7b..f3498727995 100644 --- a/context/src/otelAsBraveTest/java/io/opentelemetry/context/OtelAsBraveTest.java +++ b/context/src/otelAsBraveTest/java/io/opentelemetry/context/OtelAsBraveTest.java @@ -27,6 +27,7 @@ class OtelAsBraveTest { private static final TraceContext TRACE_CONTEXT = TraceContext.newBuilder().traceId(1).spanId(1).addExtra("japan").build(); + @SuppressWarnings("NonFinalStaticField") private static ExecutorService otherThread; @BeforeAll diff --git a/context/src/otelInBraveTest/java/io/opentelemetry/context/OtelInBraveTest.java b/context/src/otelInBraveTest/java/io/opentelemetry/context/OtelInBraveTest.java index 72a8b402acf..232cb0c4755 100644 --- a/context/src/otelInBraveTest/java/io/opentelemetry/context/OtelInBraveTest.java +++ b/context/src/otelInBraveTest/java/io/opentelemetry/context/OtelInBraveTest.java @@ -28,6 +28,7 @@ class OtelInBraveTest { BraveContextStorageProvider.toBraveContext( TraceContext.newBuilder().traceId(1).spanId(1).build(), CONTEXT_WITH_ANIMAL); + @SuppressWarnings("NonFinalStaticField") private static ExecutorService otherThread; @BeforeAll diff --git a/context/src/otelInGrpcTest/java/io/opentelemetry/context/OtelInGrpcTest.java b/context/src/otelInGrpcTest/java/io/opentelemetry/context/OtelInGrpcTest.java index 6b5cf16dabb..6024100b986 100644 --- a/context/src/otelInGrpcTest/java/io/opentelemetry/context/OtelInGrpcTest.java +++ b/context/src/otelInGrpcTest/java/io/opentelemetry/context/OtelInGrpcTest.java @@ -21,6 +21,7 @@ class OtelInGrpcTest { private static final io.grpc.Context.Key FOOD = io.grpc.Context.key("food"); private static final io.grpc.Context.Key COUNTRY = io.grpc.Context.key("country"); + @SuppressWarnings("NonFinalStaticField") private static ExecutorService otherThread; @BeforeAll diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 380ab0a3e22..89c1624878d 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -25,7 +25,7 @@ val DEPENDENCY_BOMS = listOf( ) val autoValueVersion = "1.10.4" -val errorProneVersion = "2.22.0" +val errorProneVersion = "2.23.0" val jmhVersion = "1.37" // Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0 val mockitoVersion = "4.11.0" diff --git a/exporters/jaeger-thrift/src/test/java/io/opentelemetry/exporter/jaeger/thrift/JaegerThriftIntegrationTest.java b/exporters/jaeger-thrift/src/test/java/io/opentelemetry/exporter/jaeger/thrift/JaegerThriftIntegrationTest.java index 6aa33e2efc1..fe95b30894b 100644 --- a/exporters/jaeger-thrift/src/test/java/io/opentelemetry/exporter/jaeger/thrift/JaegerThriftIntegrationTest.java +++ b/exporters/jaeger-thrift/src/test/java/io/opentelemetry/exporter/jaeger/thrift/JaegerThriftIntegrationTest.java @@ -47,7 +47,7 @@ class JaegerThriftIntegrationTest { private static final String JAEGER_URL = "http://localhost"; @Container - public static GenericContainer jaegerContainer = + public static final GenericContainer jaegerContainer = new GenericContainer<>("ghcr.io/open-telemetry/opentelemetry-java/jaeger:1.32") .withImagePullPolicy(PullPolicy.alwaysPull()) .withExposedPorts(THRIFT_HTTP_PORT, THRIFT_UDP_PORT, QUERY_PORT, HEALTH_PORT) diff --git a/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerGrpcSpanExporterTest.java b/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerGrpcSpanExporterTest.java index 2889f9ab972..994998d6176 100644 --- a/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerGrpcSpanExporterTest.java +++ b/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerGrpcSpanExporterTest.java @@ -55,9 +55,8 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.X509KeyManager; import javax.net.ssl.X509TrustManager; -import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -99,10 +98,10 @@ protected CompletionStage handleMessage( @RegisterExtension static final SelfSignedCertificateExtension clientTls = new SelfSignedCertificateExtension(); - private static JaegerGrpcSpanExporter exporter; + private JaegerGrpcSpanExporter exporter; - @BeforeAll - static void setUp() { + @BeforeEach + void setUp() { exporter = JaegerGrpcSpanExporter.builder() .setEndpoint(server.httpUri().toString()) @@ -110,13 +109,9 @@ static void setUp() { .build(); } - @AfterAll - static void tearDown() { - exporter.shutdown(); - } - @AfterEach - void reset() { + void tearDown() { + exporter.shutdown(); postedRequests.clear(); } @@ -213,7 +208,7 @@ void testExportMultipleResources() throws Exception { } } - private static void verifyBatch(Model.Batch batch) throws Exception { + private void verifyBatch(Model.Batch batch) throws Exception { assertThat(batch.getSpansCount()).isEqualTo(1); assertThat(TraceId.fromBytes(batch.getSpans(0).getTraceId().toByteArray())).isNotNull(); assertThat(batch.getProcess().getTagsCount()).isEqualTo(5); diff --git a/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerIntegrationTest.java b/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerIntegrationTest.java index b0e32ba636e..bfd7db8046f 100644 --- a/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerIntegrationTest.java +++ b/exporters/jaeger/src/test/java/io/opentelemetry/exporter/jaeger/JaegerIntegrationTest.java @@ -41,7 +41,7 @@ class JaegerIntegrationTest { private static final String JAEGER_URL = "http://localhost"; @Container - public static GenericContainer jaegerContainer = + public static final GenericContainer jaegerContainer = new GenericContainer<>("ghcr.io/open-telemetry/opentelemetry-java/jaeger:1.32") .withImagePullPolicy(PullPolicy.alwaysPull()) .withExposedPorts(COLLECTOR_PORT, QUERY_PORT, HEALTH_PORT) diff --git a/exporters/otlp/all/src/jmh/java/io/opentelemetry/exporter/otlp/trace/OltpExporterBenchmark.java b/exporters/otlp/all/src/jmh/java/io/opentelemetry/exporter/otlp/trace/OltpExporterBenchmark.java index 9271ad9fc7e..8e70ad7a73f 100644 --- a/exporters/otlp/all/src/jmh/java/io/opentelemetry/exporter/otlp/trace/OltpExporterBenchmark.java +++ b/exporters/otlp/all/src/jmh/java/io/opentelemetry/exporter/otlp/trace/OltpExporterBenchmark.java @@ -44,6 +44,7 @@ @Measurement(iterations = 20, time = 1) @Fork(1) @State(Scope.Benchmark) +@SuppressWarnings("NonFinalStaticField") public class OltpExporterBenchmark { private static final Server server = Server.builder() diff --git a/exporters/otlp/all/src/testSpanPipeline/java/io/opentelemetry/exporter/otlp/trace/SpanPipelineOtlpBenchmark.java b/exporters/otlp/all/src/testSpanPipeline/java/io/opentelemetry/exporter/otlp/trace/SpanPipelineOtlpBenchmark.java index 3fc1f5f9a5a..a5536b31c3b 100644 --- a/exporters/otlp/all/src/testSpanPipeline/java/io/opentelemetry/exporter/otlp/trace/SpanPipelineOtlpBenchmark.java +++ b/exporters/otlp/all/src/testSpanPipeline/java/io/opentelemetry/exporter/otlp/trace/SpanPipelineOtlpBenchmark.java @@ -23,8 +23,8 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -70,11 +70,11 @@ protected CompletionStage handleMessage( } }; - private static SdkTracerProvider tracerProvider; - private static Tracer tracer; + private SdkTracerProvider tracerProvider; + private Tracer tracer; - @BeforeAll - public static void setUp() { + @BeforeEach + public void setUp() { tracerProvider = SdkTracerProvider.builder() .setResource(RESOURCE) @@ -89,12 +89,12 @@ public static void setUp() { tracer = tracerProvider.get("benchmark"); } - @AfterAll - public static void tearDown() { + @AfterEach + public void tearDown() { tracerProvider.close(); } - private static void createSpan() { + private void createSpan() { Span span = tracer.spanBuilder("POST /search").startSpan(); try (Scope ignored = span.makeCurrent()) { span.setAllAttributes(SPAN_ATTRIBUTES); @@ -109,10 +109,10 @@ void runPipeline() { long endTimeNanos = startTimeNanos + TimeUnit.SECONDS.toNanos(60); try { while (System.nanoTime() < endTimeNanos) { - SpanPipelineOtlpBenchmark.createSpan(); + createSpan(); } } finally { - SpanPipelineOtlpBenchmark.tearDown(); + tearDown(); } } } diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/CollectorIntegrationTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/CollectorIntegrationTest.java index 07cee01a801..c062f61bcc6 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/CollectorIntegrationTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/CollectorIntegrationTest.java @@ -56,6 +56,7 @@ * running in process, allowing assertions to be made against the data. */ @Testcontainers(disabledWithoutDocker = true) +@SuppressWarnings("NonFinalStaticField") class CollectorIntegrationTest { private static final String COLLECTOR_IMAGE = diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java index 2c6245fd1d4..7f65cf1e0c2 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java @@ -58,7 +58,10 @@ class PrometheusHttpServerTest { private static final AtomicReference> metricData = new AtomicReference<>(); + @SuppressWarnings("NonFinalStaticField") static PrometheusHttpServer prometheusServer; + + @SuppressWarnings("NonFinalStaticField") static WebClient client; @RegisterExtension diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusIntegrationTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusIntegrationTest.java index f98b06c7da6..cff688c129d 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusIntegrationTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusIntegrationTest.java @@ -35,7 +35,10 @@ @Testcontainers(disabledWithoutDocker = true) class PrometheusIntegrationTest { + @SuppressWarnings("NonFinalStaticField") private static SdkMeterProvider meterProvider; + + @SuppressWarnings("NonFinalStaticField") private static GenericContainer prometheus; @BeforeAll diff --git a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java index d12a6b060e3..c7d23af452f 100644 --- a/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java +++ b/exporters/zipkin/src/test/java/io/opentelemetry/exporter/zipkin/ZipkinSpanExporterEndToEndHttpTest.java @@ -81,7 +81,7 @@ class ZipkinSpanExporterEndToEndHttpTest { SEEN_ATTRIBUTES.toBuilder().put(AttributeKey.booleanKey("success"), false).build(); @Container - public static GenericContainer zipkinContainer = + public static final GenericContainer zipkinContainer = new GenericContainer<>("ghcr.io/openzipkin/zipkin:2.23") .withExposedPorts(ZIPKIN_API_PORT) .waitingFor(Wait.forHttp("/health").forPort(ZIPKIN_API_PORT)); diff --git a/integration-tests/otlp/src/main/java/io/opentelemetry/integrationtest/OtlpExporterIntegrationTest.java b/integration-tests/otlp/src/main/java/io/opentelemetry/integrationtest/OtlpExporterIntegrationTest.java index 379aeb5112c..7bfa82a3876 100644 --- a/integration-tests/otlp/src/main/java/io/opentelemetry/integrationtest/OtlpExporterIntegrationTest.java +++ b/integration-tests/otlp/src/main/java/io/opentelemetry/integrationtest/OtlpExporterIntegrationTest.java @@ -124,7 +124,10 @@ abstract class OtlpExporterIntegrationTest { @RegisterExtension static final SelfSignedCertificateExtension clientTls = new SelfSignedCertificateExtension(); + @SuppressWarnings("NonFinalStaticField") private static OtlpGrpcServer grpcServer; + + @SuppressWarnings("NonFinalStaticField") private static GenericContainer collector; @BeforeAll diff --git a/integration-tests/src/test/java/io/opentelemetry/B3PropagationIntegrationTest.java b/integration-tests/src/test/java/io/opentelemetry/B3PropagationIntegrationTest.java index b87db824a26..66eaa8e6cef 100644 --- a/integration-tests/src/test/java/io/opentelemetry/B3PropagationIntegrationTest.java +++ b/integration-tests/src/test/java/io/opentelemetry/B3PropagationIntegrationTest.java @@ -50,7 +50,10 @@ class B3PropagationIntegrationTest { private static final InMemorySpanExporter spanExporter = InMemorySpanExporter.create(); + @SuppressWarnings("NonFinalStaticField") static WebClient b3MultiClient; + + @SuppressWarnings("NonFinalStaticField") static WebClient b3SingleClient; private static class FrontendService implements HttpService { diff --git a/opentracing-shim/src/test/java/io/opentelemetry/opentracingshim/TracerShimTest.java b/opentracing-shim/src/test/java/io/opentelemetry/opentracingshim/TracerShimTest.java index d15d7d98d6b..8a961288c23 100644 --- a/opentracing-shim/src/test/java/io/opentelemetry/opentracingshim/TracerShimTest.java +++ b/opentracing-shim/src/test/java/io/opentelemetry/opentracingshim/TracerShimTest.java @@ -45,7 +45,8 @@ class TracerShimTest { static final io.opentelemetry.api.baggage.Baggage EMPTY_BAGGAGE = io.opentelemetry.api.baggage.Baggage.empty(); - @RegisterExtension static OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); + @RegisterExtension + static final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); TracerShim tracerShim; TracerProvider provider; diff --git a/perf-harness/src/test/java/io/opentelemetry/perf/OtlpPipelineStressTest.java b/perf-harness/src/test/java/io/opentelemetry/perf/OtlpPipelineStressTest.java index 2e175fd4873..0538d8f011f 100644 --- a/perf-harness/src/test/java/io/opentelemetry/perf/OtlpPipelineStressTest.java +++ b/perf-harness/src/test/java/io/opentelemetry/perf/OtlpPipelineStressTest.java @@ -61,13 +61,13 @@ public class OtlpPipelineStressTest { public static final int OTLP_RECEIVER_PORT = 4317; public static final int COLLECTOR_PROXY_PORT = 44444; public static final int TOXIPROXY_CONTROL_PORT = 8474; - public static Network network = Network.newNetwork(); - public static AtomicLong totalSpansReceivedByCollector = new AtomicLong(); + public static final Network network = Network.newNetwork(); + public static final AtomicLong totalSpansReceivedByCollector = new AtomicLong(); private static final Logger logger = LoggerFactory.getLogger(OtlpPipelineStressTest.class); @Container - public static GenericContainer collectorContainer = + public static final GenericContainer collectorContainer = new GenericContainer<>( DockerImageName.parse("ghcr.io/open-telemetry/opentelemetry-java/otel-collector")) .withImagePullPolicy(PullPolicy.alwaysPull()) @@ -93,7 +93,7 @@ public class OtlpPipelineStressTest { .waitingFor(new LogMessageWaitStrategy().withRegEx(".*Everything is ready.*")); @Container - public static GenericContainer toxiproxyContainer = + public static final GenericContainer toxiproxyContainer = new GenericContainer<>( DockerImageName.parse("ghcr.io/open-telemetry/opentelemetry-java/toxiproxy")) .withImagePullPolicy(PullPolicy.alwaysPull()) diff --git a/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerIntegrationTest.java b/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerIntegrationTest.java index fd36ee29ca4..c873808c332 100644 --- a/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerIntegrationTest.java +++ b/sdk-extensions/jaeger-remote-sampler/src/test/java/io/opentelemetry/sdk/extension/trace/jaeger/sampler/JaegerRemoteSamplerIntegrationTest.java @@ -35,7 +35,7 @@ class JaegerRemoteSamplerIntegrationTest { private static final String SERVICE_NAME_DEFAULT_STRATEGY = "foobar"; @Container - public static GenericContainer jaegerContainer = + public static final GenericContainer jaegerContainer = new GenericContainer<>("ghcr.io/open-telemetry/opentelemetry-java/jaeger:1.32") .withImagePullPolicy(PullPolicy.alwaysPull()) .withCommand("--sampling.strategies-file=/sampling.json") diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/debug/DebugConfig.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/debug/DebugConfig.java index db5b82081d4..7228aa2be4e 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/debug/DebugConfig.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/debug/DebugConfig.java @@ -15,6 +15,8 @@ */ public final class DebugConfig { private static final String ENABLE_METRICS_DEBUG_PROPERTY = "otel.experimental.sdk.metrics.debug"; + + @SuppressWarnings("NonFinalStaticField") private static boolean enabled; private DebugConfig() {} diff --git a/sdk/testing/src/main/java/io/opentelemetry/sdk/testing/context/SettableContextStorageProvider.java b/sdk/testing/src/main/java/io/opentelemetry/sdk/testing/context/SettableContextStorageProvider.java index 1a34c3eade4..22b4fc6ec87 100644 --- a/sdk/testing/src/main/java/io/opentelemetry/sdk/testing/context/SettableContextStorageProvider.java +++ b/sdk/testing/src/main/java/io/opentelemetry/sdk/testing/context/SettableContextStorageProvider.java @@ -34,6 +34,7 @@ public static ContextStorage getContextStorage() { private enum SettableContextStorage implements ContextStorage { INSTANCE; + @SuppressWarnings("NonFinalStaticField") private static volatile ContextStorage delegate = createStorage(); @Override diff --git a/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/ExceptionBenchmark.java b/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/ExceptionBenchmark.java index 438deb7b69d..7dd1298345b 100644 --- a/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/ExceptionBenchmark.java +++ b/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/ExceptionBenchmark.java @@ -25,6 +25,7 @@ @State(Scope.Benchmark) public class ExceptionBenchmark { + @SuppressWarnings("NonFinalStaticField") private static SpanBuilder spanBuilder; @Setup(Level.Trial) diff --git a/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/SpanBenchmark.java b/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/SpanBenchmark.java index c8063e1bb07..cf0cf3737c8 100644 --- a/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/SpanBenchmark.java +++ b/sdk/trace/src/jmh/java/io/opentelemetry/sdk/trace/SpanBenchmark.java @@ -24,7 +24,9 @@ @State(Scope.Benchmark) public class SpanBenchmark { + @SuppressWarnings("NonFinalStaticField") private static SdkSpanBuilder sdkSpanBuilder; + private final Resource serviceResource = Resource.create( Attributes.builder()