From 9f2a4fad1715ccbc339d2476bbdc7a52e9a13380 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Fri, 19 Apr 2024 10:07:25 +0000 Subject: [PATCH] 8330572: jdk.internal.net.http.HttpConnection calls an expensive checkOpen() when returning a HTTP/1.1 connection to the pool Reviewed-by: dfuchs, djelinski --- .../share/classes/jdk/internal/net/http/HttpConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java b/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java index ffff6751865..8fbf27ddc46 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -409,7 +409,7 @@ abstract class HttpConnection implements Closeable { .map((s) -> !s.equalsIgnoreCase("close")) .orElse(true); - if (keepAlive && checkOpen()) { + if (keepAlive && isOpen()) { Log.logTrace("Returning connection to the pool: {0}", this); pool.returnToPool(this); } else {