You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nellya Udovichenko (JIRA)" <ji...@apache.org> on 2007/01/12 17:36:27 UTC
[jira] Commented: (HARMONY-1047) [classlib][math]exception
compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)
[ https://issues.apache.org/jira/browse/HARMONY-1047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464240 ]
Nellya Udovichenko commented on HARMONY-1047:
---------------------------------------------
Please, try my patch.
> [classlib][math]exception compatibility: new BigInteger(Integer.MAX_VALUE, (Random)null)
> ----------------------------------------------------------------------------------------
>
> Key: HARMONY-1047
> URL: https://issues.apache.org/jira/browse/HARMONY-1047
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Reporter: Denis Kishenko
> Attachments: HARMONY-1047-test.patch, HARMONY-1047.patch
>
>
> 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira