Commit e5f3cd6b by Michael Koch Committed by Michael Koch

2003-05-05 Michael Koch <konqueror@gmx.de>

	* java/net/NetworkInterface.java
	(networkInterfaces): Removed.
	(getByName): Use getRealNetworkInterfaces() instead of
	networkInterfaces.
	(getByInetAddress): Likewise.
	(getNetworkInterfaces): Likewise.
	(toString): Fix output of addresses of an interface.

From-SVN: r66500
parent bc9ec0e0
2003-05-05 Michael Koch <konqueror@gmx.de> 2003-05-05 Michael Koch <konqueror@gmx.de>
* java/net/NetworkInterface.java
(networkInterfaces): Removed.
(getByName): Use getRealNetworkInterfaces() instead of
networkInterfaces.
(getByInetAddress): Likewise.
(getNetworkInterfaces): Likewise.
(toString): Fix output of addresses of an interface.
2003-05-05 Michael Koch <konqueror@gmx.de>
* java/io/DataInputStream.java: * java/io/DataInputStream.java:
Merged new documentation from classpath. Merged new documentation from classpath.
......
...@@ -46,8 +46,6 @@ import java.util.Vector; ...@@ -46,8 +46,6 @@ import java.util.Vector;
*/ */
public final class NetworkInterface public final class NetworkInterface
{ {
private static Vector networkInterfaces;
private String name; private String name;
private Vector inetAddresses; private Vector inetAddresses;
...@@ -125,8 +123,7 @@ public final class NetworkInterface ...@@ -125,8 +123,7 @@ public final class NetworkInterface
public static NetworkInterface getByName (String name) public static NetworkInterface getByName (String name)
throws SocketException throws SocketException
{ {
if (networkInterfaces == null) Vector networkInterfaces = getRealNetworkInterfaces ();
networkInterfaces = getRealNetworkInterfaces ();
for (Enumeration e = networkInterfaces.elements (); for (Enumeration e = networkInterfaces.elements ();
e.hasMoreElements (); ) e.hasMoreElements (); )
...@@ -151,8 +148,7 @@ public final class NetworkInterface ...@@ -151,8 +148,7 @@ public final class NetworkInterface
public static NetworkInterface getByInetAddress (InetAddress addr) public static NetworkInterface getByInetAddress (InetAddress addr)
throws SocketException throws SocketException
{ {
if (networkInterfaces == null) Vector networkInterfaces = getRealNetworkInterfaces ();
networkInterfaces = getRealNetworkInterfaces ();
for (Enumeration interfaces = networkInterfaces.elements (); for (Enumeration interfaces = networkInterfaces.elements ();
interfaces.hasMoreElements (); ) interfaces.hasMoreElements (); )
...@@ -179,10 +175,10 @@ public final class NetworkInterface ...@@ -179,10 +175,10 @@ public final class NetworkInterface
public static Enumeration getNetworkInterfaces () public static Enumeration getNetworkInterfaces ()
throws SocketException throws SocketException
{ {
if (networkInterfaces == null) Vector networkInterfaces = getRealNetworkInterfaces ();
networkInterfaces = getRealNetworkInterfaces ();
Enumeration tmp = networkInterfaces.elements (); Enumeration tmp = networkInterfaces.elements ();
if (tmp.hasMoreElements ()) if (tmp.hasMoreElements ())
return tmp; return tmp;
...@@ -200,6 +196,7 @@ public final class NetworkInterface ...@@ -200,6 +196,7 @@ public final class NetworkInterface
return false; return false;
NetworkInterface tmp = (NetworkInterface) obj; NetworkInterface tmp = (NetworkInterface) obj;
return (name.equals (tmp.name) return (name.equals (tmp.name)
&& inetAddresses.equals (tmp.inetAddresses)); && inetAddresses.equals (tmp.inetAddresses));
} }
...@@ -229,7 +226,7 @@ public final class NetworkInterface ...@@ -229,7 +226,7 @@ public final class NetworkInterface
e.hasMoreElements (); ) e.hasMoreElements (); )
{ {
InetAddress address = (InetAddress) e.nextElement (); InetAddress address = (InetAddress) e.nextElement ();
result += address.toString () + separator; result += address.toString () + ";" + separator;
} }
return result; return result;
......
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