Skip to content

Commit 5ccf921

Browse files
committed
simplify
1 parent 179c56f commit 5ccf921

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/JaxMultithreadedClientTest.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,11 @@ protected void configure(ServerBuilder sb) {
4343

4444
@SuppressWarnings("CatchingUnchecked")
4545
boolean checkUri(JerseyClientBuilder builder, URI uri) {
46-
Client client = builder.build();
47-
try {
48-
Response response = client.target(uri).request().get();
49-
try {
50-
return false;
51-
} finally {
52-
response.close();
53-
}
46+
try (Client client = builder.build();
47+
Response response = client.target(uri).request().get()) {
48+
return false;
5449
} catch (Exception e) {
5550
return true;
56-
} finally {
57-
client.close();
5851
}
5952
}
6053

0 commit comments

Comments
 (0)