66 |
|
|
67 |
|
static NavigableSet newSet(Class<?> cl) { |
68 |
|
try { |
69 |
< |
NavigableSet m = (NavigableSet) cl.newInstance(); |
70 |
< |
return m; |
69 |
> |
return (NavigableSet) cl.getConstructor().newInstance(); |
70 |
|
} catch (Exception e) { |
71 |
|
throw new RuntimeException("Can't instantiate " + cl + ": " + e); |
72 |
|
} |
270 |
|
|
271 |
|
static void dtest(NavigableSet s, int size, Integer[] key) { |
272 |
|
timer.start("Add (addAll) ", size * 2); |
273 |
< |
NavigableSet s2 = null; |
273 |
> |
final NavigableSet s2; |
274 |
|
try { |
275 |
< |
s2 = (NavigableSet) (s.getClass().newInstance()); |
275 |
> |
s2 = (NavigableSet) s.getClass().getConstructor().newInstance(); |
276 |
|
s2.addAll(s); |
277 |
|
} |
278 |
|
catch (Exception e) { e.printStackTrace(); return; } |