You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/08/25 13:23:24 UTC
[jira] Commented: (HARMONY-1047) [classlib][math]exception
compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)
[ http://issues.apache.org/jira/browse/HARMONY-1047?page=comments#action_12430486 ]
Denis Kishenko commented on HARMONY-1047:
-----------------------------------------
test comment
> [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