XMLGregorianCalendarImpl format method generates improperly formatted date
string
---------------------------------------------------------------------------------
Key: XERCESJ-1097
URL: http://issues.apache.org/jira/browse/XERCESJ-1097
Project: Xerces2-J
Type: Bug
Components: JAXP (javax.xml.datatype)
Versions: 2.7.0, 2.7.1
Environment: Linux starscream 2.6.12-1.1447_FC4 #1 Fri Aug 26 20:29:51 EDT
2005 i686 i686 i386 GNU/Linux
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Reporter: George F. Willard III
PROBLEM:
The format method of XMLGregorianCalendarImpl may generate non-RFC3339
compliant strings because the toString method of BigDecimal defaults to using
scientific "E-" notation instead of engineering notation. I encountered this
problem when unit testing JAX-WS pre-releases, and recreated it with a simple
Calendar echo unit test that fails:
INPUT TO echoCalendar WEB SERVICE: 0001-01-01T00:00:00.0000000-05:00
EXPECTED OUTPUT FROM echoCalendar WEB SERVICE:
0001-01-01T00:00:00.0000000-05:00
ACTUAL OUTPUT FROM echoCalendar WEB SERVICE: 0001-01-01T00:00:00E-7-05:00
** Note that the fractionalSeconds were expressed in scientific "E-7"
notation instead of engineering notation causing it to be interpreted as
invalid by web service clients.
SUGGESTED FIX:
FILE: src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java:2960
CURRENT: String frac = getFractionalSecond().toString();
SUGGESTED: String frac = getFractionalSecond().toPlainString();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]