--- old/src/jdk.net/linux/classes/jdk/net/LinuxRdmaSocketOptions.java 2018-11-28 16:36:35.072692994 +0000 +++ new/src/jdk.net/linux/classes/jdk/net/LinuxRdmaSocketOptions.java 2018-11-28 16:36:34.696693007 +0000 @@ -30,7 +30,20 @@ class LinuxRdmaSocketOptions extends PlatformRdmaSocketOptions { - public LinuxRdmaSocketOptions() { } + private static final UnsupportedOperationException unsupported; + + private static final Void checkSupported() { + if (unsupported != null) + throw new UnsupportedOperationException(unsupported.getMessage(), unsupported); + else + return null; + } + + public LinuxRdmaSocketOptions() { + this(checkSupported()); + } + + private LinuxRdmaSocketOptions(Void unused) { } @Override native void setSockOpt(int fd, int opt, int value) throws SocketException; @@ -48,7 +61,14 @@ return null; } }); - init(); + UnsupportedOperationException uoe = null; + try { + init(); + } catch (UnsupportedOperationException e) { + uoe = e; + } + unsupported = uoe; } - private static native void init(); + + private static native void init() throws UnsupportedOperationException; }