[
https://issues.apache.org/jira/browse/TUSCANY-836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kelvin Goodson updated TUSCANY-836:
-----------------------------------
Fix Version/s: (was: Java-SCA-Mx)
Java-SDO-M3
> doubleValue() may be inaccurate for Long
> ----------------------------------------
>
> Key: TUSCANY-836
> URL: https://issues.apache.org/jira/browse/TUSCANY-836
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SCA-Mx
> Environment: Sun JRE 1.5.0_07-b03
> Reporter: Yang ZHONG
> Fix For: Java-SDO-M3
>
> 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.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]