Commit 493b3c9c by Michael Koch Committed by Michael Koch

re PR libgcj/14695 ([3.3/3.4 only] java.net.NetworkInterface.getByName() throws…

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
parent 6adcf89d
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> 2004-04-30 Ranjit Mathew <rmathew@hotmail.com>
Tom Tromey <tromey@redhat.com> Tom Tromey <tromey@redhat.com>
......
...@@ -130,12 +130,15 @@ public final class NetworkInterface ...@@ -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 SocketException If an error occurs
* @exception NullPointerException If the specified name is null * @exception NullPointerException If the specified name is null
*/ */
public static NetworkInterface getByName(String name) public static NetworkInterface getByName(String name)
throws SocketException throws SocketException
...@@ -150,7 +153,8 @@ public final class NetworkInterface ...@@ -150,7 +153,8 @@ public final class NetworkInterface
return tmp; return tmp;
} }
throw new SocketException("no network interface with this name exists"); // No interface with the given name found.
return null;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment