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

Bad array returned from DateFormatSymbols.getZoneStrings()

    XMLWordPrintable

Details

    • 1.1.6
    • x86
    • windows_nt
    • Verified

    Backports

      Description



        Name: diC59631 Date: 11/20/97


        There's an inadvertent API change in the most
        recent set of changes from Taligent. Most of the
        DateFormatZoneData files were recently changed to
        contain placeholder data since we don't have
        localized time zone names for any countries.
        So each non-English DateFormatZoneData object's
        zoneStrings array has one entry. Its internal
        zone ID is "Africa/Casablanca" and all of its
        localized-name fields are "GMT". Its representative-
        city field is MISSING!

        Therefore, code expecting DateFormatSymbols.getZoneStrings()
        to return an array whose entries each have six
        elements will blow up with an ArrayIndexOutOfBoundsException
        trying to access the representative-city field.

        To reproduce:

        DateFormatSymbols symbols = DateFormatSymbols.getInstance(Locale.FRANCE);
        String[][] zoneData = symbols.getZoneStrings();
        System.out.println(zoneData[0][5]); // BOOM!

        In practice, getZoneStrings() isn't documented
        well enough for much of anyone to figure out what
        it's supposed to return, so this may not impact
        anyone-- it's probably also a bug that the
        documentation for this routine isn't thorough
        enough.
        (Review ID: 20199)
        ======================================================================

        Attachments

          Issue Links

            Activity

              People

                joconnersunw John Oconner (Inactive)
                dindrigo Daniel Indrigo (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: