|
[xstream-dev] [jira] Closed: (XSTR-91) BasicTypesTest fails under japanese : msg#00025java.xstream.devel
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/XSTR-91 Here is an overview of the issue: --------------------------------------------------------------------- Key: XSTR-91 Summary: BasicTypesTest fails under japanese locale Type: Bug Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: XStream Components: Converters Fix Fors: 1.0.2 Assignee: Reporter: Kouhei Mori Created: Wed, 23 Jun 2004 6:41 PM Updated: Sun, 25 Jul 2004 8:28 AM Description: Under japanese locale, com.thoughtworks.acceptance.BasicTypesTest fails as follows: [junit] Testcase: testDate(com.thoughtworks.acceptance.BasicTypesTest): FAILED [junit] expected:<...AM...> but was:<...¸áÁ°...> [junit] junit.framework.ComparisonFailure: expected:<...AM...> but was:<...¸áÁ°...> [junit] at com.thoughtworks.acceptance.AbstractAcceptanceTest.assertBothWays(Unknown Source) [junit] at com.thoughtworks.acceptance.BasicTypesTest.testDate(Unknown Source) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) "¸áÁ°" is a japanese word meaning "AM". This is because, SimpleDateFormat did not always format 'a' pattern letter to AM/PM. Explicitly specifying english locale is a solution to this problem? Index: src/java/com/thoughtworks/xstream/converters/basic/ThreadSafeSimpleDateFormat.java =================================================================== RCS file: /scm/xstream/xstream/src/java/com/thoughtworks/xstream/converters/basic/ThreadSafeSimpleDateFormat.java,v retrieving revision 1.5 diff -u -r1.5 ThreadSafeSimpleDateFormat.java --- src/java/com/thoughtworks/xstream/converters/basic/ThreadSafeSimpleDateFormat.java 11 May 2004 17:21:42 -0000 1.5 +++ src/java/com/thoughtworks/xstream/converters/basic/ThreadSafeSimpleDateFormat.java 23 Jun 2004 22:38:10 -0000 @@ -4,6 +4,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; /** * Wrapper around java.text.SimpleDateFormat that can @@ -84,7 +85,7 @@ } private DateFormat createNew() { - return new SimpleDateFormat(formatString); + return new SimpleDateFormat(formatString, Locale.ENGLISH); } } --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [xstream-dev] [jira] Closed: (XSTR-98) Cannot parse java.sql.Date-formatted dates, jira-yCVjj/EcxBJg9hUCZPvPmw |
|---|---|
| Next by Date: | [xstream-dev] [jira] Closed: (XSTR-71) xstream.fromXML() requires XPP3 where xstream.toXML doesn't, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Previous by Thread: | [xstream-dev] [jira] Updated: (XSTR-92) No treatment of specialized serialization, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Next by Thread: | [xstream-dev] [jira] Closed: (XSTR-71) xstream.fromXML() requires XPP3 where xstream.toXML doesn't, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |