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:
parent
bca48dc625
commit
d1aa479583
3 changed files with 38 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue