Skip to content

Commit 16e8305

Browse files
8273059: Redundant Math.min call in Http2ClientImpl#getConnectionWindowSize
Reviewed-by: dfuchs
1 parent f55d5ab commit 16e8305

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ int getConnectionWindowSize(SettingsFrame clientSettings) {
237237

238238
// The default is the max between the stream window size
239239
// and the connection window size.
240-
int defaultValue = Math.min(Integer.MAX_VALUE,
241-
Math.max(streamWindow, K*K*32));
240+
int defaultValue = Math.max(streamWindow, K*K*32);
242241

243242
return getParameter(
244243
"jdk.httpclient.connectionWindowSize",

src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ public void accept(ByteBuffer b) {
489489
debug.log("already closed: " + closedExceptionally);
490490
return;
491491
}
492-
boolean completed = false;
493492
try {
494493
if (debug.on())
495494
debug.log("Parser got %d bytes ", b.remaining());
@@ -506,9 +505,7 @@ public void accept(ByteBuffer b) {
506505
} catch (Throwable t) {
507506
if (debug.on()) debug.log("Unexpected exception", t);
508507
closedExceptionally = t;
509-
if (!completed) {
510-
onComplete.accept(t);
511-
}
508+
onComplete.accept(t);
512509
}
513510
}
514511

0 commit comments

Comments
 (0)