RFR: 8287541: Files.writeString fails to throw IOException for charset "windows-1252" [v2]

Naoto Sato naoto at openjdk.java.net
Mon Jun 6 15:50:42 UTC 2022


On Sat, 4 Jun 2022 11:27:00 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Changed per suggestion
>
> src/java.base/share/classes/java/lang/String.java line 849:
> 
>> 847:         int en = scale(len, ce.maxBytesPerChar());
>> 848:         // fastpath with ArrayEncoder implies `doReplace`.
>> 849:         if (ce instanceof ArrayEncoder ae && doReplace) {
> 
> Wouldn't it be more readable (and perphaps faster) if we do check boolean flag first?

Fixed.

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

PR: https://git.openjdk.java.net/jdk/pull/9019


More information about the core-libs-dev mailing list