On Sun, 20 Sep 2026 11:35:55 GMT, Markus KARG <[email protected]> wrote:

>> This Pull Request provides an implementation for 
>> [JDK-8389573](https://bugs.openjdk.org/browse/JDK-8389573): 
>> 'InputStreamReader.readAllAsString() should override the generic Reader 
>> default implementation to avoid unnecessary buffer copies'.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Markus KARG has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Protected backwards-compatible behavior of existing subclasses as proposed 
> by Jaikiran Pai
>  - Removed (fast/slow path) comments

test/jdk/java/io/Reader/ReadAll.java line 283:

> 281:         }
> 282: 
> 283:         // InputStreamReader implementation: Internal decoder, empty 
> stream but decoder has bytes

Here and a few other places in this updated test, I think it would be good to 
replace the use of "Internal decoder" with something like "decoder belongs to 
the Charset instance". The "empty stream but decoder has bytes" part here is a 
bit confusing, since the stream isn't empty. For this specific comment maybe 
something like this would be appropriate?

decoder belongs to the Charset instance, read all bytes from the stream using 
read(), then call readAllAsString()

test/jdk/java/io/Reader/ReadAll.java line 317:

> 315:         }
> 316: 
> 317:         // InputStreamReader implementation: External decoder, on empty 
> input stream

Nit - instead of external decoder, maybe "explicitly provided decoder"?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32264#discussion_r4056982707
PR Review Comment: https://git.openjdk.org/jdk/pull/32264#discussion_r4056984455

Reply via email to