Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6812880
Votes 0
Synopsis AssertionError in BigDecimal.remainder
Category java:classes_math
Reported Against
Release Fixed 6u14(b04)
State 10-Fix Delivered, bug
Priority: 1-Very High
Related Bugs 6801512
Submit Date 04-MAR-2009
Description
FULL PRODUCT VERSION :
java version "1.6.0_14-ea"
Java(TM) SE Runtime Environment (build 1.6.0_14-ea-b01)
OpenJDK Client VM (build 14.0-b10, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
 customer  Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
BigDecimal.remainder throws Exception

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See test case

ACTUAL -
AssertionError

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.AssertionError: this MutableBigInteger can't be fit into long
	at java.math.MutableBigInteger.toLong(MutableBigInteger.java:129)
	at java.math.MutableBigInteger.divide(MutableBigInteger.java:930)
	at java.math.BigDecimal.divideAndRound(BigDecimal.java:1416)
	at java.math.BigDecimal.setScale(BigDecimal.java:2377)
	at java.math.BigDecimal.setScale(BigDecimal.java:2310)
	at java.math.BigDecimal.divideToIntegralValue(BigDecimal.java:1710)
	at java.math.BigDecimal.divideAndRemainder(BigDecimal.java:1865)
	at java.math.BigDecimal.remainder(BigDecimal.java:1807)
	at it.prodata.gest.test.Test.main(Test.java:79)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Test {
	public static void main(String s[]) {
		BigDecimal bd1 = new BigDecimal("200000000000000000000000000000");
		BigDecimal bd2 = BigDecimal.valueOf(97);
		System.out.println(bd1.remainder(bd2));
	}
}

---------- END SOURCE ----------

Release Regression From : 6u12
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.
Posted Date : 2009-03-04 10:27:13.0
Work Around
N/A
Evaluation
See Comments.
Posted Date : 2009-03-05 03:48:45.0

This appears to a bug in the assertion. It should be asserting that the number of ints in the value array is 2 or less.
Posted Date : 2009-03-06 10:22:17.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang