<i18n dev> RFR: 8276234: Trivially clean up locale-related code
Pavel Rappo
prappo at openjdk.java.net
Mon Nov 1 16:20:10 UTC 2021
On Mon, 1 Nov 2021 15:52:51 GMT, Daniel Fuchs <dfuchs at 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
More information about the i18n-dev
mailing list