--- jsr166/src/test/loops/IteratorLoops.java 2015/01/15 18:34:19 1.12 +++ jsr166/src/test/loops/IteratorLoops.java 2016/10/23 03:03:23 1.14 @@ -32,10 +32,10 @@ public final class IteratorLoops { System.out.println(); Collection[] colls = - (Collection[])new Collection[NC]; + (Collection[])new Collection[NC]; for (int k = 0; k < colls.length; ++k) { - Object x = klass.newInstance(); + Object x = klass.getConstructor().newInstance(); if (x instanceof Collection) colls[k] = (Collection) x; else if (x instanceof Map) @@ -86,8 +86,8 @@ public final class IteratorLoops { int counts() { int count = 0; for (int k = 0; k < cs.length; ++k) { - for (Iterator it = cs[k].iterator(); it.hasNext();) { - if (it.next() != null) + for (Integer x : cs[k]) { + if (x != null) ++count; } }