--- a/src/java.base/share/classes/java/net/InetAddress.java Mon Apr 30 16:27:23 2018 +0200
+++ b/src/java.base/share/classes/java/net/InetAddress.java Mon Apr 30 16:13:30 2018 +0100
@@ -1222,11 +1222,17 @@
* 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 @@
* 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.