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

Comparing jsr166/src/test/loops/MapWordLoops.java (file contents):
Revision 1.9 by jsr166, Thu Dec 18 18:43:22 2014 UTC vs.
Revision 1.13 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 MapWordLoops {
10  
# Line 39 | Line 39 | public class MapWordLoops {
39  
40          for (int s = WORDS_FILES.length-1; s >= 0; --s)
41              tests(mapClass, numTests, s);
42
42      }
43  
44      static void tests(Class<?> mapClass, int numTests, int sizeIndex) {
# Line 65 | Line 64 | public class MapWordLoops {
64          }
65      }
66  
68
67      static Map<String,String> newMap(Class<?> cl) {
68          try {
69 <            Map m = (Map<String,String>)cl.newInstance();
72 <            return m;
69 >            return (Map<String,String>) cl.getConstructor().newInstance();
70          } catch (Exception e) {
71              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
72          }
# Line 127 | Line 124 | public class MapWordLoops {
124          return runTime;
125      }
126  
130
127      static class Runner implements Runnable {
128          final Map<String,String> map;
129          final String[] key;
# Line 148 | Line 144 | public class MapWordLoops {
144              rng = new LoopHelpers.SimpleRandom((id + 1) * 8862213513L);
145          }
146  
151
147          int oneStep(int j) {
148              int n = key.length;
149              int r = rng.next() & 0x7FFFFFFF;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines