RFR: 8276970: Default charset for PrintWriter that wraps PrintStream [v2]
Naoto Sato
naoto at openjdk.java.net
Tue Nov 16 21:09:13 UTC 2021
On Tue, 16 Nov 2021 20:10:53 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Made PrintStream::charset() public, charset field final, and refined wordings.
>
> src/java.base/share/classes/java/io/PrintStream.java line 116:
>
>> 114: public Charset charset() {
>> 115: return charset;
>> 116: }
>
> This looks good. You could use {@return the charset used ...} to avoid repeating the message. Also might be better to move the method to after the constructors so that it's with the other instance methods.
> The update method descriptions in PS, PW, and OutputStreamWriter look good.
> So overall I think we've got to a good place. Wrapping a PS with PW and not inheriting the charset is an potential accident that goes back 20+ years.
Thanks, Alan. Modified as suggested.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6401
More information about the core-libs-dev
mailing list