[jira] Created: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org
FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
--------------------------------------------------------------------------------------------------

                 Key: LANG-368
                 URL: https://issues.apache.org/jira/browse/LANG-368
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Sebb


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.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LANG-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-368:
----------------------

    Attachment: FastDateFormatTest.patch

Patch to add failing unit tests of getDateInstance() and getDateTimeInstance()

> FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-368
>                 URL: https://issues.apache.org/jira/browse/LANG-368
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>         Attachments: FastDateFormatTest.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LANG-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-368:
----------------------

    Attachment: FastDateFormat.patch

Fixes problem by using current locale as part of the key

> FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-368
>                 URL: https://issues.apache.org/jira/browse/LANG-368
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>         Attachments: FastDateFormat.patch, FastDateFormatTest.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LANG-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell reopened LANG-368:
--------------------------------


> FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-368
>                 URL: https://issues.apache.org/jira/browse/LANG-368
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.4
>
>         Attachments: FastDateFormat.patch, FastDateFormatTest.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LANG-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-368.
------------------------------

    Resolution: Fixed

Thanks Sebb, applied.

svn ci -m "Applying Sebb's test and fix from LANG-368 - fixing it so that FastDateFormat getDateInstance and getDateTimeInstance continue to work if Locale.getDefault() changes"

src/test/org/apache/commons/lang/time/FastDateFormatTest.java
src/java/org/apache/commons/lang/time/FastDateFormat.java
Sending        src/java/org/apache/commons/lang/time/FastDateFormat.java
Sending        src/test/org/apache/commons/lang/time/FastDateFormatTest.java
Transmitting file data ..
Committed revision 590551.

> FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-368
>                 URL: https://issues.apache.org/jira/browse/LANG-368
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>         Attachments: FastDateFormat.patch, FastDateFormatTest.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LANG-368) FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LANG-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-368.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4

> FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
> --------------------------------------------------------------------------------------------------
>
>                 Key: LANG-368
>                 URL: https://issues.apache.org/jira/browse/LANG-368
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.4
>
>         Attachments: FastDateFormat.patch, FastDateFormatTest.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.