2004-03-16 Norbert Frese <postfach@nfrese.net>
* java/net/InetAddress.java (getByName): Handle hostname == "" case. From-SVN: r79529
This commit is contained in:
parent
6828de5bff
commit
27729a060c
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-03-16 Norbert Frese <postfach@nfrese.net>
|
||||||
|
|
||||||
|
* java/net/InetAddress.java
|
||||||
|
(getByName): Handle hostname == "" case.
|
||||||
|
|
||||||
2004-03-16 Dalibor Topic <robilad@kaffe.org>
|
2004-03-16 Dalibor Topic <robilad@kaffe.org>
|
||||||
|
|
||||||
Reported by: Adam Heath <doogie@debian.org>
|
Reported by: Adam Heath <doogie@debian.org>
|
||||||
|
|
|
@ -573,7 +573,7 @@ public class InetAddress implements Serializable
|
||||||
* Returns an InetAddress object representing the IP address of the given
|
* Returns an InetAddress object representing the IP address of the given
|
||||||
* hostname. This name can be either a hostname such as "www.urbanophile.com"
|
* 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
|
* 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
|
* default. This method is equivalent to returning the first element in
|
||||||
* the InetAddress array returned from GetAllByName.
|
* the InetAddress array returned from GetAllByName.
|
||||||
*
|
*
|
||||||
|
@ -594,7 +594,7 @@ public class InetAddress implements Serializable
|
||||||
s.checkConnect (hostname, -1);
|
s.checkConnect (hostname, -1);
|
||||||
|
|
||||||
// Default to current host if necessary
|
// Default to current host if necessary
|
||||||
if (hostname == null)
|
if (hostname == null || hostname.length() == 0)
|
||||||
return getLocalHost();
|
return getLocalHost();
|
||||||
|
|
||||||
// Assume that the host string is an IP address
|
// Assume that the host string is an IP address
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue