Commit 081a777d by Mark Wielaard Committed by Mark Wielaard

InetAddress.java (toString): Use hostname when not null, don't do an explicit…

InetAddress.java (toString): Use hostname when not null, don't do an explicit reverse getHostName() lookup.

        * 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
parent 70899148
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.
......@@ -413,12 +413,13 @@ public class InetAddress implements Serializable
*/
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;
}
/**
......
......@@ -892,6 +892,9 @@ public class Socket
if (sm != null)
sm.checkSetFactory();
if (fac == null)
throw new SocketException("SocketImplFactory cannot be null");
factory = fac;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment