db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Van Couvering <David.Vancouver...@Sun.COM>
Subject Re: Sun, Java and BigDecimal incompatible changes in J2SE 5.0
Date Fri, 22 Apr 2005 03:40:59 GMT
Hi, Dan.  Those of us on the list are pretty far away from these kinds 
of changes to J2SE.  That said, I do have some contacts, and will try 
and follow-up on this and get back to you.  Your open-ended question 
"are there any more incompatibilities like this that could break Derby 
code?" I think implies are there any more *known* incompatibilities. 
I'll try to find that out too.


Daniel John Debrunner wrote:

> I'm wonder if any of the Sun folks on the list can help out, J2SE 5.0
> has changed the behaviour of java.math.BigDecimal in incompatible ways
> from JDK 1.4.x, but these are not mentioned in
> http://java.sun.com/j2se/1.5.0/compatibility.html
> Is there any document that details all the ways J2SE 5.0's BigDecimal is
> incompatible with all earlier Java releases?
> While we changed Derby to address the change in behaviour of
> BigDecimal.toString() a while ago, I just discovered another change that
> breaks Derby and potentially other applications. The method
> BigDecimal.scale() used to be
> (JDK 1.4.1 javadoc)
> Returns the scale of this BigDecimal. (The scale is the number of digits
> to the right of the decimal point.)
> but now it can return negative numbers
> (J2SE 5.0 docs)
> Returns the scale of this BigDecimal. If zero or positive, the scale is
> the number of digits to the right of the decimal point. If negative, the
> unscaled value of the number is multiplied by ten to the power of the
> negation of the scale. For example, a scale of -3 means the unscaled
> value is multiplied by 1000.
> I discovered this when looking at Derby-225 and simple cleanup changes
> that should have not fixed the issue suddenly fixed it. Further
> investigation showed a scale of -302 which of course confused the
> existing code.
> I wonder if there are any more incompatibilities in this class that
> could break Derby code?
> Thanks,
> Dan.

View raw message