RFR: 8275007: Java fails to start with null charset if LC_ALL is set to certain locales [v5]

Naoto Sato naoto at openjdk.java.net
Sun Nov 14 14:45:00 UTC 2021


On Sun, 14 Nov 2021 07:23:18 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed indentation
>
> src/java.base/share/classes/java/lang/System.java line 2123:
> 
>> 2121:         var jnuEncoding = props.getProperty("sun.jnu.encoding");
>> 2122:         if (jnuEncoding == null || !Charset.isSupported(jnuEncoding)) {
>> 2123:             notSupportedJnuEncoding = jnuEncoding == null ? "null" : jnuEncoding;
> 
> I think we are nearly there. When setting notSupportedJnuEncoding then we also need to set the sun.jnu.encoding property to "UTF-8", setting it in initPhase3 is too late because the file system may be used using initPhase2.

Initially, I thought that was the case, but I mistook your suggestion as setting only `notSupportedJnuEncoding` in initPhase1. Reverted the fallback location into `initPhase1()`.

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

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


More information about the core-libs-dev mailing list