diff options
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/net/NetworkInterface.java | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e2968ca346f..68af3d44ada 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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> diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java index e7f7290febc..ab6d7b4263f 100644 --- a/libjava/java/net/NetworkInterface.java +++ b/libjava/java/net/NetworkInterface.java @@ -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; } /** |