aboutsummaryrefslogtreecommitdiff
path: root/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java')
-rw-r--r--src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
index e03dc34e900..265accdbc37 100644
--- a/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/ConnectionPool.java
@@ -104,14 +104,10 @@ final class ConnectionPool {
return false;
}
if (secure && destination != null) {
- if (destination.getHostName() != null) {
- if (!destination.getHostName().equalsIgnoreCase(
- other.destination.getHostName())) {
- return false;
- }
- } else {
- if (other.destination.getHostName() != null)
- return false;
+ String hostString = destination.getHostString();
+ if (hostString == null || !hostString.equalsIgnoreCase(
+ other.destination.getHostString())) {
+ return false;
}
}
return true;