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

Comparing jsr166/src/test/jtreg/util/Collections/Disjoint.java (file contents):
Revision 1.3 by jsr166, Mon Sep 27 19:15:15 2010 UTC vs.
Revision 1.8 by jsr166, Mon Jan 8 03:12:03 2018 UTC

# Line 26 | Line 26
26   * @bug     4339792
27   * @summary Basic test for Collections.disjoint
28   * @author  Josh Bloch
29 < *
30 < * @compile -source 1.5 Disjoint.java
31 < * @run main Disjoint
29 > * @key randomness
30   */
31  
32 < import java.util.*;
32 > import java.util.ArrayList;
33 > import java.util.Collections;
34 > import java.util.HashSet;
35 > import java.util.List;
36 > import java.util.Random;
37  
38   public class Disjoint {
39      static final int N = 20;
40  
41 <    public static void main(String args[]) {
41 >    public static void main(String[] args) {
42          // Make an array of lists each of which shares a single element
43          // with its "neighbors," and no elements with other lists in the array
44          Random rnd = new Random();
# Line 44 | Line 46 | public class Disjoint {
46          int x = 0;
47          for (int i = 0; i < N; i++) {
48              int size = rnd.nextInt(10) + 2;
49 <            List<Integer> list = new ArrayList<Integer>(size);
49 >            List<Integer> list = new ArrayList<>(size);
50              for (int j = 1; j < size; j++)
51                  list.add(x++);
52              list.add(x);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines