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

Comparing jsr166/src/test/loops/IntMapCheck.java (file contents):
Revision 1.4 by jsr166, Thu Oct 29 23:09:07 2009 UTC vs.
Revision 1.7 by jsr166, Mon Nov 2 23:55:36 2009 UTC

# Line 29 | Line 29 | public class IntMapCheck {
29          if (args.length > 0) {
30              try {
31                  mapClass = Class.forName(args[0]);
32 <            } catch(ClassNotFoundException e) {
32 >            } catch (ClassNotFoundException e) {
33                  throw new RuntimeException("Class " + args[0] + " not found.");
34              }
35          }
# Line 77 | Line 77 | public class IntMapCheck {
77          try {
78              Map m = (Map<Integer,Integer>)cl.newInstance();
79              return m;
80 <        } catch(Exception e) {
80 >        } catch (Exception e) {
81              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
82          }
83      }
# Line 108 | Line 108 | public class IntMapCheck {
108          timer.start(nm, n * iters);
109          for (int j = 0; j < iters; ++j) {
110              for (int i = 0; i < n; i++) {
111 <                if ((Integer)(s.get(i)) != i) ++sum;
111 >                if (s.get(i) != i) ++sum;
112              }
113          }
114          timer.finish();
# Line 219 | Line 219 | public class IntMapCheck {
219          int sum = 0;
220          timer.start("Iter Key               ", size);
221          for (Iterator it = s.keySet().iterator(); it.hasNext(); ) {
222 <            if(it.next() != MISSING)
222 >            if (it.next() != MISSING)
223                  ++sum;
224          }
225          timer.finish();
# Line 232 | Line 232 | public class IntMapCheck {
232          int sum = 0;
233          timer.start("Iter Value             ", size);
234          for (Iterator it = s.values().iterator(); it.hasNext(); ) {
235 <            if(it.next() != MISSING)
235 >            if (it.next() != MISSING)
236                  ++sum;
237          }
238          timer.finish();
# Line 244 | Line 244 | public class IntMapCheck {
244          int sum = 0;
245          timer.start("Iter Entry             ", size);
246          for (Iterator it = s.entrySet().iterator(); it.hasNext(); ) {
247 <            if(it.next() != MISSING)
247 >            if (it.next() != MISSING)
248                  ++sum;
249          }
250          timer.finish();
# Line 272 | Line 272 | public class IntMapCheck {
272          reallyAssert (!s.containsKey(k));
273          while (it.hasNext()) {
274              Map.Entry<Integer,Integer> x = (Map.Entry<Integer,Integer>)(it.next());
275 <            Integer k2 = (Integer)x.getKey();
275 >            Integer k2 = x.getKey();
276              seen.put(k2, k2);
277              if (k2 != MISSING)
278                  ++sum;
# Line 348 | Line 348 | public class IntMapCheck {
348  
349      static void entest(Map<Integer,Integer> s, int size) {
350          if (s instanceof Hashtable) {
351 <            Hashtable ht = (Hashtable)s;
351 >            Hashtable ht = (Hashtable) s;
352              //            entest3(ht, size);
353              //            entest4(ht, size);
354              entest1(ht, size);
# Line 532 | Line 532 | public class IntMapCheck {
532          static void printStats() {
533              for (Iterator it = accum.entrySet().iterator(); it.hasNext(); ) {
534                  Map.Entry e = (Map.Entry)(it.next());
535 <                Stats stats = ((Stats)(e.getValue()));
535 >                Stats stats = ((Stats) (e.getValue()));
536                  long n = stats.number;
537                  double t;
538                  if (n > 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines