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

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

# Line 32 | Line 32 | public class NavigableSetCheck {
32          if (args.length > 0) {
33              try {
34                  setClass = 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 NavigableSetCheck {
70  
71      static NavigableSet newSet(Class cl) {
72          try {
73 <            NavigableSet m = (NavigableSet)cl.newInstance();
73 >            NavigableSet m = (NavigableSet) 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 242 | Line 242 | public class NavigableSetCheck {
242          int sum = 0;
243          timer.start("Iter Key               ", size);
244          for (Iterator it = s.iterator(); it.hasNext(); ) {
245 <            if(it.next() != MISSING)
245 >            if (it.next() != MISSING)
246                  ++sum;
247          }
248          timer.finish();
# Line 257 | Line 257 | public class NavigableSetCheck {
257          int sum = 0;
258          timer.start("Desc Iter Key          ", size);
259          for (Iterator it = s.descendingIterator(); it.hasNext(); ) {
260 <            if(it.next() != MISSING)
260 >            if (it.next() != MISSING)
261                  ++sum;
262          }
263          timer.finish();
# Line 371 | Line 371 | public class NavigableSetCheck {
371  
372          static void printStats() {
373              for (Iterator it = accum.entrySet().iterator(); it.hasNext(); ) {
374 <                Map.Entry e = (Map.Entry)(it.next());
375 <                Stats stats = ((Stats)(e.getValue()));
374 >                Map.Entry e = (Map.Entry) it.next();
375 >                Stats stats = (Stats) e.getValue();
376                  int n = stats.number;
377                  double t;
378                  if (n > 0)
# Line 408 | Line 408 | public class NavigableSetCheck {
408          void finish() {
409              long endTime = System.currentTimeMillis();
410              long time = endTime - startTime;
411 <            double timePerOp = ((double)time)/numOps;
411 >            double timePerOp = (double) time / numOps;
412  
413              Object st = accum.get(name);
414              if (st == null)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines