--- jsr166/src/test/loops/IntMapCheck.java 2015/01/15 18:34:19 1.14 +++ jsr166/src/test/loops/IntMapCheck.java 2016/10/23 03:03:23 1.15 @@ -73,8 +73,7 @@ public class IntMapCheck { static Map newMap(Class cl) { try { - Map m = (Map)cl.newInstance(); - return m; + return (Map) cl.getConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException("Can't instantiate " + cl + ": " + e); } @@ -439,9 +438,10 @@ public class IntMapCheck { t3("Put (presized) ", size, s, key, size); timer.start("Put (putAll) ", size * 2); - Map s2 = null; + final Map s2; try { - s2 = (Map) (s.getClass().newInstance()); + s2 = (Map) + s.getClass().getConstructor().newInstance(); s2.putAll(s); } catch (Exception e) { e.printStackTrace(); return; }