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. (Which ensures 
`SupplementalJapaneseEraTestRun.java` passes, which also tests against building 
(and succeeding) with an era value of 6.

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

Commit messages:
 - init

Changes: https://git.openjdk.org/jdk/pull/23789/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23789&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350646
  Stats: 16 lines in 2 files changed: 13 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/23789.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23789/head:pull/23789

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

Reply via email to