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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 9
    • 8, 9
    • core-libs
    • None
    • 8
    • b112
    • generic
    • generic

      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.

        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

            rriggs Roger Riggs
            yhuang Yong Huang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: