--- old/src/java.base/share/classes/java/net/ServerSocket.java 2019-05-29 12:09:24.171748057 +0100 +++ new/src/java.base/share/classes/java/net/ServerSocket.java 2019-05-29 12:09:23.883748067 +0100 @@ -817,7 +817,8 @@ * Returns the implementation address and implementation port of * this socket as a {@code String}. *

- * If there is a security manager set, its {@code checkConnect} method is + * If there is a security manager set, and this socket is + * {@linkplain #isBound bound}, its {@code checkConnect} method is * called with the local address and {@code -1} as its arguments to see * if the operation is allowed. If the operation is not allowed, * an {@code InetAddress} representing the @@ -831,7 +832,7 @@ return "ServerSocket[unbound]"; InetAddress in; if (System.getSecurityManager() != null) - in = InetAddress.getLoopbackAddress(); + in = getInetAddress(); else in = impl.getInetAddress(); return "ServerSocket[addr=" + in +