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

Cannot parse JapaneseDate string on some specified locales

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:

      Description

      Compile and run the test case with default locale data providers or CLDR,COMPAT provider
      Result: will get exception on below locales
      el, el_CY, el_GR, fa, fa_AF, fa_IR, uk, uk_UA

      --------BEGIN SOURCE---------
      public static void findMissingJTS() {
      LocalDate date = LocalDate.of(2019, 5, 1);
      DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd GGGG");
      formatter = formatter.withChronology(JapaneseChronology.INSTANCE);

      int num = 0;
      for (Locale locale : Calendar.getAvailableLocales()) {
      formatter = formatter.withLocale(locale);
      try {
      LocalDate.parse(date.format(formatter), formatter);
      } catch (DateTimeParseException e) {
      num++;
      System.out.println("Missing JTS data for locale: " + locale);
      }
      }
      if (num > 0) {
      throw new RuntimeException("Missing some JTS data update");
      }
      }

      ----END SOURCE------

        Attachments

          Activity

            People

            Assignee:
            naoto Naoto Sato
            Reporter:
            yzhou Daisy Zhou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: