On Wed, 8 Apr 2026 10:10:28 GMT, Daniel Fuchs <[email protected]> wrote:

>> test/jdk/java/net/Socket/ConnectionReset.java line 95:
>> 
>>> 93:                     System.err.println("read => 1 byte");
>>> 94:                     // we should get an IOException before reading
>>> 95:                     // the last byte
>> 
>> This comment is confusing too, it should not read bytes after IOException is 
>> thrown.
>
> Yes - but it is OK to read one byte as long as it is not the last one, 
> otherwise we would not assert that remaining > 0 and continue reading. 
> Obviously if we reach here the exception has not been thrown by in.read() 
> yet. Let me see if I can improve that comment...

What about changing it to:


                    // If an exception has already been thrown remaining will 
be 0, and we should not
                    // come here. We should get an IOException before reading 
the last byte, so 
                    // assert that remaining > 0

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30564#discussion_r3050658405

Reply via email to