On Wed, 8 Apr 2026 10:14:53 GMT, Daniel Fuchs <[email protected]> wrote:
>> 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 IOException was already thrown by in.read(), > remaining will be 0, > // and we should not come here as in.read() should throw > again. We should > // get an IOException before reading the last byte, so > assert that > // remaining > 0 > 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... Maybe just leave it out, it's not needed as part of this migration. My worry is that a complex comment is just going to confuse readers. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30564#discussion_r3050724593
