castor
  1. castor
  2. CASTOR-1922

Usage of BigDecial.toString() in Marshaller inconsistent when switching from Java 1.4 (and below) to Java 5.0 (and above)

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1.1
    • Component/s: XML
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Apparently, Sun decided to change the semantics of BigDecimal.toString() with the release of Java 5.0, allowing scientific notation to be 'produced' when calculating the String representation of a BigDecimal instance. With Java 5.0, BigDecimal.toString() can return a String in scientific notation. As we use a BigDecimal for the XML schema type <xs:decimal>, this is illegal (as per XML schema specification, this is not allowed).

      As a result of this, BigDecimal.toPlainString() should be used for Java 5.0 and above (ideally for BigDecimals representing ,xs>decimal> only). It looks like the code in question (within Marshaller) will have to take into account the JVM release number to make an educated decision.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Werner Guttmann
              Reporter:
              Werner Guttmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified