On Fri, 24 Apr 2026 21:19:05 GMT, Justin Lu <[email protected]> wrote:

>> This PR standardizes the null related behavior for the `Locale` filtering 
>> and lookup APIs.
>> 
>> There are two issues. First, null elements within either `Collection` which 
>> are passed to these APIs may cause NPE, but this is not specified. Second, 
>> if the `tags` or `locales` list is null and `priorityList` empty, NPE is not 
>> thrown (even though it is specified to).
>> 
>> For example, this is the current null related behavior for 
>> `Locale:lookup(List<LanguageRange>, Collection<Locale>)`,
>> 
>>> [], null -> NPE not thrown
>>> [en], null
>>> null, []
>>> null, [en]
>>> [null], [en]
>>> [null], [] -> NPE not thrown
>>> [], [null] -> NPE not thrown
>>> [en], [null]
>> 
>> 
>> This update fixes the empty case to correctly throw NPE. Additionally, there 
>> is a specification update to make the `null` element NPE apparent (and 
>> implementation dependent).
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Justin Lu has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Weaken spec to allow impl based decision for null elements

LGTM

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

Marked as reviewed by naoto (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/30632#pullrequestreview-4184150841

Reply via email to