RFR: 8354724: Methods in java.io.Reader to read all characters and all lines [v22]
Jaikiran Pai
jpai at openjdk.org
Mon May 19 07:02:58 UTC 2025
On Fri, 16 May 2025 18:37:38 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> src/java.base/share/classes/java/io/Reader.java line 478:
>>
>>> 476: *
>>> 477: * <p> If an I/O error occurs reading from the stream, then it
>>> 478: * may do so after some, but not all, characters have been read.
>>
>> Hello Brian, I read this sentence a couple of times but it wasn't clear to me what this meant. I am guessing that we want to state that if an I/O error occurs when some (but not all?) characters have been read then the stream may be in an inconsistent state? Should we reword this paragraph?
>>
>> I suspect that sentence was motivated from similar existing text in `Files.readString(...)` and there too I find it confusing.
>
>> I read this sentence a couple of times [...]
>
> Please see [a86610d](https://github.com/openjdk/jdk/pull/24728/commits/a86610d06169445a5c4b81a0c60527130a45e045).
>
>> I suspect that sentence was motivated from similar existing text in `Files.readString(...)` and there too I find it confusing.
>
> If you think it worthwhile, please file an issue to improve that verbiage as well.
Thank you Brian, the updated text for this section looks good to me. Once this PR gets integrated, I'll go through the Files.readXXX methods and file an issue to have that text simplified too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2094977207
More information about the core-libs-dev
mailing list