This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 8481
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 06 Nov 2002 21:31:16 -0700
- Subject: Patch: FYI: PR 8481
- Reply-to: tromey at redhat dot com
I'm checking this in.
This fixes PR 8481. I checked this in to Classpath and I also checked
in a new Mauve test. Also I tested this.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
From svens@it.uu.se. For PR libgcj/8481.
* java/util/Random.java (nextInt(int)): Only use 31 bits.
Index: java/util/Random.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/Random.java,v
retrieving revision 1.7
diff -u -r1.7 Random.java
--- java/util/Random.java 18 Jun 2002 15:40:00 -0000 1.7
+++ java/util/Random.java 7 Nov 2002 04:37:30 -0000
@@ -259,7 +259,7 @@
int bits, val;
do
{
- bits = next(32);
+ bits = next(31);
val = bits % n;
}
while(bits - val + (n-1) < 0);
@@ -296,7 +296,7 @@
int bits, val;
do
{
- bits = next(32);
+ bits = next(31);
val = bits % n;
}
while (bits - val + (n - 1) < 0);