Summary
The java.nio.channels.DatagramChannel
methods connect()
and send()
throw unspecified exceptions.
Problem
DatagramChannel.send
may throw an unspecified IllegalArgumentException
if the channel is already connected and its address parameter differs from the address to which the channel is connected. This exception should be changed to the more apt java.nio.channels.AlreadyConnectedException
.
After the foregoing change, both DatagramChannel.connect
and DatagramChannel.send
may throw java.nio.channels.AlreadyConnectedException
, java.nio.channels.UnresolvedAddressException
, or java.nio.channels.UnsupportedAddressTypeException
, none of which are specified.
Solution
Update the DatagramChannel.connect
and DatagramChannel.send
documentation to specify that these methods may throw java.nio.channels.AlreadyConnectedException
, java.nio.channels.UnresolvedAddressException
, and java.nio.channels.UnsupportedAddressTypeException
.
Specification
Please refer to the attached specdiff specdiff-dc-exceptions-8198753.zip
.
- csr of
-
JDK-8198753 (dc) DatagramChannel throws unspecified exceptions
-
- Closed
-
- relates to
-
JDK-8200089 Release Note: DatagramChannel.send Throws AlreadyConnectedException Instead of IllegalArgumentException
-
- Closed
-