On Mon, 1 Nov 2021 15:52:51 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> Please review this PR. A comprehensive test job has been scheduled; I'll 
>> notify this thread once that job has completed.
>
> src/java.base/share/classes/sun/util/resources/LocaleData.java line 336:
> 
>> 334:         public List<Locale> getCandidateLocales(String baseName, Locale 
>> locale) {
>> 335:             // Specify only the given locale
>> 336:             return List.of(locale);
> 
> Is it guaranteed that `locale` is not `null` here?

This is a good question. As far I can see, the only call site checks for null 
explicitly: 
https://github.com/openjdk/jdk/blob/a4c46e1e4f4f2f05c8002b2af683a390fc46b424/src/java.base/share/classes/sun/util/resources/Bundles.java#L113

So the answer is yes.

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

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

Reply via email to