Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1323

XSDateTime.getXMLGregorianCalendar() loses precision for fractional digits and inserts timezones where there are none.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.9.1
    • 2.10.0
    • XML Schema API
    • None

    Description

      XSDateTime.getXMLGregorianCalendar() loses precision for fractional digits and inserts timezones where there are none. We need to be careful when converting a double to a BigDecimal. The naive approach "new BigDecimal(doubleValue - ((int) doubleValue))" doesn't work. Also need to check that the XSDateTime has a timezone. If it doesn't we should specify DatatypeConstants.FIELD_UNDEFINED as the value not zero.

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            mrglavas@ca.ibm.com Michael Glavassevich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: