Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-368

FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • None
    • None

    Description

      The FastDateFormat getDateInstance() and getDateTimeInstance() methods create the HashMap key from various items including the locale.

      If the locale is null, then it is not made part of the key, but the stored object is created using the current default locale.

      If the Locale is changed subsequently, then the wrong locale is applied.

      Patch for test case to follow.

      Attachments

        1. FastDateFormat.patch
          2 kB
          Sebb
        2. FastDateFormatTest.patch
          3 kB
          Sebb

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: