Closed Bug 382537 Opened 17 years ago Closed 5 years ago

Change in behavior of BigDecimal.valueOf() for Java 1.4 & 1.5

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: harprit_singh, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1)
Build Identifier: Rhino 1.6R3

The script: Packages.java.math.BigDecimal.valueOf(50)
returns different values for JDK 1.4 & 1.5

Due to this the comparison checks of BigDecimal data in our implementation are failing (when we made transition from Java 1.4 to Java 1.5)

Reproducible: Always

Steps to Reproduce:
script - Packages.java.math.BigDecimal.valueOf(50)

1. Evaluate above script using Java 1.4.2_10 
2. Evaluate above script using Java 1.5.0_10
Actual Results:  
Output of Step 1: 50
Output of Step 2: 50.0

Expected Results:  
Output of Step 1: 50
Output of Step 2: 50 

Change in JDK version should not change the output from 50 to 50.0
or please let us know the reason for this change.
The behavior of method: BigDecimal.valueOf(long) has not changed in Java i.e. call to BigDecimal.valueOf(50)returns the same output (50) for both JDK 1.4 & 1.5

Closing. Bug management is now done here:
https://github.com/mozilla/rhino

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.