-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
-
Java API
-
JDK
Summary
Prevent ArrayIndexOutOfBoundsException
from leaking out when expecting
IllegalArgumentException
for a Japanese calendar with an era too large.
Problem
Building a Japanese calendar via Calendar.Builder
with an era too large throws an ArrayIndexOutOfBoundsException
, but it is specified to throw an IllegalArgumentException
.
Solution
Ensure when a Japanese calendar re-computes its time, if an era is too great it will throw an IllegalArgumentException
instead of an ArrayIndexOutOfBoundsException
. This addresses Calendar.build()
for Japanese calendars (which is the bug submitted case), but also affects any Japanese Calendar operations that call Calendar.computeTime()
. This behavior is desirable.
Note that we do not check an era value too small, as historically Japanese calendars ignore such values.
Specification
n/a
- csr of
-
JDK-8350646 Calendar.Builder.build() Throws ArrayIndexOutOfBoundsException
-
- Resolved
-