On Thu, 30 Apr 2026 11:25:29 GMT, Jaikiran Pai <[email protected]> wrote:

> Can I please get a review of this doc-only change which updates the 
> specification of `Socket.isInputShutdown()` and `Socket.isOutputShutdown()` 
> to clarify how it behaves when the `Socket` has been closed?
> 
> This addresses https://bugs.openjdk.org/browse/JDK-8310138. The commit in 
> this PR merely specifies the current implementation. I'll create a CSR 
> shortly.
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/java/net/Socket.java line 1757:

> 1755:      * for a closed socket if {@linkplain  #shutdownInput() 
> shutdownInput()}
> 1756:      * completed successfully prior to the socket being closed.
> 1757:      *

For me it would be more surprising if this method returned `false` after 
`close()` if `shutdownInput()` hadn't be called before `close()`. Is that what 
is implied here? 
I would naively expect `isInputShutdown()` to return `true` after `close()` 
always, regardless of whether `shutdownInput()`  had been called before 
`close()`, or not.

So I find this new text confusing.

Same for `isOutputShutdown()` below.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31000#discussion_r3168263753

Reply via email to