Remove inner class imports; avoid future imports by disabling in editorconfig
MODIFY
.editorconfig
.editorconfig
@@ -113,7 +113,7 @@ ij_java_generate_final_parameters = false
ij_java_if_brace_force = always
ij_java_imports_layout = $*,|,*
ij_java_indent_case_from_switch = true
-ij_java_insert_inner_class_imports = true
+ij_java_insert_inner_class_imports = false
ij_java_insert_override_annotation = true
ij_java_keep_blank_lines_before_right_brace = 2
ij_java_keep_blank_lines_between_package_declaration_and_header = 2

MODIFY
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/GrpcClientTracer.java
@@ -11,7 +11,6 @@ import io.grpc.Status;
import io.opentelemetry.instrumentation.api.tracer.RpcClientTracer;
import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import io.opentelemetry.trace.Span;
-import io.opentelemetry.trace.Span.Builder;
import io.opentelemetry.trace.Tracer;
import io.opentelemetry.trace.attributes.SemanticAttributes;
@@ -24,7 +23,7 @@ public class GrpcClientTracer extends RpcClientTracer {
}
public Span startSpan(String name) {
- Builder spanBuilder = tracer.spanBuilder(name).setSpanKind(CLIENT);
+ Span.Builder spanBuilder = tracer.spanBuilder(name).setSpanKind(CLIENT);
spanBuilder.setAttribute(SemanticAttributes.RPC_SYSTEM, "grpc");
return spanBuilder.startSpan();
}

MODIFY
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/GrpcServerTracer.java
@@ -13,7 +13,6 @@ import io.opentelemetry.context.propagation.TextMapPropagator.Getter;
import io.opentelemetry.instrumentation.api.tracer.RpcServerTracer;
import io.opentelemetry.instrumentation.grpc.v1_5.common.GrpcHelper;
import io.opentelemetry.trace.Span;
-import io.opentelemetry.trace.Span.Builder;
import io.opentelemetry.trace.Tracer;
import io.opentelemetry.trace.attributes.SemanticAttributes;
@@ -26,7 +25,7 @@ public class GrpcServerTracer extends RpcServerTracer<Metadata> {
}
public Span startSpan(String name, Metadata headers) {
- Builder spanBuilder =
+ Span.Builder spanBuilder =
tracer.spanBuilder(name).setSpanKind(SERVER).setParent(extract(headers, getGetter()));
spanBuilder.setAttribute(SemanticAttributes.RPC_SYSTEM, "grpc");
return spanBuilder.startSpan();

MODIFY
instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/LabelBridging.java
instrumentation/opentelemetry-api-beta/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/LabelBridging.java
@@ -7,7 +7,6 @@ package io.opentelemetry.javaagent.instrumentation.opentelemetryapi;
import application.io.opentelemetry.common.LabelConsumer;
import io.opentelemetry.common.Labels;
-import io.opentelemetry.common.Labels.Builder;
/**
* This class converts between Labels class that application brings and Labels class that agent
@@ -18,16 +17,16 @@ import io.opentelemetry.common.Labels.Builder;
public class LabelBridging {
public static Labels toAgent(application.io.opentelemetry.common.Labels applicationLabels) {
- io.opentelemetry.common.Labels.Builder builder = io.opentelemetry.common.Labels.builder();
+ Labels.Builder builder = Labels.builder();
applicationLabels.forEach(new Consumer(builder));
return builder.build();
}
static class Consumer implements LabelConsumer {
- private final Builder builder;
+ private final Labels.Builder builder;
- public Consumer(Builder builder) {
+ public Consumer(Labels.Builder builder) {
this.builder = builder;
}

MODIFY
instrumentation/rmi/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientTracer.java
instrumentation/rmi/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientTracer.java
@@ -9,7 +9,6 @@ import static io.opentelemetry.trace.Span.Kind.CLIENT;
import io.opentelemetry.instrumentation.api.tracer.RpcClientTracer;
import io.opentelemetry.trace.Span;
-import io.opentelemetry.trace.Span.Builder;
import io.opentelemetry.trace.attributes.SemanticAttributes;
import java.lang.reflect.Method;
@@ -20,7 +19,7 @@ public class RmiClientTracer extends RpcClientTracer {
String serviceName = method.getDeclaringClass().getName();
String methodName = method.getName();
- Builder spanBuilder = tracer.spanBuilder(serviceName + "/" + methodName).setSpanKind(CLIENT);
+ Span.Builder spanBuilder = tracer.spanBuilder(serviceName + "/" + methodName).setSpanKind(CLIENT);
spanBuilder.setAttribute(SemanticAttributes.RPC_SYSTEM, "java_rmi");
spanBuilder.setAttribute(SemanticAttributes.RPC_SERVICE, serviceName);
spanBuilder.setAttribute(SemanticAttributes.RPC_METHOD, methodName);

MODIFY
instrumentation/rmi/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerTracer.java
instrumentation/rmi/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerTracer.java
@@ -11,7 +11,6 @@ import io.opentelemetry.context.Context;
import io.opentelemetry.context.propagation.TextMapPropagator.Getter;
import io.opentelemetry.instrumentation.api.tracer.RpcServerTracer;
import io.opentelemetry.trace.Span;
-import io.opentelemetry.trace.Span.Builder;
import io.opentelemetry.trace.attributes.SemanticAttributes;
import java.lang.reflect.Method;
@@ -22,7 +21,7 @@ public class RmiServerTracer extends RpcServerTracer {
String serviceName = method.getDeclaringClass().getName();
String methodName = method.getName();
- Builder spanBuilder =
+ Span.Builder spanBuilder =
tracer.spanBuilder(serviceName + "/" + methodName).setSpanKind(SERVER).setParent(context);
spanBuilder.setAttribute(SemanticAttributes.RPC_SYSTEM, "java_rmi");
spanBuilder.setAttribute(SemanticAttributes.RPC_SERVICE, serviceName);

MODIFY
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.java
javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/PropagatorsInitializer.java
@@ -14,7 +14,6 @@ import io.opentelemetry.extensions.trace.propagation.B3Propagator;
import io.opentelemetry.extensions.trace.propagation.JaegerPropagator;
import io.opentelemetry.extensions.trace.propagation.OtTracerPropagator;
import io.opentelemetry.extensions.trace.propagation.TraceMultiPropagator;
-import io.opentelemetry.extensions.trace.propagation.TraceMultiPropagator.Builder;
import io.opentelemetry.trace.propagation.HttpTraceContext;
import java.util.ArrayList;
import java.util.List;
@@ -68,7 +67,7 @@ public class PropagatorsInitializer {
}
}
if (textPropagators.size() > 1) {
- Builder traceMultiPropagatorBuilder = TraceMultiPropagator.builder();
+ TraceMultiPropagator.Builder traceMultiPropagatorBuilder = TraceMultiPropagator.builder();
for (TextMapPropagator textPropagator : textPropagators) {
traceMultiPropagatorBuilder.addPropagator(textPropagator);
}

Remove inner class imports; avoid future imports by disabling in editorconfig (#1489)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>