2004-05-03 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 May 2004 14:40:59 +0000 (14:40 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 May 2004 14:40:59 +0000 (14:40 +0000)
Fixes PR libgcj/14695:
* java/net/NetworkInterface.java
(getByName): Return null when no interface was found.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81434 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/net/NetworkInterface.java

index e2968ca..68af3d4 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-03  Michael Koch  <konqueror@gmx.de>
+
+       Fixes PR libgcj/14695:
+       * java/net/NetworkInterface.java
+       (getByName): Return null when no interface was found.
+
 2004-04-30  Ranjit Mathew  <rmathew@hotmail.com>
             Tom Tromey  <tromey@redhat.com>
 
index e7f7290..ab6d7b4 100644 (file)
@@ -130,12 +130,15 @@ public final class NetworkInterface
   }
 
   /**
-   *  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 @@ public final class NetworkInterface
          return tmp;
       }
 
-    throw new SocketException("no network interface with this name exists");
+    // No interface with the given name found.
+    return null;
   }
 
   /**