db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: BigDecimal incompatibility from 1.5 -> 1.4
Date Thu, 13 Jul 2006 17:50:51 GMT
Ray Kiddy wrote:

> I have been e-mailing with Andrew McIntyre about getting some things 
> done in the build of Derby on Mac OS X.
> We (at Apple) are seeing something and I am wondering how you all  have
> dealt with this issue. At one time, we thought we could use Java  1.5
> and achieve backwards compatibility with 1.4. We have seen an  issue
> with BigDecimal and I wonder if this has impacted you all, or  how you
> have dealt with it.
> The problem is this. If one used a method in 1.4, java.math.BigDecimal
> (int), the javac compiler would map this for you, under the covers,  to
> java.math.BigDecimal(double).

> Just curious how you all are dealing with this, or if you have had to.

The Derby code only (hopefully) uses that method when passing a double
to it. The automatic promotion of a long or an int to a double caused
problems for the SQL type system, where a precise type such as BIGINT
would be incorrectly  converted to an imprecise value through this
method. This would occur when casting a BIGINT to a DECIMAL or the
application fetching a BIGINT as a java.math.BigDecimal.

If you've found any instances of this call in Derby code, could you
enter a Jira issue to fix them to use the BigDecimal.valueOf() call.


View raw message