--- old/src/java.base/unix/classes/java/net/PlainSocketImpl.java 2019-04-18 10:58:25.000000000 +0100 +++ new/src/java.base/unix/classes/java/net/PlainSocketImpl.java 2019-04-18 10:58:25.000000000 +0100 @@ -45,13 +45,8 @@ /** * Constructs an empty instance. */ - PlainSocketImpl() { } - - /** - * Constructs an instance with the given file descriptor. - */ - PlainSocketImpl(FileDescriptor fd) { - this.fd = fd; + PlainSocketImpl(boolean server) { + super(server); } static final ExtendedSocketOptions extendedOptions = @@ -90,7 +85,7 @@ protected Set> supportedOptions() { HashSet> options = new HashSet<>(super.supportedOptions()); - if (getServerSocket() != null) { + if (server) { options.addAll(ExtendedSocketOptions.serverSocketOptions()); } else { options.addAll(ExtendedSocketOptions.clientSocketOptions()); @@ -106,12 +101,12 @@ try { socketSetOption0(opt, b, val); } catch (SocketException se) { - if (socket == null || !socket.isConnected()) + if (server || !connected) throw se; } } - native void socketCreate(boolean isServer) throws IOException; + native void socketCreate(boolean stream, boolean isServer) throws IOException; native void socketConnect(InetAddress address, int port, int timeout) throws IOException;