> This PR addresses an edge case where the `Locale.LanguageRange(String, > double)` constructor accepts `Double.NaN` as a weight. A `LanguageRange` > weight is specified by > https://datatracker.ietf.org/doc/html/rfc2616#section-3.9 and must be between > 0.0 and 1.0, inclusive. The existing bounds checks do not handle this case. > This change adds an explicit `Double.isNaN(weight)` check. > > The issue does not affect parsed range strings in the same way, since the > input is normalized to lower case before parsing and `"nan"` is not accepted > by `Double.parseDouble`. However, I added a test for that case as well, since > one did not previously exist. > > --------- > - [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: Review - Add spec update to throws clause ------------- Changes: - all: https://git.openjdk.org/jdk/pull/31697/files - new: https://git.openjdk.org/jdk/pull/31697/files/7136743a..62c11e60 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=31697&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=31697&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/31697.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31697/head:pull/31697 PR: https://git.openjdk.org/jdk/pull/31697
