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.4 by jsr166, Mon Nov 2 23:42:46 2009 UTC vs.
Revision 1.8 by jsr166, Thu Dec 18 18:43:22 2014 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6   import java.util.*;
7   import java.io.*;
# Line 23 | Line 23 | public class CollectionWordLoops {
23      static final int numTests  = 2;
24  
25      public static void main(String[] args) {
26 <        Class collectionClass = null;
26 >        Class<?> collectionClass = null;
27          try {
28              collectionClass = Class.forName(args[0]);
29          } catch (ClassNotFoundException e) {
# Line 40 | Line 40 | public class CollectionWordLoops {
40  
41      }
42  
43 <    static void tests(Class collectionClass, int numTests, int sizeIndex) {
43 >    static void tests(Class<?> collectionClass, int numTests, int sizeIndex) {
44          try {
45              String[] key = readWords(sizeIndex);
46              int size = key.length;
# Line 64 | Line 64 | public class CollectionWordLoops {
64      }
65  
66  
67 <    static Collection<String> newCollection(Class cl) {
67 >    static Collection<String> newCollection(Class<?> cl) {
68          try {
69 <            Collection m = (Collection<String>)cl.newInstance();
69 >            Collection m = (Collection<String>) cl.newInstance();
70              return m;
71          } catch (Exception e) {
72              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
# Line 114 | Line 114 | public class CollectionWordLoops {
114          long startTime = System.currentTimeMillis();
115          runner.run();
116          long afterRun = System.currentTimeMillis();
117 <        long runTime =  (afterRun - startTime);
117 >        long runTime = afterRun - startTime;
118          int np = runner.total;
119          if (runner.total == runner.hashCode())
120              System.out.println("Useless Number" + runner.total);
# Line 173 | Line 173 | public class CollectionWordLoops {
173                  if (r < pctrem) {
174                      collection.remove(k);
175                      ++nremoves;
176 <                    j += ((r >>> 8) & 7) +  n / 2;
176 >                    j += ((r >>> 8) & 7) + n / 2;
177                      if (j >= n) j -= n;
178                  }
179              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines