-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 15
-
Component/s: core-libs
-
Verified
Previously, `DatagramChannel::disconnect` threw an `IOException` while `DatagramSocket::disconnect` did not. As a result, the `DatagramChannel::socket` adapter, which calls `DatagramChannel::disconnect`, catches the thrown `IOException` and rethrows it as an `Error`. However, this was undocumented behavior and not user-friendly.
The `DatagramChannel::socket` adapter has been changed to throw an `UncheckedIOException`, and the specification of `DatagramSocket::disconnect` has been updated to document that an implementation may now throw an `UncheckedIOException`. This ensures consistency in behavior between `DatagramSocket`, `DatagramChannel`, and `DatagramChannel::socket` adapter.
The `DatagramChannel::socket` adapter has been changed to throw an `UncheckedIOException`, and the specification of `DatagramSocket::disconnect` has been updated to document that an implementation may now throw an `UncheckedIOException`. This ensures consistency in behavior between `DatagramSocket`, `DatagramChannel`, and `DatagramChannel::socket` adapter.
- relates to
-
JDK-8235783 DatagramSocket::connect and DatagramSocket::disconnect should allow an implementation to throw UncheckedIOException
-
- Resolved
-