RFR: 8341566: Adding factory for non-synchronized CharSequence Reader [v3]
Chen Liang
liach at openjdk.org
Mon Oct 7 04:47:36 UTC 2024
On Mon, 7 Oct 2024 00:04:40 GMT, ExE Boss <duke 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 172:
>
>> 170: Objects.requireNonNull(source);
>> 171:
>> 172: return new Reader() {
>
> Maybe make this into a package‑private `CharSequenceReader` so that [`StringReader::close()`] doesn’t have to use a try‑catch.
>
> [`StringReader::close()`]: https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/io/StringReader.html#close()
I don't think that try-catch is too much of a bloat compared to the extra license header and imports from the explicit `CharSequenceReader.java` file.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21371#discussion_r1789479742
More information about the core-libs-dev
mailing list