ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/CollectionWordLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/CollectionWordLoops.java (file contents):
Revision 1.8 by jsr166, Thu Dec 18 18:43:22 2014 UTC vs.
Revision 1.12 by jsr166, Sun Oct 23 03:03:23 2016 UTC

# Line 3 | Line 3
3   * Expert Group and released to the public domain, as explained at
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6 import java.util.*;
6   import java.io.*;
7 + import java.util.*;
8  
9   public class CollectionWordLoops {
10  
# Line 37 | Line 37 | public class CollectionWordLoops {
37  
38          for (int s = WORDS_FILES.length-1; s >= 0; --s)
39              tests(collectionClass, numTests, s);
40
40      }
41  
42      static void tests(Class<?> collectionClass, int numTests, int sizeIndex) {
# Line 63 | Line 62 | public class CollectionWordLoops {
62          }
63      }
64  
66
65      static Collection<String> newCollection(Class<?> cl) {
66          try {
67 <            Collection m = (Collection<String>) cl.newInstance();
70 <            return m;
67 >            return (Collection<String>) cl.getConstructor().newInstance();
68          } catch (Exception e) {
69              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
70          }
# Line 125 | Line 122 | public class CollectionWordLoops {
122          return runTime;
123      }
124  
128
125      static class Runner implements Runnable {
126          final Collection<String> collection;
127          final String[] key;
# Line 145 | Line 141 | public class CollectionWordLoops {
141              pctins = (int)(((long)pinsert * (long)(Integer.MAX_VALUE/2)) / 50);
142          }
143  
148
144          int oneStep(int j) {
145              int n = key.length;
146              int r = rng.next() & 0x7FFFFFFF;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines