Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8068278

ArrayIndexOutOfBoundsException instead of DateTimeException in j.t.chrono.JapaneseChronology.eraOf()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b50

      Backports

        Description

        The spec for the java.time.chrono.JapaneseChronology.eraOf() asserts that DateTimeException is expected if eraValue is invalid.

        https://docs.oracle.com/javase/8/docs/api/java/time/chrono/JapaneseChronology.html#eraOf-int-

        but in the case of input value Integer.MAX_VALUE: JapaneseChronology.INSTANCE.eraOf(Integer.MAX_VALUE);

        the method throws unexpected java.lang.ArrayIndexOutOfBoundsException:

        java.lang.ArrayIndexOutOfBoundsException: -2147483648
        at java.time.chrono.JapaneseEra.of(JapaneseEra.java:201)
        at java.time.chrono.JapaneseChronology.eraOf(JapaneseChronology.java:377)
        at java.time.chrono.JapaneseChronology.eraOf(JapaneseChronology.java:123)

        Due to this issue the following test will fail after integration:

        api/java_time/chrono/JapaneseChronology/index.html#eraOf

          Activity

          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/28f3d0e8b4bd
          User: rriggs
          Date: 2015-02-03 20:03:49 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/28f3d0e8b4bd User: rriggs Date: 2015-02-03 20:03:49 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/28f3d0e8b4bd
          User: lana
          Date: 2015-02-11 23:06:32 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/28f3d0e8b4bd User: lana Date: 2015-02-11 23:06:32 +0000

            People

            • Assignee:
              rriggs Roger Riggs
              Reporter:
              ostrizhe Olga Strizhenko (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: