ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/NullComparator.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/NullComparator.java (file contents):
Revision 1.3 by jsr166, Sat Oct 21 00:44:23 2017 UTC vs.
Revision 1.5 by jsr166, Mon Jan 8 03:12:03 2018 UTC

# Line 27 | Line 27
27   * @summary A null Comparator is now specified to indicate natural ordering.
28   */
29  
30 < import java.util.*;
30 > import java.util.ArrayList;
31 > import java.util.Arrays;
32 > import java.util.Collections;
33 > import java.util.List;
34  
35   public class NullComparator {
36      public static void main(String[] args) throws Exception {
# Line 37 | Line 40 | public class NullComparator {
40          List sorted = new ArrayList(list);
41          Collections.shuffle(list);
42  
43 <        Object a[] = list.toArray();
43 >        Object[] a = list.toArray();
44          Arrays.sort(a, null);
45          if (!Arrays.asList(a).equals(sorted))
46              throw new Exception("Arrays.sort");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines