getLocalHost and localhost fail

Claude Vittoria <[email protected]>
Newsgroups gmane.comp.java.classpath.devel
Message-ID <[email protected]>
Hi,

I get an issue with getLocalHost. I trace and I see getLocalHostname
return localhost and after the call at getbyname, getallbyname then
getHostbyName !?! and fails. I see with strace a request to the
nameserver ?!?

My question why the nameserver is called to resolv localhost ?

Why in InetAddress.java l.579 the test:
if (hostname == null || hostname.length() == 0)

is not
if (hostname == null || hostname.length() == 0 || "locahost".equals(hostname))

Thanks for your light.

Cheers,
Claude
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.