Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319030 - BigDecimal cast to double kills causes false equal comparisons
Summary: BigDecimal cast to double kills causes false equal comparisons
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All Mac OS X - Carbon (unsup.)
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 13:04 EDT by rlee CLA
Modified: 2022-06-09 10:08 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rlee CLA 2010-07-06 13:04:53 EDT
Build Identifier: 2.1.0

When org.eclipse.persistence.internal.helper.compareBigDecimals is called the values are cast to a double if the scales are not identical and then compared.  This is kills the precision causing a false positive if the number is large as the double casting causes the value to lose precision.

Reproducible: Always

Steps to Reproduce:
1. Send value one as 12345678901234567890123456789012345
2. Send value two as 12345678901234567890123456789012300
3. Result is that the values are equal and this is not true
Comment 1 Tom Ware CLA 2010-08-09 13:51:47 EDT
Setting target and priority.  See the following page for details of the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:08:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink