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

src/java.base/share/classes/sun/nio/cs/StreamDecoder.java line 127:

> 125:         synchronized (lock) {
> 126:             readCalled = true;
> 127: 

There's a pre-existing package-private `implRead(...)` method in this 
`StreamDecoder` class. I don't see it being used anywhere else other than this 
same class (and that's a good thing).

While we are doing this change, can you make that method `private`? I wouldn't 
have asked for it, but now that we are tracking whether read was called on the 
`StreamDecoder` (through this `readCalled` variable), it would be good to 
prevent any future calls to `implRead(...)` from outside the current code path 
which do this `readCalled` tracking. Making it `private` would prevent such 
issues.

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

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

Reply via email to