harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nellya Udovichenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1047) [classlib][math]exception compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)
Date Fri, 29 Dec 2006 17:29:22 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1047?page=comments#action_12461415 ] 
            
Nellya Udovichenko commented on HARMONY-1047:
---------------------------------------------

I verified this test on the latest Harmony version and got the following results:

the same one on RI:
Exception in thread "main" java.lang.NegativeArraySizeException
        at java.math.BigInteger.randomBits(BigInteger.java:471)
        at java.math.BigInteger.<init>(BigInteger.java:464)
        at BigIntegerTest.main(BigIntegerTest.java:6)

but another one on Harmony:
Exception in thread "main" java.lang.NullPointerException
        at java.math.BigInteger.<init>(BigInteger.java:98)
        at BigIntegerTest.main(BigIntegerTest.java:6)

So I think this bug can be closed as 'Won't Fix'.


> [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 -------------------------------------------------------
> RI
> 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)
> Harmony
> java.lang.OutOfMemoryError
> 	<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

        

Mime
View raw message