8224477: java.net socket types new-style socket option methods - spec and impl mismatch

Reviewed-by: alanb
This commit is contained in:
Chris Hegarty 2019-05-29 13:58:05 +01:00
parent cf48689855
commit bc24d17e80
18 changed files with 1289 additions and 300 deletions

View file

@ -1025,6 +1025,9 @@ class ServerSocket implements java.io.Closeable {
public <T> ServerSocket setOption(SocketOption<T> name, T value)
throws IOException
{
Objects.requireNonNull(name);
if (isClosed())
throw new SocketException("Socket is closed");
getImpl().setOption(name, value);
return this;
}
@ -1053,6 +1056,9 @@ class ServerSocket implements java.io.Closeable {
* @since 9
*/
public <T> T getOption(SocketOption<T> name) throws IOException {
Objects.requireNonNull(name);
if (isClosed())
throw new SocketException("Socket is closed");
return getImpl().getOption(name);
}