Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319030

Summary: BigDecimal cast to double kills causes false equal comparisons
Product: z_Archived Reporter: rlee
Component: EclipselinkAssignee: Project Inbox <eclipselink.foundation-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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