On Tue, 5 May 2026 17:08:19 GMT, Daniel Fuchs <[email protected]> wrote:
>> We came up with wording for SocketChannel.shutdownInput and maybe the first
>> sentence from that method could be copied over to Socket.shutdownInput
>> (replacing "channel" with "socket" of course). We can also expand the
>> `@throws` description to specify that it throws if the Socket is shutdown
>> for reading.
>>
>> If we improved shutdownInput then it would allow the description of
>> isShutdownInput to be re-specified to say that it returns true if the Socket
>> was shutdown for reading with the shutdownInput method.
>>
>> Invoking isInputXXX methods on a closed Socket is a bit of a corner case and
>> we should be able to specify it in a single sentence, like we do already
>> with the isConnected method, e.g. "this method will return true for a closed
>> socket if it was shutdown for reading prior to being closed".
>
> The important word in the new description is **only**.
>
> I would be happy with:
>
>
> This method returns {@code true} only if a prior call to {@link
> #shutdownInput()} completed successfully.
>
>
> Because as a naive user I would expect it to return true after `close()` has
> been called.
I've updated the PR to adjust the text of these methods. Please take a look if
this looks reasonable.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31000#discussion_r3195852886