Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235783 DatagramSocket::connect and DatagramSocket::disconnect should allow an implementation to throw UncheckedIOException
  3. JDK-8247324

Release Note: DatagramSocket::disconnect Allows an Implementation to Throw UncheckedIOException

XMLWordPrintable

    • 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.

            pconcannon Patrick Concannon (Inactive)
            pconcannon Patrick Concannon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: