Skip to content

Commit c4d0100

Browse files
Update NettyUtils.java
1 parent 4ab713c commit c4d0100

File tree

1 file changed

+4
-5
lines changed
  • http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils

1 file changed

+4
-5
lines changed

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtils.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,10 @@ private static String getMessageForTooManyAcquireOperationsError() {
133133
}
134134

135135
public static String closedChannelMessage(Channel channel) {
136-
ChannelDiagnostics channelDiagnostics = null, parentChannelDiagnostics = null;
137-
if (channel != null) {
138-
channelDiagnostics = channel.attr(CHANNEL_DIAGNOSTICS).get();
139-
parentChannelDiagnostics = channel.parent() != null ? channel.parent().attr(CHANNEL_DIAGNOSTICS).get() : null;
140-
}
136+
ChannelDiagnostics channelDiagnostics = channel != null && channel.attr(CHANNEL_DIAGNOSTICS) != null ?
137+
channel.attr(CHANNEL_DIAGNOSTICS).get() : null;
138+
ChannelDiagnostics parentChannelDiagnostics = channel != null && channel.parent() != null ?
139+
channel.parent().attr(CHANNEL_DIAGNOSTICS).get() : null;
141140

142141
StringBuilder error = new StringBuilder();
143142
error.append("The connection was closed during the request. The request will usually succeed on a retry, but if it does"

0 commit comments

Comments
 (0)