--- old/src/jdk.net/share/classes/jdk/net/RdmaSockets.java 2018-12-04 20:00:05.272032570 +0000 +++ new/src/jdk.net/share/classes/jdk/net/RdmaSockets.java 2018-12-04 20:00:05.027910570 +0000 @@ -36,11 +36,7 @@ import java.nio.channels.SocketChannel; import java.nio.channels.spi.SelectorProvider; import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import java.util.Objects; import jdk.internal.net.rdma.RdmaPollSelectorProvider; import jdk.internal.net.rdma.RdmaSocketProvider; @@ -50,7 +46,7 @@ *

The {@link #openSocket(ProtocolFamily family) openSocket} and {@link * #openServerSocket(ProtocolFamily family) openServerSocket} methods * create RDMA-based TCP sockets. - * + * *

The {@link #openSelector() openSelector}, {@link * #openSocketChannel(ProtocolFamily family) openSocketChannel}, and {@link * #openServerSocketChannel(ProtocolFamily family) openServerSocketChannel} @@ -65,7 +61,7 @@ * {@link java.nio.channels.spi.SelectorProvider#openPipe openPipe} methods * throw {@link java.lang.UnsupportedOperationException * UnsupportedOperationException}. - * + * * @since 12 */ public class RdmaSockets { @@ -98,8 +94,7 @@ * but IPv6 is not enabled on the platform. */ public static Socket openSocket(ProtocolFamily family) throws IOException { - if(family == null) - throw new NullPointerException("protocol family is null"); + Objects.requireNonNull("protocol family is null"); return RdmaSocketProvider.openSocket(family); } @@ -128,8 +123,7 @@ */ public static ServerSocket openServerSocket(ProtocolFamily family) throws IOException { - if(family == null) - throw new NullPointerException("protocol family is null"); + Objects.requireNonNull("protocol family is null"); return RdmaSocketProvider.openServerSocket(family); } @@ -163,8 +157,7 @@ */ public static SocketChannel openSocketChannel(ProtocolFamily family) throws IOException { - if(family == null) - throw new NullPointerException("protocol family is null"); + Objects.requireNonNull("protocol family is null"); SelectorProvider provider = RdmaPollSelectorProvider.provider(); return ((RdmaPollSelectorProvider)provider).openSocketChannel(family); } @@ -194,13 +187,12 @@ */ public static ServerSocketChannel openServerSocketChannel( ProtocolFamily family) throws IOException { - if(family == null) - throw new NullPointerException("protocol family is null"); + Objects.requireNonNull("protocol family is null"); SelectorProvider provider = RdmaPollSelectorProvider.provider(); return ((RdmaPollSelectorProvider)provider) .openServerSocketChannel(family); } - + /** * Opens a selector to multiplex selectable channels to RDMA sockets. *