Update errorProneVersion to v2.23.0 (#5927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jack Berg <jberg@newrelic.com>
This commit is contained in:
parent
c3a2e94579
commit
cb44b2b18c
|
@ -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;
|
||||
|
|
|
@ -20,7 +20,9 @@ public final class GlobalEventEmitterProvider {
|
|||
private static final AtomicReference<EventEmitterProvider> instance =
|
||||
new AtomicReference<>(EventEmitterProvider.noop());
|
||||
|
||||
@Nullable private static volatile Throwable setInstanceCaller;
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
@Nullable
|
||||
private static volatile Throwable setInstanceCaller;
|
||||
|
||||
private GlobalEventEmitterProvider() {}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,7 @@ class GrpcInOtelTest {
|
|||
private static final io.grpc.Context.Key<String> FOOD = io.grpc.Context.key("food");
|
||||
private static final io.grpc.Context.Key<String> COUNTRY = io.grpc.Context.key("country");
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static ExecutorService otherThread;
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -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<Function<? super ContextStorage, ? extends ContextStorage>> wrappers =
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,7 @@ class OtelInGrpcTest {
|
|||
private static final io.grpc.Context.Key<String> FOOD = io.grpc.Context.key("food");
|
||||
private static final io.grpc.Context.Key<String> COUNTRY = io.grpc.Context.key("country");
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static ExecutorService otherThread;
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -55,9 +55,8 @@ import javax.net.ssl.SSLContext;
|
|||
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 @@ class JaegerGrpcSpanExporterTest {
|
|||
@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 @@ class JaegerGrpcSpanExporterTest {
|
|||
.build();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDown() {
|
||||
exporter.shutdown();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void reset() {
|
||||
void tearDown() {
|
||||
exporter.shutdown();
|
||||
postedRequests.clear();
|
||||
}
|
||||
|
||||
|
@ -213,7 +208,7 @@ class JaegerGrpcSpanExporterTest {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -44,6 +44,7 @@ import org.openjdk.jmh.annotations.Warmup;
|
|||
@Measurement(iterations = 20, time = 1)
|
||||
@Fork(1)
|
||||
@State(Scope.Benchmark)
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
public class OltpExporterBenchmark {
|
||||
private static final Server server =
|
||||
Server.builder()
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.Arrays;
|
|||
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 @@ class SpanPipelineOtlpBenchmark {
|
|||
}
|
||||
};
|
||||
|
||||
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 @@ class SpanPipelineOtlpBenchmark {
|
|||
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 @@ class SpanPipelineOtlpBenchmark {
|
|||
long endTimeNanos = startTimeNanos + TimeUnit.SECONDS.toNanos(60);
|
||||
try {
|
||||
while (System.nanoTime() < endTimeNanos) {
|
||||
SpanPipelineOtlpBenchmark.createSpan();
|
||||
createSpan();
|
||||
}
|
||||
} finally {
|
||||
SpanPipelineOtlpBenchmark.tearDown();
|
||||
tearDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ import org.testcontainers.utility.DockerImageName;
|
|||
* running in process, allowing assertions to be made against the data.
|
||||
*/
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
class CollectorIntegrationTest {
|
||||
|
||||
private static final String COLLECTOR_IMAGE =
|
||||
|
|
|
@ -58,7 +58,10 @@ import org.junit.jupiter.params.provider.ValueSource;
|
|||
class PrometheusHttpServerTest {
|
||||
private static final AtomicReference<List<MetricData>> metricData = new AtomicReference<>();
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
static PrometheusHttpServer prometheusServer;
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
static WebClient client;
|
||||
|
||||
@RegisterExtension
|
||||
|
|
|
@ -35,7 +35,10 @@ import org.testcontainers.utility.MountableFile;
|
|||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class PrometheusIntegrationTest {
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static SdkMeterProvider meterProvider;
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static GenericContainer<?> prometheus;
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -15,6 +15,8 @@ import io.opentelemetry.api.internal.ConfigUtil;
|
|||
*/
|
||||
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() {}
|
||||
|
|
|
@ -34,6 +34,7 @@ public final class SettableContextStorageProvider implements ContextStorageProvi
|
|||
private enum SettableContextStorage implements ContextStorage {
|
||||
INSTANCE;
|
||||
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static volatile ContextStorage delegate = createStorage();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.openjdk.jmh.annotations.Warmup;
|
|||
|
||||
@State(Scope.Benchmark)
|
||||
public class ExceptionBenchmark {
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static SpanBuilder spanBuilder;
|
||||
|
||||
@Setup(Level.Trial)
|
||||
|
|
|
@ -24,7 +24,9 @@ import org.openjdk.jmh.annotations.Warmup;
|
|||
|
||||
@State(Scope.Benchmark)
|
||||
public class SpanBenchmark {
|
||||
@SuppressWarnings("NonFinalStaticField")
|
||||
private static SdkSpanBuilder sdkSpanBuilder;
|
||||
|
||||
private final Resource serviceResource =
|
||||
Resource.create(
|
||||
Attributes.builder()
|
||||
|
|
Loading…
Reference in New Issue