Skip to content

Commit 5ebe11e

Browse files
committed
Rename catch variables to follow naming convention
Rename catch clause variables across the repo: - `exception` -> `e` for used exception catch variables - `exception` -> `t` for used Throwable catch variables - `throwable` -> `t` for used Throwable catch variables - unused catch parameters -> `ignored`
1 parent 9771989 commit 5ebe11e

File tree

151 files changed

+361
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+361
-361
lines changed

instrumentation-annotations-support/src/main/java/io/opentelemetry/instrumentation/api/annotation/support/AnnotationReflectionHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static Class<? extends Annotation> forNameOrNull(
2525
ClassLoader classLoader, String className) {
2626
try {
2727
return Class.forName(className, true, classLoader).asSubclass(Annotation.class);
28-
} catch (ClassNotFoundException | ClassCastException exception) {
28+
} catch (ClassNotFoundException | ClassCastException ignored) {
2929
return null;
3030
}
3131
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/internal/SqlCommenterUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static String processQuery(String query, TextMapPropagator propagator, bo
5959
stringBuilder.append(", ");
6060
}
6161
}
62-
} catch (UnsupportedEncodingException exception) {
62+
} catch (UnsupportedEncodingException e) {
6363
// this exception should never happen as UTF-8 encoding is always available
6464
}
6565
stringBuilder.append("*/");

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/InternalInstrumenterCustomizerUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class InternalInstrumenterCustomizerUtil {
2121
// this class
2222
Class.forName(
2323
"io.opentelemetry.instrumentation.api.incubator.instrumenter.internal.InstrumenterCustomizerUtil");
24-
} catch (ClassNotFoundException exception) {
24+
} catch (ClassNotFoundException ignored) {
2525
// incubator api not available, ignore
2626
}
2727
}

instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTestUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static Object newFrameworkModel() {
2020
return Class.forName("org.apache.dubbo.rpc.model.FrameworkModel")
2121
.getDeclaredConstructor()
2222
.newInstance();
23-
} catch (ReflectiveOperationException exception) {
23+
} catch (ReflectiveOperationException ignored) {
2424
return null;
2525
}
2626
}

instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/AbstractApacheHttpClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public void sendRequestWithCallback(
4141
HttpClientResult requestResult) {
4242
try {
4343
executeRequestWithCallback(request, uri, requestResult);
44-
} catch (Throwable throwable) {
45-
requestResult.complete(throwable);
44+
} catch (Throwable t) {
45+
requestResult.complete(t);
4646
}
4747
}
4848

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/AbstractApacheHttpClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public void sendRequestWithCallback(
6969
HttpClientResult httpClientResult) {
7070
try {
7171
executeRequestWithCallback(request, uri, httpClientResult);
72-
} catch (Throwable throwable) {
73-
httpClientResult.complete(throwable);
72+
} catch (Throwable t) {
73+
httpClientResult.complete(t);
7474
}
7575
}
7676

instrumentation/armeria/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ServerDecorator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exc
4848

4949
try {
5050
return unwrap().serve(ctx, req);
51-
} catch (Throwable throwable) {
51+
} catch (Throwable t) {
5252
Span span = Span.fromContext(otelContext);
5353
span.setStatus(StatusCode.ERROR);
54-
span.recordException(ErrorCauseExtractor.getDefault().extract(throwable));
54+
span.recordException(ErrorCauseExtractor.getDefault().extract(t));
5555

56-
throw throwable;
56+
throw t;
5757
}
5858
}
5959
}

instrumentation/armeria/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/SubscriberWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private static Class<?> getAbortingSubscriberClass() {
2121
// AbortingSubscriber is package private
2222
try {
2323
return Class.forName("com.linecorp.armeria.common.stream.AbortingSubscriber");
24-
} catch (ClassNotFoundException exception) {
24+
} catch (ClassNotFoundException ignored) {
2525
return null;
2626
}
2727
}
@@ -30,7 +30,7 @@ private static Class<?> getNoopSubscriberClass() {
3030
// NoopSubscriber is package private
3131
try {
3232
return Class.forName("com.linecorp.armeria.common.stream.NoopSubscriber");
33-
} catch (ClassNotFoundException exception) {
33+
} catch (ClassNotFoundException ignored) {
3434
return null;
3535
}
3636
}

instrumentation/armeria/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/RequestContextAccess.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ private static InetSocketAddress getAddress(
3838
if (address instanceof InetSocketAddress) {
3939
return (InetSocketAddress) address;
4040
}
41-
} catch (Throwable throwable) {
42-
throw new IllegalStateException("Failed to get address", throwable);
41+
} catch (Throwable t) {
42+
throw new IllegalStateException("Failed to get address", t);
4343
}
4444
}
4545
return null;

instrumentation/async-http-client/async-http-client-2.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ private static void setTimeout(
5151
Method method =
5252
builder.getClass().getMethod(methodName, testLatestDeps ? Duration.class : int.class);
5353
method.invoke(builder, testLatestDeps ? Duration.ofMillis(timeout) : timeout);
54-
} catch (Exception exception) {
55-
throw new IllegalStateException("Failed to set timeout " + methodName, exception);
54+
} catch (Exception e) {
55+
throw new IllegalStateException("Failed to set timeout " + methodName, e);
5656
}
5757
}
5858

0 commit comments

Comments
 (0)