RFR: 8273491: java.util.spi.LocaleServiceProvider spec contains statement that is too strict [v2]

Joe Wang joehw at openjdk.java.net
Fri Sep 10 20:56:50 UTC 2021

On Fri, 10 Sep 2021 20:32:03 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java line 120:
>>> 118:  * the locale sensitive services separated by a comma. It is only read and cached at
>>> 119:  * the initialization of this class, so the later call to
>>> 120:  * {@link System#setProperty(String, String)} may not affect the order.
>> I wonder if we can be clearer as "may not" implies uncertainty. While it indeed may or may not work due to the timing of the initialization of this class, my understanding of the above statement is that it implied the runtime startup is recommended as it provides assurance. Would it be better to put that in the statement? sth. like: It is read once and cached at the Java runtime startup or initialization of this class. A call after the initialization of this class will not affect the order.
> It was intentional to use `may not` because as you said, there's still uncertainty. To clarify it more, I added wording that `setProperty` use is discouraged to change the preferred order.

That sounds good to me, suggesting doing it at launch while discouraging the use of setProperty.


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

More information about the core-libs-dev mailing list