[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4483) LocaleType parses locales incorrect

Willi Schönborn (JIRA) noreply at atlassian.com
Thu Oct 8 13:45:43 EDT 2009


LocaleType parses locales incorrect
-----------------------------------

                 Key: HHH-4483
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4483
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.2
         Environment: Version 3.3.2, MySQL 5.0
            Reporter: Willi Schönborn
            Priority: Trivial
         Attachments: LocaleType.java

According to Locale#toString() (see http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html#toString%28%29)
LocaleType parses Locales wrong, if they do not contain a language.
E.g.:
I have new Locale("", "GB"), which according to
Sun's Javadoc should produce "_GB", when calling toString().
Hibernate correctly saves this value to the db, but
incorrectly restores new Locale("gb") which results in
a language code instead of a country code.

The StringTokenizer eats the first part, if the String
starts with a _.
Bugfix attached.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list