Removed jetbrains annotations
This commit is contained in:
@@ -19,13 +19,14 @@ package org.springframework.cloud.sleuth.brave.instrument.web;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import brave.Tracing;
|
||||
import brave.http.HttpRequest;
|
||||
import brave.http.HttpTracing;
|
||||
import brave.http.HttpTracingCustomizer;
|
||||
import brave.sampler.SamplerFunction;
|
||||
import brave.sampler.SamplerFunctions;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
@@ -142,7 +143,6 @@ public class TraceHttpAutoConfiguration {
|
||||
return HttpTracing.newBuilder(tracing).clientSampler(httpClientSampler).serverSampler(combinedSampler);
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.Nullable
|
||||
private SamplerFunction<HttpRequest> httpServerSampler(BeanFactory beanFactory) {
|
||||
return beanFactory.containsBean(HttpServerSampler.NAME) ? toBraveSampler(beanFactory, HttpServerSampler.NAME)
|
||||
: null;
|
||||
@@ -176,7 +176,6 @@ public class TraceHttpAutoConfiguration {
|
||||
org.springframework.cloud.sleuth.api.SamplerFunction.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private <T> T returnOrThrow(Object bean, T convertedBean, String name, Class brave, Class sleuth) {
|
||||
if (convertedBean == null) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -35,7 +35,6 @@ import brave.propagation.TraceContext;
|
||||
import brave.propagation.TraceContextOrSamplingFlags;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.cloud.sleuth.api.BaggageInScope;
|
||||
import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
|
||||
@@ -190,7 +189,6 @@ public final class W3CPropagation extends Propagation.Factory implements Propaga
|
||||
return this.baggagePropagator.contextWithBaggage(carrier, context, getter);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected TraceContextOrSamplingFlags context(TraceContext contextFromParentHeader, String traceStateHeader) {
|
||||
if (traceStateHeader == null || traceStateHeader.isEmpty()) {
|
||||
return TraceContextOrSamplingFlags.create(contextFromParentHeader);
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.cloud.sleuth.brave.sampler;
|
||||
|
||||
import brave.sampler.CountingSampler;
|
||||
import brave.sampler.Sampler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -78,7 +77,6 @@ public class SamplerAutoConfiguration {
|
||||
return sampler(config);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Sampler sampler(SamplerProperties config) {
|
||||
// TODO: Rewrite: refresh should replace the sampler, not change its state
|
||||
// internally
|
||||
|
||||
@@ -25,7 +25,6 @@ import brave.internal.baggage.BaggageFields;
|
||||
import brave.propagation.Propagation;
|
||||
import brave.propagation.TraceContext;
|
||||
import brave.propagation.TraceContextOrSamplingFlags;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -86,13 +85,11 @@ class W3CBaggagePropagatorTest {
|
||||
assertThat(baggageEntries).hasSize(1).containsEntry("key", "value");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private TraceContextOrSamplingFlags context() {
|
||||
return TraceContextOrSamplingFlags
|
||||
.create(TraceContext.newBuilder().traceId(1L).spanId(2L).sampled(true).build());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private TraceContext.Builder contextBuilder() {
|
||||
return TraceContext.newBuilder().traceId(1L).spanId(2L).sampled(true);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.Map;
|
||||
import brave.propagation.Propagation;
|
||||
import brave.propagation.TraceContext;
|
||||
import brave.propagation.TraceContextOrSamplingFlags;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
|
||||
@@ -136,7 +135,6 @@ class W3CPropagationTest {
|
||||
.isEqualTo(notSampledTraceContext().shared(true).build());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private TraceContext.Builder notSampledTraceContext() {
|
||||
return sampledTraceContext().sampled(false);
|
||||
}
|
||||
@@ -215,7 +213,6 @@ class W3CPropagationTest {
|
||||
.isEqualTo(sharedTraceContext().build());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private TraceContext.Builder sharedTraceContext() {
|
||||
return sampledTraceContext().shared(true);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.concurrent.LinkedBlockingDeque;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -338,7 +337,6 @@ final class TracingChannelInterceptor extends ChannelInterceptorAdapter implemen
|
||||
return new GenericMessage<>(message.getPayload(), headers.getMessageHeaders());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Span consumerSpan(Message<?> message, MessageChannel channel, MessageHeaderAccessor headers) {
|
||||
Span.Builder consumerSpanBuilder = this.propagator.extract(headers, this.extractor);
|
||||
if (log.isDebugEnabled()) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.assertj.core.api.BDDAssertions;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -82,7 +81,6 @@ public abstract class HttpServerParserTests {
|
||||
.containsEntry("ServerResponseServlet", "200"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected Map<String, String> serverSideTags() {
|
||||
return spans.reportedSpans().stream().filter(f -> f.getKind().equals(Span.Kind.SERVER))
|
||||
.flatMap(f -> f.getTags().entrySet().stream())
|
||||
|
||||
@@ -28,7 +28,6 @@ import io.opentelemetry.sdk.trace.ReadableSpan;
|
||||
import io.opentelemetry.sdk.trace.SpanProcessor;
|
||||
import io.opentelemetry.sdk.trace.data.SpanData;
|
||||
import io.opentelemetry.sdk.trace.export.SpanExporter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.cloud.sleuth.api.Span;
|
||||
import org.springframework.cloud.sleuth.api.exporter.FinishedSpan;
|
||||
@@ -77,7 +76,6 @@ public class OtelTestSpanHandler implements TestSpanHandler, SpanProcessor, Span
|
||||
return reportedSpans().get(index);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Iterator<FinishedSpan> iterator() {
|
||||
return reportedSpans().iterator();
|
||||
|
||||
@@ -26,7 +26,6 @@ import io.opentelemetry.extension.trace.propagation.B3Propagator;
|
||||
import io.opentelemetry.sdk.trace.TracerSdkProvider;
|
||||
import io.opentelemetry.sdk.trace.config.TraceConfig;
|
||||
import io.opentelemetry.sdk.trace.samplers.Sampler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.cloud.sleuth.api.CurrentTraceContext;
|
||||
import org.springframework.cloud.sleuth.api.SamplerFunction;
|
||||
@@ -77,7 +76,6 @@ public class OtelTestTracing implements TracerAware, TestTracingAware, TestTraci
|
||||
return provider.get("org.springframework.cloud.sleuth");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected ContextPropagators contextPropagators() {
|
||||
return DefaultContextPropagators.builder()
|
||||
.addTextMapPropagator(B3Propagator.builder().injectMultipleHeaders().build()).build();
|
||||
|
||||
Reference in New Issue
Block a user