Index: java/net/InetAddress.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/net/InetAddress.java,v retrieving revision 1.28 diff -u -b -B -r1.28 InetAddress.java --- java/net/InetAddress.java 9 Oct 2003 15:59:56 -0000 1.28 +++ java/net/InetAddress.java 20 Mar 2004 14:03:06 -0000 @@ -270,7 +271,6 @@ { // This is the IPv4 implementation. // Any class derived from InetAddress should override this. - return equals (ANY_IF); } @@ -499,8 +499,7 @@ */ public boolean equals (Object obj) { - if (obj == null - || ! (obj instanceof InetAddress)) + if (! (obj instanceof InetAddress)) return false; // "The Java Class Libraries" 2nd edition says "If a machine has @@ -625,7 +624,7 @@ * Returns an InetAddress object representing the IP address of the given * hostname. This name can be either a hostname such as "www.urbanophile.com" * or an IP address in dotted decimal format such as "127.0.0.1". If the - * hostname is null, the hostname of the local machine is supplied by + * hostname is null or "", the hostname of the local machine is supplied by * default. This method is equivalent to returning the first element in * the InetAddress array returned from GetAllByName. * @@ -646,10 +645,10 @@ s.checkConnect (hostname, -1); // Default to current host if necessary - if (hostname == null) + if (hostname == null || hostname.length() == 0) return getLocalHost(); - // Assume that the host string is an IP address. + // Assume that the host string is an IP address byte[] address = aton (hostname); if (address != null) return new InetAddress (address); @@ -851,7 +850,7 @@ throws UnknownHostException; /* - * Needed for serialization. + * Needed for serialization */ private void readResolve() throws ObjectStreamException {