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

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

# Line 66 | Line 66 | public class NavigableSetCheck {
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          }
# Line 271 | Line 270 | public class NavigableSetCheck {
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; }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines