* java/net/InetAddress.java (toString): Use hostname when not null,
don't do an explicit reverse getHostName() lookup.
* java/net/Socket.java (setSocketImplFactory): When fac == null throw
NullPointerException.
From-SVN: r59902
+2002-12-06 Mark Wielaard <mark@klomp.org>
+
+ * java/net/InetAddress.java (toString): Use hostname when not null,
+ don't do an explicit reverse getHostName() lookup.
+ * java/net/Socket.java (setSocketImplFactory): When fac == null throw
+ NullPointerException.
+
2002-12-06 Tom Tromey <tromey@redhat.com>
* include/java-interp.h (class _Jv_InterpMethod): Added
// INetAddress.java -- An Internet Protocol (IP) address.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation
This file is part of libgcj.
*/
public String toString()
{
- String hostname = getHostName ();
-
- if (hostname == "")
- hostname = getHostAddress ();
-
- return hostname + '/' + getHostAddress ();
+ String result;
+ String address = getHostAddress();
+ if (hostName != null)
+ result = hostName + "/" + address;
+ else
+ result = address;
+ return result;
}
/**
if (sm != null)
sm.checkSetFactory();
+ if (fac == null)
+ throw new SocketException("SocketImplFactory cannot be null");
+
factory = fac;
}