Java 22.ea.25-open: DateTimeFormatter should format IsoEra.BCE as BC in Locale.ROOT

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 22
    • Component/s: core-libs
    • None

      Here's the test code:

      ```java
      DateTimeFormatter shortFormat =
          new DateTimeFormatterBuilder()
              .appendPattern("GG")
              .toFormatter(Locale.ROOT);
      DateTimeFormatter longFormat =
          new DateTimeFormatterBuilder()
              .appendPattern("GGGG")
              .toFormatter(Locale.ROOT);
      System.out.println("short era: " + shortFormat.format(IsoEra.BCE));
      System.out.println(" long era: " + longFormat.format(IsoEra.BCE));
      ```

      Java 21 (the result is the same for all Java versions below 21):
      short era: BC
       long era: BCE

      Java 22.ea.25-open:
      short era: BCE
       long era: BCE

      The issue was discovered as I added Java 22 to the CI matrix in pgjdbc: https://github.com/pgjdbc/pgjdbc/pull/3026

            Assignee:
            Unassigned
            Reporter:
            Vladimir Sitnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: