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

Cannot parse JapaneseDate string on some specified locales

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 13
    • core-libs

      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------

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

              Created:
              Updated:
              Resolved: