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

LocalTime.format() throws exception when FormatStyle is LONG or FULL

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b112
    • CPU:
      generic
    • OS:
      generic

      Description

      Java: JDK8, JDK8 update or JDK 9
      OS: windows 7, mac os x 10.9, OEL5

      Compile and run attached program, JavaTimeTest.java.

      In most cases, when FormatStyle of DateTimeFormatter is LONG or FULL, exception is thrown. Attached are the screen shots.

      On windows 7 zh_CN, if java.locale.providers is JRE, there will be output even FormatStyle is LONG or FULL, and no exception is thrown. But when I try in windows 7 en and ja, there is still the exception.

      Attached are the screen shots.

      ---------------------------------------------------------------------------------------------------------------------
      2015-05-04
      When java.locale.providers is JRE, the default provider, in some locales, the format method works fine. For example, in locales zh_CN, zh_TW, ko_KR, th_TH, there is no exception thrown.

      In most of the locales, there will be exception.

      When java.locale.providers is CLDR or HOST, then in all the locales, there will be exception.

      This happens in classes with 'time" like LocalDatetime, ZonedDateTime, etc. in java.time package.

        Attachments

        1. JavaTimeTest.java
          0.4 kB
        2. linux.png
          linux.png
          41 kB
        3. mac.png
          mac.png
          33 kB
        4. win7_zh_CN-CLDR-LONG.png
          win7_zh_CN-CLDR-LONG.png
          47 kB
        5. win7_zh_CN-HOST-LONG.png
          win7_zh_CN-HOST-LONG.png
          58 kB
        6. windows7-en-LONG.png
          windows7-en-LONG.png
          24 kB

          Issue Links

            Activity

              People

              • Assignee:
                rriggs Roger Riggs
                Reporter:
                yhuang Yong Huang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: