regression: jdk1.7.0_04 java.net.InetAddress.getLocalHost().getHostName() return FQHN
Alan Bateman
Alan.Bateman at oracle.com
Wed May 9 05:02:53 PDT 2012
On 09/05/2012 10:15, Wolfgang Hoschek wrote:
> [7u6] In jdk1.7.0_04 GA java.net.InetAddress.getLocalHost().getHostName() return the fully qualified host name (e.g. "ip-10-172-17-93.us-west-1.compute.internal") instead of returning the hostname without the domain (e.g. "ip-10-172-17-93"). This is a regression wrt. all prior versions of jdk 1.7 and jdk 1.6. This breaks applications that expect the old behavior.
>
This isn't really a bug, it's always been possible for getHostName to
return the FQHN, it's just been very platform and configuration
specific. However there was a behavior change on Linux and Mac in 7u4
and jdk8 that came via the addition of the Mac port. He has already been
fixed in jdk8 as 7166687 [1] and I believe Rob intends to get it into
jdk7u too.
-Alan
[1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b26c04717735
More information about the jdk7u-dev
mailing list