<i18n dev> Integrated: 8349883: Locale.LanguageRange.parse("-") throws ArrayIndexOutOfBoundsException

Justin Lu jlu at openjdk.org
Thu Feb 13 22:28:13 UTC 2025


On Wed, 12 Feb 2025 19:34:19 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this PR which prevents a (non-specified) `AIOOBE` from leaking out of the range accepting endpoints in `Locale.LanguageRange`.
> 
> In the reported error case, the invalid range is a lone "-" which is `split` into an empty array. Checking if the range ends with "-" first, avoids indexing the empty array.

This pull request has now been integrated.

Changeset: 3741c980
Author:    Justin Lu <jlu at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3741c980b865b7122d07655353657d683923c40d
Stats:     138 lines in 3 files changed: 61 ins; 67 del; 10 mod

8349883: Locale.LanguageRange.parse("-") throws ArrayIndexOutOfBoundsException

Reviewed-by: naoto

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

PR: https://git.openjdk.org/jdk/pull/23596


More information about the i18n-dev mailing list