CSR :
|
JDK-8200089 :
|
The connect method does not specify the exception to be thrown when the datagram channel is already connected. It has historically thrown IllegalStateException. In JDK 11 it throws the more specific AlreadyConnectedException (which seems the best choice to specify). Another issue with connect is that it doesn't specify UnsupportedAddressTypeException and UnresolvedAddressException. We need to get this consistent with SocketChannel.connect. Invoking the send on a datagram channel that is connected is likely a user error. The implementation has historically allowed this method to be used when send to the address that the channel is connected (as this case is benign). It has thrown IllegalArgumentException if the datagram channel is connected to a different target address. Neither case was specified. We should keep existing behavior when sending to the address that the channel is connected too. AlreadyConnectedException may be a better exception for the case that the channel is connected and the user is attempting to send to a different address.