ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Random/DistinctSeeds.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Random/DistinctSeeds.java (file contents):
Revision 1.5 by jsr166, Tue Feb 17 00:40:01 2009 UTC vs.
Revision 1.6 by jsr166, Mon Aug 31 22:24:46 2009 UTC

# Line 14 | Line 14 | import java.util.Random;
14  
15   public class DistinctSeeds {
16      public static void main(String[] args) throws Exception {
17 <        // Strictly speaking, it is possible for these to randomly fail,
18 <        // but the probability should be *extremely* small (< 2**-63).
19 <        if (new Random().nextLong() == new Random().nextLong() ||
20 <            new Random().nextLong() == new Random().nextLong())
17 >        // Strictly speaking, it is possible for these to randomly fail,
18 >        // but the probability should be *extremely* small (< 2**-63).
19 >        if (new Random().nextLong() == new Random().nextLong() ||
20 >            new Random().nextLong() == new Random().nextLong())
21              throw new RuntimeException("Random() seeds not unique.");
22      }
23   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines