On Wed, 20 Nov 2024 13:41:40 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> Imagine `bind()` succeeding, yet `connect()` failing due to an `IAE` thrown >> by `SocketImpl#connect()`. This would leave the socket in `BOUND` state. >> Hence, shouldn't we include the `connect()` in the try-catch block too? > > I don't mind if we have a broader try-finally but it would be a bug if > connect were to throw IAE. All the validation should be done before > delegating to the SocketImpl. Extended the try-finally to cover both `bind()` and `connect()` exceptions in ce568022f9a0fc9c0e9727911e3856048e1a054c. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22160#discussion_r1850439389