ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/NavigableMapCheck.java
(Generate patch)

Comparing jsr166/src/test/loops/NavigableMapCheck.java (file contents):
Revision 1.15 by jsr166, Mon Aug 10 03:13:33 2015 UTC vs.
Revision 1.16 by jsr166, Sun Oct 23 03:03:23 2016 UTC

# Line 66 | Line 66 | public class NavigableMapCheck {
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          }
# Line 316 | Line 315 | public class NavigableMapCheck {
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; }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines