Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4974878

(coll) Collections and reverse order comparator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-libs

      From: <###@###.###>
      Subject: Collections and reverse order comparator

      In version version 1.77, 11/17/03 of the classe
      java.util.Collections, the class ReverseComparator
      is definied with a formal parameter T that is unused.

      moreover method reverseOrder() when cmp is null
      doesn't use the static field REVERSE_ORDER.

      public static <T> Comparator<T> reverseOrder(Comparator<T> cmp) {
         if (cmp == null)
           return REVERSE_ORDER;
           //return new ReverseComparator();

         return new ReverseComparator2<T>(cmp);
      }

            martin Martin Buchholz
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: