On Tue, 26 Oct 2021 12:59:11 GMT, Naoto Sato <[email protected]> wrote:
>> src/java.base/share/classes/java/io/Console.java line 590:
>>
>>> 588: if (cs == null) {
>>> 589: cs = Charset.forName(StaticProperty.nativeEncoding(),
>>> 590: Charset.defaultCharset());
>>
>> I assume that `StaticProperty.nativeEncoding()` will never be `null`?
>> Otherwise an IAE would be thrown here where previously
>> `Charset.defaultCharset()` would be used.
>
> Yes. `StaticProperty.nativeEncoding()` caches the value to `native.encoding`
> system property. The value is not optional, so it should be considered an
> error if `StaticProperty.nativeEncoding()` returned `null`.
> https://download.java.net/java/early_access/jdk18/docs/api/java.base/java/lang/System.html#native.encoding
Thanks for the clarification.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6045