From http://mail.openjdk.java.net/pipermail/jtreg-use/2013-July/000217.html
>
> >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.
>
> >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.
- links to