mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8201545: InetAddress.getByName/getAllByName should clarify empty String behavior
Reviewed-by: chegar
This commit is contained in:
parent
0f478d2cfd
commit
3e47229057
2 changed files with 45 additions and 15 deletions
|
@ -1222,11 +1222,17 @@ class InetAddress implements java.io.Serializable {
|
|||
* supported. See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
|
||||
* scoped addresses.
|
||||
*
|
||||
* <p> If the host is {@code null} then an {@code InetAddress}
|
||||
* representing an address of the loopback interface is returned.
|
||||
* <p> If the host is {@code null} or {@code host.length()} is equal
|
||||
* to zero, then an {@code InetAddress} representing an address of the
|
||||
* loopback interface is returned.
|
||||
* See <a href="http://www.ietf.org/rfc/rfc3330.txt">RFC 3330</a>
|
||||
* section 2 and <a href="http://www.ietf.org/rfc/rfc2373.txt">RFC 2373</a>
|
||||
* section 2.5.3. </p>
|
||||
* section 2.5.3.
|
||||
*
|
||||
* <p> If there is a security manager, and {@code host} is not {@code null}
|
||||
* or {@code host.length() } is not equal to zero, the security manager's
|
||||
* {@code checkConnect} method is called with the hostname and {@code -1}
|
||||
* as its arguments to determine if the operation is allowed.
|
||||
*
|
||||
* @param host the specified host, or {@code null}.
|
||||
* @return an IP address for the given host name.
|
||||
|
@ -1262,18 +1268,18 @@ class InetAddress implements java.io.Serializable {
|
|||
* also be qualified by appending a scoped zone identifier or scope_id.
|
||||
* The syntax and usage of scope_ids is described
|
||||
* <a href="Inet6Address.html#scoped">here</a>.
|
||||
* <p> If the host is {@code null} then an {@code InetAddress}
|
||||
* representing an address of the loopback interface is returned.
|
||||
*
|
||||
* <p> If the host is {@code null} or {@code host.length()} is equal
|
||||
* to zero, then an {@code InetAddress} representing an address of the
|
||||
* loopback interface is returned.
|
||||
* See <a href="http://www.ietf.org/rfc/rfc3330.txt">RFC 3330</a>
|
||||
* section 2 and <a href="http://www.ietf.org/rfc/rfc2373.txt">RFC 2373</a>
|
||||
* section 2.5.3. </p>
|
||||
*
|
||||
* <p> If there is a security manager and {@code host} is not
|
||||
* null and {@code host.length() } is not equal to zero, the
|
||||
* security manager's
|
||||
* {@code checkConnect} method is called
|
||||
* with the hostname and {@code -1}
|
||||
* as its arguments to see if the operation is allowed.
|
||||
* <p> If there is a security manager, and {@code host} is not {@code null}
|
||||
* or {@code host.length() } is not equal to zero, the security manager's
|
||||
* {@code checkConnect} method is called with the hostname and {@code -1}
|
||||
* as its arguments to determine if the operation is allowed.
|
||||
*
|
||||
* @param host the name of the host, or {@code null}.
|
||||
* @return an array of all the IP addresses for a given host name.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue