From edf60a370089bc745ef856e2e0afc3a8102ece1e Mon Sep 17 00:00:00 2001 From: Gagan Juneja Date: Wed, 6 Sep 2023 20:50:29 +0530 Subject: [PATCH] Address review comment Signed-off-by: Gagan Juneja --- .../test/telemetry/tracing/MockTracingTelemetry.java | 4 ---- .../test/telemetry/tracing/StrictCheckSpanProcessor.java | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java index e2d937ee5f8d4..c7f5943719230 100644 --- a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java +++ b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/MockTracingTelemetry.java @@ -12,11 +12,7 @@ import org.opensearch.telemetry.tracing.TracingContextPropagator; import org.opensearch.telemetry.tracing.TracingTelemetry; import org.opensearch.telemetry.tracing.attributes.Attributes; -import org.opensearch.test.telemetry.tracing.validators.AllSpansAreEndedProperly; -import org.opensearch.test.telemetry.tracing.validators.AllSpansHaveUniqueId; -import java.util.Arrays; -import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; /** diff --git a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java index 1ca5af51995aa..c6e57531d23df 100644 --- a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java +++ b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java @@ -9,8 +9,11 @@ package org.opensearch.test.telemetry.tracing; import org.opensearch.telemetry.tracing.Span; +import org.opensearch.test.telemetry.tracing.validators.AllSpansAreEndedProperly; +import org.opensearch.test.telemetry.tracing.validators.AllSpansHaveUniqueId; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -66,7 +69,7 @@ private MockSpanData toMockSpanData(Span span) { * Ensures the strict check succeeds for all the spans. */ public static void validateTracingStateOnShutdown() { - List spanData = new ArrayList(spanMap.values()); + List spanData = new ArrayList<>(spanMap.values()); if (spanData.size() != 0) { TelemetryValidators validators = new TelemetryValidators( Arrays.asList(new AllSpansAreEndedProperly(), new AllSpansHaveUniqueId())