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

Typo in BRT - America/Sao_Paulo ZoneId key.

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • tbd
    • core-libs
    • None
    • behavioral
    • minimal
    • Introduce a new mapping to ZoneId.SHORT_IDS
    • Java API

      Summary

      Add a new mapping: "BRT > America/Sao_Paulo" to java.time.ZoneId.SHORT_IDS.

      Problem

      In ZoneId.SHORT_IDS, the ZoneId key in "BET - America/Sao_Paulo" is misspelled. The mapping should be "BRT > America/Sao_Paulo". However, simply replacing "BET" with "BRT", would introduce risk to older applications, that still depend on "BET - America/Sao_Paulo".

      Solution

      Add the mapping: BRT > America/Sao_Paulo to zoneId.SHORT_IDS. Additionally, the javadoc should be adjusted to replace "BET" with "BRT".

      Specification

      --- a/src/java.base/share/classes/java/time/ZoneId.java
      +++ b/src/java.base/share/classes/java/time/ZoneId.java
      @@ -200,7 +200,7 @@ public abstract sealed class ZoneId implements Serializable permits ZoneOffset,
            * <li>AGT - America/Argentina/Buenos_Aires</li>
            * <li>ART - Africa/Cairo</li>
            * <li>AST - America/Anchorage</li>
      -     * <li>BET - America/Sao_Paulo</li>
      +     * <li>BRT - America/Sao_Paulo</li>
            * <li>BST - Asia/Dhaka</li>
            * <li>CAT - Africa/Harare</li>
            * <li>CNT - America/St_Johns</li>
      @@ -230,6 +230,7 @@ public abstract sealed class ZoneId implements Serializable permits ZoneOffset,
               entry("ART", "Africa/Cairo"),
               entry("AST", "America/Anchorage"),
               entry("BET", "America/Sao_Paulo"),
      +        entry("BRT", "America/Sao_Paulo"),
               entry("BST", "Asia/Dhaka"),
               entry("CAT", "Africa/Harare"),
               entry("CNT", "America/St_Johns"),

            jlu Justin Lu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: