Enable checkstyle type var naming rule
MODIFY
gradle/enforcement/checkstyle.xml
gradle/enforcement/checkstyle.xml
<message key="name.invalidPattern"
value="Pattern variable name ''{0}'' must match pattern ''{1}''."/>
</module>
- <!--
<module name="ClassTypeParameterName">
- <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <!-- modified from default Google Java Style -->
+ <property name="format" value="^[A-Z]+[0-9]?$"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
- -->
<module name="RecordTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Record type name ''{0}'' must match pattern ''{1}''."/>
</module>
- <!--
<module name="MethodTypeParameterName">
- <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <!-- modified from default Google Java Style -->
+ <property name="format" value="^[A-Z]+[0-9]?$"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
- -->
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"

MODIFY
instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/TracingCqlSession.java
instrumentation/cassandra/cassandra-4.0/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/TracingCqlSession.java
@@ -165,8 +165,8 @@ public class TracingCqlSession implements CqlSession {
@Override
@Nullable
- public <RequestT extends Request, ResultT> ResultT execute(
- @NonNull RequestT request, @NonNull GenericType<ResultT> resultType) {
+ public <REQUEST extends Request, RESULT> RESULT execute(
+ @NonNull REQUEST request, @NonNull GenericType<RESULT> resultType) {
return session.execute(request, resultType);
}

MODIFY
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/client/TracingClientInterceptor.java
@@ -51,13 +51,13 @@ public class TracingClientInterceptor implements ClientInterceptor {
}
@Override
- public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
- MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel next) {
+ public <REQUEST, RESPONSE> ClientCall<REQUEST, RESPONSE> interceptCall(
+ MethodDescriptor<REQUEST, RESPONSE> method, CallOptions callOptions, Channel next) {
String methodName = method.getFullMethodName();
Span span = tracer.startSpan(methodName);
GrpcHelper.prepareSpan(span, methodName);
Context context = Context.current().with(span);
- final ClientCall<ReqT, RespT> result;
+ final ClientCall<REQUEST, RESPONSE> result;
try (Scope ignored = context.makeCurrent()) {
try {
// call other interceptors
@@ -77,15 +77,18 @@ public class TracingClientInterceptor implements ClientInterceptor {
return new TracingClientCall<>(result, span, context, tracer);
}
- static final class TracingClientCall<ReqT, RespT>
- extends ForwardingClientCall.SimpleForwardingClientCall<ReqT, RespT> {
+ static final class TracingClientCall<REQUEST, RESPONSE>
+ extends ForwardingClientCall.SimpleForwardingClientCall<REQUEST, RESPONSE> {
private final Span span;
private final Context context;
private final GrpcClientTracer tracer;
TracingClientCall(
- ClientCall<ReqT, RespT> delegate, Span span, Context context, GrpcClientTracer tracer) {
+ ClientCall<REQUEST, RESPONSE> delegate,
+ Span span,
+ Context context,
+ GrpcClientTracer tracer) {
super(delegate);
this.span = span;
this.context = context;
@@ -93,7 +96,7 @@ public class TracingClientInterceptor implements ClientInterceptor {
}
@Override
- public void start(Listener<RespT> responseListener, Metadata headers) {
+ public void start(Listener<RESPONSE> responseListener, Metadata headers) {
OpenTelemetry.getGlobalPropagators().getTextMapPropagator().inject(context, headers, SETTER);
try (Scope ignored = span.makeCurrent()) {
super.start(new TracingClientCallListener<>(responseListener, span, tracer), headers);
@@ -104,7 +107,7 @@ public class TracingClientInterceptor implements ClientInterceptor {
}
@Override
- public void sendMessage(ReqT message) {
+ public void sendMessage(REQUEST message) {
try (Scope ignored = span.makeCurrent()) {
super.sendMessage(message);
} catch (Throwable e) {
@@ -114,21 +117,21 @@ public class TracingClientInterceptor implements ClientInterceptor {
}
}
- static final class TracingClientCallListener<RespT>
- extends ForwardingClientCallListener.SimpleForwardingClientCallListener<RespT> {
+ static final class TracingClientCallListener<RESPONSE>
+ extends ForwardingClientCallListener.SimpleForwardingClientCallListener<RESPONSE> {
private final Span span;
private final GrpcClientTracer tracer;
private final AtomicLong messageId = new AtomicLong();
- TracingClientCallListener(Listener<RespT> delegate, Span span, GrpcClientTracer tracer) {
+ TracingClientCallListener(Listener<RESPONSE> delegate, Span span, GrpcClientTracer tracer) {
super(delegate);
this.span = span;
this.tracer = tracer;
}
@Override
- public void onMessage(RespT message) {
+ public void onMessage(RESPONSE message) {
Attributes attributes =
Attributes.of(
GrpcHelper.MESSAGE_TYPE, "SENT", GrpcHelper.MESSAGE_ID, messageId.incrementAndGet());

MODIFY
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java
instrumentation/grpc-1.5/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_5/server/TracingServerInterceptor.java
@@ -46,8 +46,10 @@ public class TracingServerInterceptor implements ServerInterceptor {
}
@Override
- public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
- ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) {
+ public <REQUEST, RESPONSE> ServerCall.Listener<REQUEST> interceptCall(
+ ServerCall<REQUEST, RESPONSE> call,
+ Metadata headers,
+ ServerCallHandler<REQUEST, RESPONSE> next) {
String methodName = call.getMethodDescriptor().getFullMethodName();
Span span = tracer.startSpan(methodName, headers);
@@ -72,12 +74,12 @@ public class TracingServerInterceptor implements ServerInterceptor {
}
}
- static final class TracingServerCall<ReqT, RespT>
- extends ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT> {
+ static final class TracingServerCall<REQUEST, RESPONSE>
+ extends ForwardingServerCall.SimpleForwardingServerCall<REQUEST, RESPONSE> {
private final Span span;
private final GrpcServerTracer tracer;
- TracingServerCall(ServerCall<ReqT, RespT> delegate, Span span, GrpcServerTracer tracer) {
+ TracingServerCall(ServerCall<REQUEST, RESPONSE> delegate, Span span, GrpcServerTracer tracer) {
super(delegate);
this.span = span;
this.tracer = tracer;
@@ -95,21 +97,21 @@ public class TracingServerInterceptor implements ServerInterceptor {
}
}
- static final class TracingServerCallListener<ReqT>
- extends ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT> {
+ static final class TracingServerCallListener<REQUEST>
+ extends ForwardingServerCallListener.SimpleForwardingServerCallListener<REQUEST> {
private final Span span;
private final GrpcServerTracer tracer;
private final AtomicLong messageId = new AtomicLong();
- TracingServerCallListener(Listener<ReqT> delegate, Span span, GrpcServerTracer tracer) {
+ TracingServerCallListener(Listener<REQUEST> delegate, Span span, GrpcServerTracer tracer) {
super(delegate);
this.span = span;
this.tracer = tracer;
}
@Override
- public void onMessage(ReqT message) {
+ public void onMessage(REQUEST message) {
// TODO(anuraaga): Restore
Attributes attributes =
Attributes.of(

MODIFY
instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/util/CombinedSimpleChannelHandler.java
instrumentation/netty/netty-3.8/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/util/CombinedSimpleChannelHandler.java
@@ -17,14 +17,14 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.WriteCompletionEvent;
public class CombinedSimpleChannelHandler<
- Upstream extends SimpleChannelUpstreamHandler,
- Downstream extends SimpleChannelDownstreamHandler>
+ UPSTREAM extends SimpleChannelUpstreamHandler,
+ DOWNSTREAM extends SimpleChannelDownstreamHandler>
extends SimpleChannelHandler {
- private final Upstream upstream;
- private final Downstream downstream;
+ private final UPSTREAM upstream;
+ private final DOWNSTREAM downstream;
- public CombinedSimpleChannelHandler(Upstream upstream, Downstream downstream) {
+ public CombinedSimpleChannelHandler(UPSTREAM upstream, DOWNSTREAM downstream) {
this.upstream = upstream;
this.downstream = downstream;
}

Enable checkstyle type var naming rule (#1666)