harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1047) [classlib][math]exception compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)
Date Wed, 02 Aug 2006 13:43:15 GMT
[classlib][math]exception compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)

                 Key: HARMONY-1047
                 URL: http://issues.apache.org/jira/browse/HARMONY-1047
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Denis Kishenko

Different exception behaviour when create a huge BigInteger. 

Actually it's impossible to create BigInteger with numBits=Integer.MAX_VALUE, but RI throws
an Exception while Harmony throws an Error.

Test --------------------------------------------------------------

mport java.math.BigInteger;
import java.util.Random;

public class bug9282 {
   public static void main(String args[] ) {
  	 new BigInteger(Integer.MAX_VALUE, (Random)null);

Output -------------------------------------------------------

java.lang.NegativeArraySizeException: Negative size-268435455
	at java.math.BigInteger.randomBits(BigInteger.java:471)
	at java.math.BigInteger.<init>(BigInteger.java:464)
	at bug9282.main(bug9282.java:6)

	<no stack trace available>

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message