> 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 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/30632/files - new: https://git.openjdk.org/jdk/pull/30632/files/a97621b7..d56c4f0a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=30632&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30632&range=00-01 Stats: 72 lines in 3 files changed: 5 ins; 48 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/30632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/30632/head:pull/30632 PR: https://git.openjdk.org/jdk/pull/30632
