66 |
|
|
67 |
|
static NavigableMap newMap(Class<?> cl) { |
68 |
|
try { |
69 |
< |
NavigableMap m = (NavigableMap) cl.newInstance(); |
70 |
< |
return m; |
69 |
> |
return (NavigableMap) cl.getConstructor().newInstance(); |
70 |
|
} catch (Exception e) { |
71 |
|
throw new RuntimeException("Can't instantiate " + cl + ": " + e); |
72 |
|
} |
315 |
|
|
316 |
|
static void dtest(NavigableMap s, int size, Integer[] key) { |
317 |
|
timer.start("Put (putAll) ", size * 2); |
318 |
< |
NavigableMap s2 = null; |
318 |
> |
final NavigableMap s2; |
319 |
|
try { |
320 |
< |
s2 = (NavigableMap) (s.getClass().newInstance()); |
320 |
> |
s2 = (NavigableMap) s.getClass().getConstructor().newInstance(); |
321 |
|
s2.putAll(s); |
322 |
|
} |
323 |
|
catch (Exception e) { e.printStackTrace(); return; } |