On Fri, 10 Sep 2021 20:32:03 GMT, Naoto Sato <na...@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. Hi Naoto, A couple of questions: - Are there any scenarios where invoking setProperty will not override the command line setting ? - Did you consider an `@ImplNote` for your clarification given the behavior "might" be different in other implementations (I am not sure myself) and is implementation defined? Best Lance ------------- PR: https://git.openjdk.java.net/jdk/pull/5457