2003-10-02 Guilhem Lavaux <guilhem@kaffe.org>

* java/net/InetSocketAddress.java
	(InetSocketAddress): Made exception more clear.
	(equals): Handle case when addr is null.
	(toString): Likewise.
	* java/net/NetworkInterface.java
	(static): Load native library.
	(getNetworkInterfaces): Rewritten.

From-SVN: r72047
This commit is contained in:
Guilhem Lavaux 2003-10-02 19:29:31 +00:00 committed by Michael Koch
parent bca48dc625
commit d1aa479583
3 changed files with 38 additions and 13 deletions

View file

@ -37,6 +37,7 @@ exception statement from your version. */
package java.net;
import gnu.classpath.Configuration;
import java.util.Enumeration;
import java.util.Vector;
@ -52,6 +53,14 @@ import java.util.Vector;
*/
public final class NetworkInterface
{
static
{
if (Configuration.INIT_LOAD_LIBRARY)
{
System.loadLibrary ("javanet");
}
}
private String name;
private Vector inetAddresses;
@ -185,14 +194,12 @@ public final class NetworkInterface
public static Enumeration getNetworkInterfaces ()
throws SocketException
{
Vector networkInterfaces = getRealNetworkInterfaces ();
Vector networkInterfaces = getRealNetworkInterfaces();
Enumeration tmp = networkInterfaces.elements ();
if (networkInterfaces.isEmpty())
return null;
if (tmp.hasMoreElements ())
return tmp;
return null;
return networkInterfaces.elements();
}
/**