--- old/src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketChannelImpl.java 2018-11-28 16:36:32.976693067 +0000 +++ new/src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaSocketChannelImpl.java 2018-11-28 16:36:32.588693080 +0000 @@ -91,8 +91,17 @@ private Socket socket; + private static final UnsupportedOperationException unsupported; + + private static final SelectorProvider checkSupported(SelectorProvider sp) { + if (unsupported != null) + throw new UnsupportedOperationException(unsupported.getMessage(), unsupported); + else + return sp; + } + protected RdmaSocketChannelImpl(SelectorProvider sp) throws IOException { - super(sp); + super(checkSupported(sp)); this.fd = RdmaNet.socket(); this.fdVal = IOUtil.fdVal(fd); } @@ -100,7 +109,7 @@ protected RdmaSocketChannelImpl(SelectorProvider sp, FileDescriptor fd, boolean bound) throws IOException { - super(sp); + super(checkSupported(sp)); this.fd = fd; this.fdVal = IOUtil.fdVal(fd); if (bound) { @@ -113,7 +122,7 @@ RdmaSocketChannelImpl(SelectorProvider sp, FileDescriptor fd, InetSocketAddress isa) throws IOException { - super(sp); + super(checkSupported(sp)); this.fd = fd; this.fdVal = IOUtil.fdVal(fd); synchronized (stateLock) { @@ -946,7 +955,7 @@ // -- Native methods -- - private static native void initIDs(); + private static native void initIDs() throws UnsupportedOperationException; private static native int checkConnect(FileDescriptor fd, boolean block) throws IOException; @@ -956,8 +965,14 @@ static { IOUtil.load(); - System.loadLibrary("extnet"); - initIDs(); + System.loadLibrary("extnet"); + UnsupportedOperationException uoe = null; + try { + initIDs(); + } catch (UnsupportedOperationException e) { + uoe = e; + } + unsupported = uoe; nd = new RdmaSocketDispatcher(); }