jdk/src/share/classes/javax/swing/DefaultRowSorter.java
changeset 25568 b906a74c6882
parent 23010 6dadb192ad81
child 25572 72ada33d5b97
--- a/jdk/src/share/classes/javax/swing/DefaultRowSorter.java	Thu Jul 03 18:47:42 2014 +0400
+++ b/jdk/src/share/classes/javax/swing/DefaultRowSorter.java	Thu Jul 03 15:24:27 2014 -0700
@@ -128,7 +128,7 @@
     /**
      * Comparators specified by column.
      */
-    private Comparator[] comparators;
+    private Comparator<?>[] comparators;
 
     /**
      * Whether or not the specified column is sortable, by column.
@@ -143,7 +143,7 @@
     /**
      * Cached comparators for the current sort
      */
-    private Comparator[] sortComparators;
+    private Comparator<?>[] sortComparators;
 
     /**
      * Developer supplied Filter.
@@ -695,7 +695,7 @@
      */
     private void cacheSortKeys(List<? extends SortKey> keys) {
         int keySize = keys.size();
-        sortComparators = new Comparator[keySize];
+        sortComparators = new Comparator<?>[keySize];
         for (int i = 0; i < keySize; i++) {
             sortComparators[i] = getComparator0(keys.get(i).getColumn());
         }
@@ -760,7 +760,7 @@
     public void setComparator(int column, Comparator<?> comparator) {
         checkColumn(column);
         if (comparators == null) {
-            comparators = new Comparator[getModelWrapper().getColumnCount()];
+            comparators = new Comparator<?>[getModelWrapper().getColumnCount()];
         }
         comparators[column] = comparator;
     }
@@ -786,8 +786,8 @@
 
     // Returns the Comparator to use during sorting.  Where as
     // getComparator() may return null, this will never return null.
-    private Comparator getComparator0(int column) {
-        Comparator comparator = getComparator(column);
+    private Comparator<?> getComparator0(int column) {
+        Comparator<?> comparator = getComparator(column);
         if (comparator != null) {
             return comparator;
         }
@@ -965,7 +965,9 @@
                 } else if (v2 == null) {
                     result = 1;
                 } else {
-                    result = sortComparators[counter].compare(v1, v2);
+                    Comparator<Object> c =
+                        (Comparator<Object>)sortComparators[counter];
+                    result = c.compare(v1, v2);
                 }
                 if (sortOrder == SortOrder.DESCENDING) {
                     result *= -1;
@@ -1364,10 +1366,10 @@
      */
     // NOTE: this class is static so that it can be placed in an array
     private static class Row implements Comparable<Row> {
-        private DefaultRowSorter sorter;
+        private DefaultRowSorter<?, ?> sorter;
         int modelIndex;
 
-        public Row(DefaultRowSorter sorter, int index) {
+        public Row(DefaultRowSorter<?, ?> sorter, int index) {
             this.sorter = sorter;
             modelIndex = index;
         }