Skip to content

Commit d421878

Browse files
committed
Taking out incorrect try-with-resources block
1 parent f7a9464 commit d421878

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

http-clients/aws-crt-client/src/main/java/software/amazon/awssdk/http/crt/AwsCrtAsyncHttpClient.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ public AwsCrtAsyncHttpClient(DefaultBuilder builder, AttributeMap config) {
100100
this.bootstrap = own(new ClientBootstrap(builder.eventLoopGroup, builder.hostResolver));
101101
this.socketOptions = own(new SocketOptions());
102102

103-
try (TlsContextOptions defaultClientOptions = TlsContextOptions.createDefaultClient()
103+
/**
104+
* Sonar raises a false-positive that the TlsContextOptions created here will not be closed. Using a "NOSONAR"
105+
* comment so that Sonar will ignore that false-positive.
106+
*/
107+
this.tlsContextOptions = own(TlsContextOptions.createDefaultClient() // NOSONAR
104108
.withCipherPreference(builder.cipherPreference)
105-
.withVerifyPeer(builder.verifyPeer)) {
106-
this.tlsContextOptions = own(defaultClientOptions);
107-
}
109+
.withVerifyPeer(builder.verifyPeer));
108110

109111
this.tlsContext = own(new TlsContext(this.tlsContextOptions));
110112
this.windowSize = builder.windowSize;

0 commit comments

Comments
 (0)