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

Comparing jsr166/src/test/loops/NavigableMapCheck.java (file contents):
Revision 1.5 by jsr166, Thu Oct 29 23:09:07 2009 UTC vs.
Revision 1.8 by jsr166, Tue Nov 3 01:04:02 2009 UTC

# Line 32 | Line 32 | public class NavigableMapCheck {
32          if (args.length > 0) {
33              try {
34                  mapClass = Class.forName(args[0]);
35 <            } catch(ClassNotFoundException e) {
35 >            } catch (ClassNotFoundException e) {
36                  throw new RuntimeException("Class " + args[0] + " not found.");
37              }
38          }
# Line 70 | Line 70 | public class NavigableMapCheck {
70  
71      static NavigableMap newMap(Class cl) {
72          try {
73 <            NavigableMap m = (NavigableMap)cl.newInstance();
73 >            NavigableMap m = (NavigableMap) cl.newInstance();
74              return m;
75 <        } catch(Exception e) {
75 >        } catch (Exception e) {
76              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
77          }
78      }
# Line 254 | Line 254 | public class NavigableMapCheck {
254          int sum = 0;
255          timer.start("Iter Key               ", size);
256          for (Iterator it = s.keySet().iterator(); it.hasNext(); ) {
257 <            if(it.next() != MISSING)
257 >            if (it.next() != MISSING)
258                  ++sum;
259          }
260          timer.finish();
# Line 265 | Line 265 | public class NavigableMapCheck {
265          int sum = 0;
266          timer.start("Iter Value             ", size);
267          for (Iterator it = s.values().iterator(); it.hasNext(); ) {
268 <            if(it.next() != MISSING)
268 >            if (it.next() != MISSING)
269                  ++sum;
270          }
271          timer.finish();
# Line 275 | Line 275 | public class NavigableMapCheck {
275          int sum = 0;
276          timer.start("Iter Entry             ", size);
277          for (Iterator it = s.entrySet().iterator(); it.hasNext(); ) {
278 <            if(it.next() != MISSING)
278 >            if (it.next() != MISSING)
279                  ++sum;
280          }
281          timer.finish();
# Line 292 | Line 292 | public class NavigableMapCheck {
292          int sum = 0;
293          timer.start("Desc Iter Key          ", size);
294          for (Iterator it = s.descendingKeySet().iterator(); it.hasNext(); ) {
295 <            if(it.next() != MISSING)
295 >            if (it.next() != MISSING)
296                  ++sum;
297          }
298          timer.finish();
# Line 434 | Line 434 | public class NavigableMapCheck {
434  
435          static void printStats() {
436              for (Iterator it = accum.entrySet().iterator(); it.hasNext(); ) {
437 <                Map.Entry e = (Map.Entry)(it.next());
438 <                Stats stats = ((Stats)(e.getValue()));
437 >                Map.Entry e = (Map.Entry) it.next();
438 >                Stats stats = (Stats) e.getValue();
439                  int n = stats.number;
440                  double t;
441                  if (n > 0)
# Line 471 | Line 471 | public class NavigableMapCheck {
471          void finish() {
472              long endTime = System.currentTimeMillis();
473              long time = endTime - startTime;
474 <            double timePerOp = ((double)time)/numOps;
474 >            double timePerOp = (double) time /numOps;
475  
476              Object st = accum.get(name);
477              if (st == null)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines