addresses = getHostByName(hostname); if ((addresses == null) || (addresses.length == 0)) { throw new UnknownHostException( hostname); }
if (hostname == null) { addresses = new InetAddress[1]; addresses[0] = LOCALHOST; return addresses; }
    public static InetAddress[] getAllByName(String hostname)            throws UnknownHostException {        // Default to current host if necessary        if (hostname == null) {            InetAddress local = getLocalHost();            return getAllByName(local.getHostName());        }        // Check the cache for this host before doing a lookup        InetAddress[] addresses = checkCacheFor(hostname);        if (addresses != null) return (addresses);        // Not in cache, try the lookup        addresses = getHostByName(hostname);        if ((addresses == null) || (addresses.length == 0)) { throw new UnknownHostException(                hostname); }        addToCache(hostname, addresses);        return addresses;    }