JDK-8247324 : Release Note: DatagramSocket::disconnect Allows an Implementation to Throw UncheckedIOException
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2020-06-10
  • Updated: 2021-05-14
  • Resolved: 2020-06-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15Resolved
Related Reports
Relates :  
Description
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.