RFR: 8321206: Make Locale related system properties `StaticProperty`
Naoto Sato
naoto at openjdk.org
Wed Dec 6 18:18:36 UTC 2023
On Wed, 6 Dec 2023 15:18:27 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Currently, Locale-related system properties, such as `user.language` or `user.country`, are initialized when the `Locale` class is loaded. Making them static properties is safer than relying on the `Locale` class loading timing, which could potentially be changed depending on the implementation.
>
> src/java.base/share/classes/java/util/Locale.java line 1061:
>
>> 1059: if (sm != null) {
>> 1060: sm.checkPropertiesAccess();
>> 1061: }
>
> This SM check is no longer needed; the use of privilegedGetProperties made access unconditional.
> The static properties are always accessible to the locale implementation.
Was wondering so. Will remove them.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16986#discussion_r1417796853
More information about the core-libs-dev
mailing list