<i18n dev> Integrated: 8350646: Calendar.Builder.build() Throws ArrayIndexOutOfBoundsException

Justin Lu jlu at openjdk.org
Fri Feb 28 19:39:59 UTC 2025


On Tue, 25 Feb 2025 23:58:21 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this PR which prevents an `AIOOBE` from leaking out when `java.util.Calendar.Builder` is used to build a Japanese calendar with an era value too large.
> 
> Note that we don't check under `BEFORE_MEIJI`/0 as historically Japanese calendar ignores negative values during normalization. See `JapaneseImperialCalendar` L2018: `date.setEra(era > 0 ? eras[era] : null);`. 
> 
> We also check against `eras.length` over `REIWA`/5 due to the possibility of additional eras via the property override or future eras in general.

This pull request has now been integrated.

Changeset: 3a7d9868
Author:    Justin Lu <jlu at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3a7d98687849ba0625fed2b516f4103ee8d27e41
Stats:     36 lines in 4 files changed: 30 ins; 0 del; 6 mod

8350646: Calendar.Builder.build() Throws ArrayIndexOutOfBoundsException

Reviewed-by: naoto

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

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


More information about the i18n-dev mailing list