]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libgcj/14695 ([3.3/3.4 only] java.net.NetworkInterface.getByName() throws excep...
authorMichael Koch <konqueror@gmx.de>
Mon, 3 May 2004 19:30:32 +0000 (19:30 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 3 May 2004 19:30:32 +0000 (12:30 -0700)
2004-05-03  Michael Koch  <konqueror@gmx.de>

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

From-SVN: r81447

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

index 517e4413cf08b2a942268e61954e5dbcfdd1ee9f..040be9dbd4e502904dffcf736e14965b24c3dda6 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-02-14  Release Manager
 
        * GCC 3.3.3 Released.
index 32c2cd53db0c012083a78f5fd6f3ef11e33b9fab..193c24f0b4c277581f97b31cfa77191e6c33a17b 100644 (file)
@@ -115,12 +115,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
@@ -137,7 +140,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;
   }
 
   /**