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

Comparing jsr166/src/test/loops/ListBash.java (file contents):
Revision 1.14 by jsr166, Sun Jul 14 22:29:33 2013 UTC vs.
Revision 1.17 by jsr166, Sun Oct 23 03:03:23 2016 UTC

# Line 12 | Line 12 | public class ListBash {
12      static int numItr;
13      static int listSize;
14      static boolean synch;
15 <    static Class cl;
15 >    static Class<?> cl;
16  
17      public static void main(String[] args) {
18          numItr = Integer.parseInt(args[1]);
# Line 48 | Line 48 | public class ListBash {
48          System.out.println("Time: " + (elapsed/1000000000.0) + "s");
49      }
50  
51
52
51      static void elementLoop() {
52          List<Integer> s1 = newList(cl, synch);
53          AddRandoms(s1, listSize);
# Line 240 | Line 238 | public class ListBash {
238      }
239  
240      // Done inefficiently so as to exercise toArray
241 <    static List<Integer> clone(List s, Class cl, boolean synch) {
241 >    static List<Integer> clone(List s, Class<?> cl, boolean synch) {
242          List a = Arrays.asList(s.toArray());
243          if (s.hashCode() != a.hashCode())
244              fail("Incorrect hashCode computation.");
# Line 257 | Line 255 | public class ListBash {
255          return (List<Integer>) clone;
256      }
257  
258 <    static List<Integer> newList(Class cl, boolean synch) {
258 >    static List<Integer> newList(Class<?> cl, boolean synch) {
259          try {
260 <            List<Integer> s = (List<Integer>) cl.newInstance();
260 >            List<Integer> s = (List<Integer>) cl.getConstructor().newInstance();
261              if (synch)
262                  s = Collections.synchronizedList(s);
263              if (!s.isEmpty())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines