This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: PR 8481


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) &lt; 0);
@@ -296,7 +296,7 @@
     int bits, val;
     do
       {
-        bits = next(32);
+        bits = next(31);
         val = bits % n;
       }
     while (bits - val + (n - 1) < 0);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]