8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f
Reviewed-by: chegar
--- a/jdk/src/share/classes/java/net/InetAddress.java Fri Nov 08 12:19:25 2013 -0800
+++ b/jdk/src/share/classes/java/net/InetAddress.java Fri Nov 08 21:07:42 2013 +0000
@@ -1144,7 +1144,7 @@
ifname = host.substring (pos+1);
}
}
- if ((addr = IPAddressUtil.textToNumericFormatV6(host)) == null) {
+ if ((addr = IPAddressUtil.textToNumericFormatV6(host)) == null && host.contains(":")) {
throw new UnknownHostException(host + ": invalid IPv6 address");
}
} else if (ipv6Expected) {