summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-05-05 06:56:39 +0000
committerMichael Koch <konqueror@gmx.de>2004-05-05 06:56:39 +0000
commit442730f221b0ff97556feadf6709ade89a732811 (patch)
tree31f80158e935ed73b97ab7ee2edb090bae31feed
parentef6f63f477844ad5ed6f496cd9e4f679908bd662 (diff)
downloadclasspath-442730f221b0ff97556feadf6709ade89a732811.tar.gz
2004-05-05 Michael Koch <konqueror@gmx.de>
* java/net/NetworkInterface.java (getByName): Return null when no interface was found.
-rw-r--r--ChangeLog5
-rw-r--r--java/net/NetworkInterface.java14
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 11ef4cfd9..3234a7365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-05 Michael Koch <konqueror@gmx.de>
+
+ * java/net/NetworkInterface.java
+ (getByName): Return null when no interface was found.
+
2004-05-02 Mark Wielaard <mark@klomp.org>
* configure.ac: Set version to 0.09+cvs.
diff --git a/java/net/NetworkInterface.java b/java/net/NetworkInterface.java
index e7f7290fe..ab6d7b426 100644
--- a/java/net/NetworkInterface.java
+++ b/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;
}
/**