mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8224730: java.net.ServerSocket::toString not invoking checkConnect
Reviewed-by: alanb
This commit is contained in:
parent
e72bfe15ad
commit
3ab3ffd29f
2 changed files with 292 additions and 2 deletions
|
@ -817,7 +817,8 @@ class ServerSocket implements java.io.Closeable {
|
|||
* Returns the implementation address and implementation port of
|
||||
* this socket as a {@code String}.
|
||||
* <p>
|
||||
* 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 @@ class ServerSocket implements java.io.Closeable {
|
|||
return "ServerSocket[unbound]";
|
||||
InetAddress in;
|
||||
if (System.getSecurityManager() != null)
|
||||
in = InetAddress.getLoopbackAddress();
|
||||
in = getInetAddress();
|
||||
else
|
||||
in = impl.getInetAddress();
|
||||
return "ServerSocket[addr=" + in +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue