RFR: 8341566: Adding factory for non-synchronized CharSequence Reader [v3]
Markus KARG
duke at openjdk.org
Tue Oct 8 11:29:00 UTC 2024
On Sun, 6 Oct 2024 18:12:33 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Markus KARG has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fixup! Reader.of(String)
>>
>> Dropping non-public JavaDocs
>
> src/java.base/share/classes/java/io/Reader.java line 144:
>
>> 142:
>> 143: /**
>> 144: * Returns a new {@code Reader} whose source is a {@link CharSequence}.
>
> Probably better to more this more precise, e.g. Returns a {@code Reader} that reads characters from a {@code CharSequence}, starting at the first character in the sequence.
I have replaced the wording by your exact proposal.
> src/java.base/share/classes/java/io/Reader.java line 154:
>
>> 152: * have no effect.
>> 153: *
>> 154: * <p> After the reader has been closed, the {@code read()},
>
> This paragraph is okay but the Reader methods should really specify this (doing so after 25+ years of being unspecified would require being confident wouldn't invalidate any existing Readers).
IIUC then there is nothing to change in this PR?
> src/java.base/share/classes/java/io/Reader.java line 159:
>
>> 157: * {@code transferTo()} methods all throw {@code IOException}.
>> 158: *
>> 159: * <p> The {@code markSupported()} method returns {@code true}.
>
> Chen's suggestion to say that it supports the mark operation would be clearer than the legacy wording.
I have replaced the wording by Chen's exact proposal.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21371#discussion_r1791294423
PR Review Comment: https://git.openjdk.org/jdk/pull/21371#discussion_r1791294032
PR Review Comment: https://git.openjdk.org/jdk/pull/21371#discussion_r1791298262
More information about the core-libs-dev
mailing list