You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org> on 2006/12/01 14:49:24 UTC
[jira] Resolved: (TUSCANY-836) doubleValue() may be inaccurate for
Long
[ http://issues.apache.org/jira/browse/TUSCANY-836?page=all ]
Kelvin Goodson resolved TUSCANY-836.
------------------------------------
Fix Version/s: Java-Mx
Resolution: Fixed
applied fix and test
> doubleValue() may be inaccurate for Long
> ----------------------------------------
>
> Key: TUSCANY-836
> URL: http://issues.apache.org/jira/browse/TUSCANY-836
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-Mx
> Environment: Sun JRE 1.5.0_07-b03
> Reporter: Yang ZHONG
> Fix For: Java-Mx
>
> Attachments: Long2BigDecimalTestCase.java
>
>
> assertSame(DataObjectUtil.getBigDecimal(new Long(Long.MAX_VALUE)).longValue(), Long.MAX_VALUE);
> complains
> junit.framework.AssertionFailedError: expected same:<-9223372036854775808> was not:<9223372036854775807>
> Potential fix:
> if (value instanceof Long)
> {
> return new BigDecimal(((Long)value).longValue());
> }
> before
> if (value instanceof Number)
> {
> return new BigDecimal(((Number)value).doubleValue());
> }
> Thanks to Marcelo Palladino.
--
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org