Skip to content

Commit 3af91d2

Browse files
authored
Code review sweep (run 24947827165) (#18305)
1 parent c5154bc commit 3af91d2

13 files changed

Lines changed: 20 additions & 19 deletions

File tree

instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/autoconfigure/TracingRequestHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
public final class TracingRequestHandler extends RequestHandler2 {
2525

26-
private static final RequestHandler2 DELEGATE = buildDelegate(GlobalOpenTelemetry.get());
26+
private static final RequestHandler2 delegate = buildDelegate(GlobalOpenTelemetry.get());
2727

2828
@SuppressWarnings("deprecation") // using deprecated config property
2929
private static RequestHandler2 buildDelegate(OpenTelemetry openTelemetry) {
@@ -56,21 +56,21 @@ private static RequestHandler2 buildDelegate(OpenTelemetry openTelemetry) {
5656

5757
@Override
5858
public void beforeRequest(Request<?> request) {
59-
DELEGATE.beforeRequest(request);
59+
delegate.beforeRequest(request);
6060
}
6161

6262
@Override
6363
public AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request) {
64-
return DELEGATE.beforeMarshalling(request);
64+
return delegate.beforeMarshalling(request);
6565
}
6666

6767
@Override
6868
public void afterResponse(Request<?> request, Response<?> response) {
69-
DELEGATE.afterResponse(request, response);
69+
delegate.afterResponse(request, response);
7070
}
7171

7272
@Override
7373
public void afterError(Request<?> request, Response<?> response, Exception e) {
74-
DELEGATE.afterError(request, response, e);
74+
delegate.afterError(request, response, e);
7575
}
7676
}

instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/awssdk/v1_11/instrumentor/SqsSuppressReceiveSpansTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected InstrumentationExtension testing() {
2222
}
2323

2424
@Override
25-
public AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
25+
protected AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
2626
return client;
2727
}
2828
}

instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/test/java/io/opentelemetry/javaagent/instrumentation/awssdk/v1_11/SqsTracingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected InstrumentationExtension testing() {
2222
}
2323

2424
@Override
25-
public AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
25+
protected AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
2626
return client;
2727
}
2828
}

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractBaseAwsClientTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void assertRequestWithMockedResponse(
7777
String operation,
7878
String method,
7979
List<AttributeAssertion> additionalAttributes)
80-
throws Exception {
80+
throws ReflectiveOperationException {
8181

8282
assertThat(response).isNotNull();
8383

@@ -125,7 +125,8 @@ public void assertRequestWithMockedResponse(
125125
}
126126

127127
@SuppressWarnings("unchecked")
128-
protected List<RequestHandler2> extractRequestHandlers(Object client) throws Exception {
128+
protected List<RequestHandler2> extractRequestHandlers(Object client)
129+
throws ReflectiveOperationException {
129130
Field requestHandler2sField = AmazonWebServiceClient.class.getDeclaredField("requestHandler2s");
130131
requestHandler2sField.setAccessible(true);
131132
return (List<RequestHandler2>) requestHandler2sField.get(client);

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractDynamoDbClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected boolean hasRequestId() {
4242

4343
@SuppressWarnings("deprecation") // using deprecated semconv
4444
@Test
45-
void sendRequestWithMockedResponse() throws Exception {
45+
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
4646
AmazonDynamoDBClientBuilder clientBuilder = AmazonDynamoDBClientBuilder.standard();
4747
AmazonDynamoDB client =
4848
configureClient(clientBuilder)

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractEc2ClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected boolean hasRequestId() {
2424
}
2525

2626
@Test
27-
void sendRequestWithMockedResponse() throws Exception {
27+
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
2828
AmazonEC2ClientBuilder clientBuilder = AmazonEC2ClientBuilder.standard();
2929
AmazonEC2 client =
3030
configureClient(clientBuilder)

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractKinesisClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected boolean hasRequestId() {
3535
@ParameterizedTest
3636
@MethodSource("provideArguments")
3737
void testSendRequestWithMockedResponse(String operation, Function<AmazonKinesis, Object> call)
38-
throws Exception {
38+
throws ReflectiveOperationException {
3939
AmazonKinesisClientBuilder clientBuilder = AmazonKinesisClientBuilder.standard();
4040

4141
AmazonKinesis client =

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractLambdaClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void testSendRequestWithMockedResponse(
172172
String responseBody,
173173
List<AttributeAssertion> additionalAttributes,
174174
Function<AWSLambda, Object> call)
175-
throws Exception {
175+
throws ReflectiveOperationException {
176176
AWSLambdaClientBuilder clientBuilder = AWSLambdaClientBuilder.standard();
177177
AWSLambda client =
178178
configureClient(clientBuilder)

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractRdsClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected boolean hasRequestId() {
2525
}
2626

2727
@Test
28-
void sendRequestWithMockedResponse() throws Exception {
28+
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
2929
AmazonRDSClientBuilder clientBuilder = AmazonRDSClientBuilder.standard();
3030
AmazonRDS client =
3131
configureClient(clientBuilder)

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractS3ClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void testSendRequestWithMockedResponse(
6464
String method,
6565
Function<AmazonS3, Object> call,
6666
List<AttributeAssertion> additionalAttributes)
67-
throws Exception {
67+
throws ReflectiveOperationException {
6868

6969
AmazonS3 client =
7070
configureClient(clientBuilder)

0 commit comments

Comments
 (0)