From: Michael Koch Date: Mon, 3 May 2004 19:30:32 +0000 (+0000) Subject: re PR libgcj/14695 ([3.3/3.4 only] java.net.NetworkInterface.getByName() throws excep... X-Git-Tag: releases/gcc-3.3.4~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=504f5950b71ec61c1f1524186e2f2e84970ed311;p=thirdparty%2Fgcc.git re PR libgcj/14695 ([3.3/3.4 only] java.net.NetworkInterface.getByName() throws exception instead of returning null) 2004-05-03 Michael Koch Fixes PR libgcj/14695: * java/net/NetworkInterface.java (getByName): Return null when no interface was found. From-SVN: r81447 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 517e4413cf08..040be9dbd4e5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2004-05-03 Michael Koch + + 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. diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java index 32c2cd53db0c..193c24f0b4c2 100644 --- a/libjava/java/net/NetworkInterface.java +++ b/libjava/java/net/NetworkInterface.java @@ -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 NetworkInterface 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; } /**