<i18n dev> RFR: 8187649: ArrayIndexOutOfBoundsException in java.util.JapaneseImperialCalendar

Naoto Sato naoto at openjdk.java.net
Tue May 25 16:53:07 UTC 2021


Please review the fix. The issue was informed yesterday by @amaembo that it offends some code analysis tools.
Although the fix is to change the condition error, it turned out that `JapaneseImperialCalendar.roll()` did not work for `WEEK_OF_MONTH` and `DAY_OF_MONTH`. There was an inherent issue where `GregorianCalendar` does not follow the `roll()` spec, i.e., "The MONTH must not change when the WEEK_OF_MONTH is rolled." during the Julian/Gregorian transition. JDK-6191841 seems to have tried to fix it but it was closed as `Future Project`...
So I simply fixed the `roll()` issue in `JapaneseImperialCalendar` to follow the spec here, which seems to be the intent of the original author.

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

Commit messages:
 - 8187649: ArrayIndexOutOfBoundsException in java.util.JapaneseImperialCalendar

Changes: https://git.openjdk.java.net/jdk/pull/4191/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4191&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8187649
  Stats: 46 lines in 3 files changed: 36 ins; 0 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4191.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4191/head:pull/4191

PR: https://git.openjdk.java.net/jdk/pull/4191


More information about the i18n-dev mailing list