This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.net.NetworkInterface


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


as discussed on java@gcc.gnu.org I commited the attached patch to 
trunk to fix java.net.NetworkInterface.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+tsdzWSOgCCdjSDsRAg+ZAKCIGiIkPM0MWNWDbGuEgBWlfkJ4uQCfe+9p
KKCXTYumX0JCMremwWuC/ok=
=V8d6
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1874
diff -u -b -B -r1.1874 ChangeLog
--- ChangeLog	5 May 2003 13:37:14 -0000	1.1874
+++ ChangeLog	5 May 2003 20:17:17 -0000
@@ -1,5 +1,15 @@
 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:
 	Merged new documentation from classpath.
 
Index: java/net/NetworkInterface.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/NetworkInterface.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 NetworkInterface.java
--- java/net/NetworkInterface.java	4 Mar 2003 06:00:43 -0000	1.5
+++ java/net/NetworkInterface.java	5 May 2003 20:17:17 -0000
@@ -46,8 +46,6 @@
  */
 public final class NetworkInterface
 {
-  private static Vector networkInterfaces;
-	
   private String name;
   
   private Vector inetAddresses;
@@ -125,8 +123,7 @@
   public static NetworkInterface getByName (String name)
     throws SocketException
   {
-    if (networkInterfaces == null)
-      networkInterfaces = getRealNetworkInterfaces ();
+    Vector networkInterfaces = getRealNetworkInterfaces ();
 
     for (Enumeration e = networkInterfaces.elements ();
          e.hasMoreElements (); )
@@ -151,8 +148,7 @@
   public static NetworkInterface getByInetAddress (InetAddress addr)
     throws SocketException
   {
-    if (networkInterfaces == null)
-      networkInterfaces = getRealNetworkInterfaces ();
+    Vector networkInterfaces = getRealNetworkInterfaces ();
     
     for (Enumeration interfaces = networkInterfaces.elements ();
          interfaces.hasMoreElements (); )
@@ -179,10 +175,10 @@
   public static Enumeration getNetworkInterfaces ()
     throws SocketException
   {
-    if (networkInterfaces == null)
-      networkInterfaces = getRealNetworkInterfaces ();
+    Vector networkInterfaces = getRealNetworkInterfaces ();
 
     Enumeration tmp = networkInterfaces.elements ();
+
     if (tmp.hasMoreElements ())
       return tmp;
 
@@ -229,7 +226,7 @@
          e.hasMoreElements (); )
       {
         InetAddress address = (InetAddress) e.nextElement ();
-        result += address.toString () + separator;
+        result += address.toString () + ";" + separator;
       }
 
     return result;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]