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

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

# Line 64 | Line 64 | public class CollectionWordLoops {
64  
65      static Collection<String> newCollection(Class<?> cl) {
66          try {
67 <            Collection m = (Collection<String>) cl.newInstance();
68 <            return m;
67 >            return (Collection<String>) cl.getConstructor().newInstance();
68          } catch (Exception e) {
69              throw new RuntimeException("Can't instantiate " + cl + ": " + e);
70          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines