--- jsr166/src/test/loops/ListBash.java 2009/11/02 23:55:36 1.9 +++ jsr166/src/test/loops/ListBash.java 2010/09/01 07:20:36 1.10 @@ -19,11 +19,11 @@ public class ListBash { listSize = Integer.parseInt(args[2]); cl = null; - try { - cl = Class.forName(args[0]); - } catch (ClassNotFoundException e) { - fail("Class " + args[0] + " not found."); - } + try { + cl = Class.forName(args[0]); + } catch (ClassNotFoundException e) { + fail("Class " + args[0] + " not found."); + } synch = (args.length>3); oneRun(); @@ -33,14 +33,14 @@ public class ListBash { static void oneRun() { long startTime = System.nanoTime(); - for (int i=0; i s = newList(cl, synch); - for (int i=0; i s = newList(cl, synch); + for (int i=0; i) clone; + return (List) clone; } static List newList(Class cl, boolean synch) { - try { - List s = (List) cl.newInstance(); + try { + List s = (List) cl.newInstance(); if (synch) s = Collections.synchronizedList(s); - if (!s.isEmpty()) - fail("New instance non empty."); - return s; - } catch (Throwable t) { - fail("Can't instantiate " + cl + ": " + t); - } - return null; //Shut up compiler. + if (!s.isEmpty()) + fail("New instance non empty."); + return s; + } catch (Throwable t) { + fail("Can't instantiate " + cl + ": " + t); + } + return null; //Shut up compiler. } static void AddRandoms(List s, int n) { - for (int i=0; i