|
[xstream-dev] [jira] Commented: (XSTR-98) Cannot parse java.sql.Date-format: msg#00004java.xstream.devel
The following comment has been added to this issue: Author: James Schopp Created: Wed, 14 Jul 2004 2:30 PM Body: I have verified that the following code correctly solves the issue: In com/thoughtworks/xstream/converters/basic/DateConverter.java, at line 16, use the following format list: private ThreadSafeSimpleDateFormat[] formats = { new ThreadSafeSimpleDateFormat("yyyy-MM-dd HH:mm:ss.S a", 4, 20), new ThreadSafeSimpleDateFormat("yyyy-MM-dd HH:mm:ssa", 2, 20), new ThreadSafeSimpleDateFormat("yyyy-MM-dd", 2, 20) }; --------------------------------------------------------------------- View this comment: http://jira.codehaus.org/browse/XSTR-98?page=comments#action_21771 --------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/XSTR-98 Here is an overview of the issue: --------------------------------------------------------------------- Key: XSTR-98 Summary: Cannot parse java.sql.Date-formatted dates Type: Bug Status: Unassigned Priority: Major Original Estimate: 30 minutes Time Spent: Unknown Remaining: 30 minutes Project: XStream Components: Converters Assignee: Reporter: James Schopp Created: Wed, 14 Jul 2004 2:24 PM Updated: Wed, 14 Jul 2004 2:30 PM Description: The current date converter (com.thoughtworks.xstream.converters.basic.DateConverter) cannot parse the standard java.sql.Date format (yyyy-MM-dd), nor is there a way to "unregister" the existing the formatter and include my own. For example, the following XML cannot be parsed into an object: <Person> <Name>John Doe</Name> <---- String <DateOfBirth>1970-02-13</DateOfBirth> <---- java.util.Date </Person> To solve the formatting issue, the fix is trivial (simply add the new format to the list of formats, on line 19). However, it would be useful to be able to "unregister" the default converters, so that users could add back customized versions of the basic converters, if necessary (such as this date-formatting case). --------------------------------------------------------------------- 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] Created: (XSTR-98) Cannot parse java.sql.Date-formatted dates, jira-yCVjj/EcxBJg9hUCZPvPmw |
|---|---|
| Next by Date: | [xstream-dev] [jira] Updated: (XSTR-55) Ability to alias an entire package, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Previous by Thread: | [xstream-dev] [jira] Created: (XSTR-98) Cannot parse java.sql.Date-formatted dates, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Next by Thread: | [xstream-dev] [jira] Closed: (XSTR-98) Cannot parse java.sql.Date-formatted dates, jira-yCVjj/EcxBJg9hUCZPvPmw |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |