diff options
author | Michael Koch <konqueror@gmx.de> | 2004-05-03 14:40:59 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-05-03 14:40:59 +0000 |
commit | 493b3c9c47bcb52cc518a865a9d79fddd563337d (patch) | |
tree | 984677eb48309d5e82ca7e882ec673e0203003e3 /libjava/java | |
parent | 6adcf89d9a75ac30a64eb76a0d1bd1d55a869e09 (diff) | |
download | gcc-493b3c9c47bcb52cc518a865a9d79fddd563337d.zip gcc-493b3c9c47bcb52cc518a865a9d79fddd563337d.tar.gz gcc-493b3c9c47bcb52cc518a865a9d79fddd563337d.tar.bz2 |
re PR libgcj/14695 ([3.3/3.4 only] java.net.NetworkInterface.getByName() throws exception instead of returning null)
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: r81434
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/net/NetworkInterface.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java index e7f7290..ab6d7b4 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; } /** |