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]

Patch: java.net.NetworkInterface


Hi list,


I just commited the attached patch to fix PR 14695.


Andrew: can you commit this to 3.4 branch (and probably 3.3 too).


Michael


2004-05-03  Michael Koch  <konqueror@gmx.de>

	Fixes PR libgcj/14695:
	* java/net/NetworkInterface.java
	(getByName): Return null when no interface was found.




Index: java/net/NetworkInterface.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/NetworkInterface.java,v
retrieving revision 1.9
diff -u -r1.9 NetworkInterface.java
--- java/net/NetworkInterface.java	20 Apr 2004 13:05:09 -0000	1.9
+++ java/net/NetworkInterface.java	3 May 2004 14:31:14 -0000
@@ -130,12 +130,15 @@
   }
 
   /**
-   *  Returns an network interface by name
+   * Returns an network interface by name
    *
-   *  @param name The name of the interface to return
+   * @param name The name of the interface to return
+   * 
+   * @return a <code>NetworkInterface</code> object representing the interface,
+   * or null if there is no interface with that name.
    *
-   *  @exception SocketException If an error occurs
-   *  @exception NullPointerException If the specified name is null
+   * @exception SocketException If an error occurs
+   * @exception NullPointerException If the specified name is null
    */
   public static NetworkInterface getByName(String name)
     throws SocketException
@@ -150,7 +153,8 @@
 	  return tmp;
       }
 
-    throw new SocketException("no network interface with this name exists");
+    // No interface with the given name found.
+    return null;
   }
 
   /**

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