Don't use type annotation style
MODIFY
instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientTracer.java
instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientTracer.java
@@ -53,7 +53,8 @@ public class ApacheHttpAsyncClientTracer
}
@Override
- protected @Nullable String flavor(HttpRequest httpRequest) {
+ @Nullable
+ protected String flavor(HttpRequest httpRequest) {
return httpRequest.getProtocolVersion().toString();
}

MODIFY
instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientTracer.java
instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientTracer.java
@@ -53,7 +53,8 @@ public class ApacheHttpClientTracer
}
@Override
- protected @Nullable String flavor(HttpUriRequest httpUriRequest) {
+ @Nullable
+ protected String flavor(HttpUriRequest httpUriRequest) {
return httpUriRequest.getProtocolVersion().toString();
}

MODIFY
instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientTracer.java
instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientTracer.java
@@ -47,7 +47,8 @@ public class ApacheHttpClientTracer
}
@Override
- protected @Nullable String flavor(ClassicHttpRequest request) {
+ @Nullable
+ protected String flavor(ClassicHttpRequest request) {
ProtocolVersion protocolVersion = request.getVersion();
if (protocolVersion == null) {
protocolVersion = HttpVersion.HTTP_1_1;

MODIFY
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpAttributesExtractor.java
instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpAttributesExtractor.java
@@ -89,8 +89,8 @@ final class ArmeriaHttpAttributesExtractor
}
@Override
- protected @Nullable Long responseContentLengthUncompressed(
- RequestContext ctx, RequestLog requestLog) {
+ @Nullable
+ protected Long responseContentLengthUncompressed(RequestContext ctx, RequestLog requestLog) {
return null;
}

MODIFY
instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherTracer.java
instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherTracer.java
@@ -30,12 +30,14 @@ public class LibertyDispatcherTracer
}
@Override
- protected @Nullable Integer peerPort(LibertyConnectionWrapper libertyConnectionWrapper) {
+ @Nullable
+ protected Integer peerPort(LibertyConnectionWrapper libertyConnectionWrapper) {
return libertyConnectionWrapper.peerPort();
}
@Override
- protected @Nullable String peerHostIP(LibertyConnectionWrapper libertyConnectionWrapper) {
+ @Nullable
+ protected String peerHostIP(LibertyConnectionWrapper libertyConnectionWrapper) {
return libertyConnectionWrapper.peerHostIP();
}
@@ -100,7 +102,8 @@ public class LibertyDispatcherTracer
}
@Override
- public @Nullable Context getServerContext(Void none) {
+ @Nullable
+ public Context getServerContext(Void none) {
return null;
}

MODIFY
instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyHttpClientTracer.java
instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyHttpClientTracer.java
@@ -52,7 +52,8 @@ public class NettyHttpClientTracer
}
@Override
- protected @Nullable String flavor(HttpRequest httpRequest) {
+ @Nullable
+ protected String flavor(HttpRequest httpRequest) {
return httpRequest.getProtocolVersion().getText();
}

MODIFY
instrumentation/netty/netty-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_0/client/NettyHttpClientTracer.java
instrumentation/netty/netty-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_0/client/NettyHttpClientTracer.java
@@ -52,7 +52,8 @@ public class NettyHttpClientTracer
}
@Override
- protected @Nullable String flavor(HttpRequest httpRequest) {
+ @Nullable
+ protected String flavor(HttpRequest httpRequest) {
return httpRequest.getProtocolVersion().text();
}

MODIFY
instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/client/NettyHttpClientTracer.java
instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/client/NettyHttpClientTracer.java
@@ -52,7 +52,8 @@ public class NettyHttpClientTracer
}
@Override
- protected @Nullable String flavor(HttpRequest httpRequest) {
+ @Nullable
+ protected String flavor(HttpRequest httpRequest) {
return httpRequest.protocolVersion().text();
}

MODIFY
instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcTracer.java
instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcTracer.java
@@ -38,7 +38,8 @@ public class SpringWebMvcTracer extends BaseTracer {
return TRACER;
}
- public @Nullable Context startHandlerSpan(Context parentContext, Object handler) {
+ @Nullable
+ public Context startHandlerSpan(Context parentContext, Object handler) {
String spanName = spanNameOnHandle(handler);
if (spanName != null) {
return startSpan(parentContext, spanName, INTERNAL);

MODIFY
instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpServerTracer.java
instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpServerTracer.java
@@ -83,7 +83,8 @@ public class UndertowHttpServerTracer
@SuppressWarnings("unchecked")
@Override
- public @Nullable Context getServerContext(HttpServerExchange exchange) {
+ @Nullable
+ public Context getServerContext(HttpServerExchange exchange) {
AttachmentKey<Context> contextKey =
(AttachmentKey<Context>) KeyHolder.contextKeys.get(AttachmentKey.class);
if (contextKey == null) {
@@ -93,14 +94,16 @@ public class UndertowHttpServerTracer
}
@Override
- protected @Nullable Integer peerPort(HttpServerExchange exchange) {
+ @Nullable
+ protected Integer peerPort(HttpServerExchange exchange) {
InetSocketAddress peerAddress =
exchange.getConnection().getPeerAddress(InetSocketAddress.class);
return peerAddress.getPort();
}
@Override
- protected @Nullable String peerHostIP(HttpServerExchange exchange) {
+ @Nullable
+ protected String peerHostIP(HttpServerExchange exchange) {
InetSocketAddress peerAddress =
exchange.getConnection().getPeerAddress(InetSocketAddress.class);
return peerAddress.getHostString();
@@ -132,7 +135,8 @@ public class UndertowHttpServerTracer
}
@Override
- protected @Nullable String requestHeader(HttpServerExchange exchange, String name) {
+ @Nullable
+ protected String requestHeader(HttpServerExchange exchange, String name) {
return exchange.getRequestHeaders().getFirst(name);
}

MODIFY
instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinTracer.java
instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinTracer.java
@@ -67,7 +67,8 @@ public class VaadinTracer extends BaseTracer {
}
}
- public @Nullable Context startRequestHandlerSpan(RequestHandler requestHandler, Method method) {
+ @Nullable
+ public Context startRequestHandlerSpan(RequestHandler requestHandler, Method method) {
Context current = Context.current();
// ignore nested request handlers
if (current.get(REQUEST_HANDLER_CONTEXT_KEY) != null) {

MODIFY
instrumentation/vertx-web-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientTracer.java
instrumentation/vertx-web-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientTracer.java
@@ -37,22 +37,26 @@ public class VertxClientTracer
}
@Override
- protected @Nullable URI url(HttpClientRequest request) throws URISyntaxException {
+ @Nullable
+ protected URI url(HttpClientRequest request) throws URISyntaxException {
return new URI(request.uri());
}
@Override
- protected @Nullable Integer status(HttpClientResponse response) {
+ @Nullable
+ protected Integer status(HttpClientResponse response) {
return response.statusCode();
}
@Override
- protected @Nullable String requestHeader(HttpClientRequest request, String name) {
+ @Nullable
+ protected String requestHeader(HttpClientRequest request, String name) {
return request.headers().get(name);
}
@Override
- protected @Nullable String responseHeader(HttpClientResponse response, String name) {
+ @Nullable
+ protected String responseHeader(HttpClientResponse response, String name) {
return response.getHeader(name);
}

Don't use type annotation style (#3023)