Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch Available
Description
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[] )
}
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>
Attachments
Attachments
Issue Links
- is related to
-
HARMONY-5088 [classlib][math] BigInteger(int numBits, Random rnd) constructor contains overflow
- Reopened