On 31/07/2013 05:53, Chris Hegarty wrote:
Thanks for bringing this back to our attention Jon. I will follow up
with the Apple folks to see what system call they are using in their
Java6 implementation. I suspect they are using getsockname to
determine the local IP address. It may be appropriate for OpenJDK to
do the same.
You might want to check with Rob McKenna on this. There were one or two
reports previously that he looked into and I think (need to find the
mails) that there weren't actually JDK issues but more likely transient
or configuration issues. There were a couple of issues related to
problems introduced by the Mac port (like changing other platforms to
use getaddrinfo) but I thought we were will past all of those at this point.
>Regarding the hostname, jtreg is executing the following code for all
>tests, not just java.io tests
>
> String hostname;
> try {
> hostname =
>InetAddress.getLocalHost().getCanonicalHostName();
> } catch (UnknownHostException e) {
> hostname = "unknown";
> }
To be more graceful you could return "localhost" or "127.0.0.1".
I agree, there are slew of reasons why it may not be possible to get the
canonical host name so a fallback to use the loopback would be much better.
-Alan.