commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/comparators TestReverseComparator.java
Date Fri, 01 Mar 2002 19:39:29 GMT
morgand     02/03/01 11:39:28

  Modified:    collections/src/test/org/apache/commons/collections/comparators
                        TestReverseComparator.java
  Log:
  no message
  
  Revision  Changes    Path
  1.2       +12 -10    jakarta-commons/collections/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java
  
  Index: TestReverseComparator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestReverseComparator.java	1 Mar 2002 19:06:44 -0000	1.1
  +++ TestReverseComparator.java	1 Mar 2002 19:39:28 -0000	1.2
  @@ -1,5 +1,6 @@
   package org.apache.commons.collections.comparators;
   
  +import java.util.Collections;
   import java.util.Comparator;
   import java.util.LinkedList;
   import java.util.List;
  @@ -20,24 +21,25 @@
   
       /**
        * For the purposes of this test, return a 
  -     * ReverseComparator that wraps a ComparableComparator, 
  -     * which should produce a backward-ordered list
  -     * identical to the java.util.Collection.reverseOrder()
  -     * Comparator.
  +     * ReverseComparator that wraps the java.util.Collections.reverseOrder()
  +     * Comparator.  The resulting comparator shouls
  +     * sort according to natural Order.  (Note: we wrap
  +     * a Comparator taken from the JDK so that we can
  +     * save a "canonical" form in CVS.
        * 
  -     * @return Comparator that reverses a "natural" order
  +     * @return Comparator that returns "natural" order
        */
       public Comparator makeComparator() {
  -        return new ReverseComparator(new ComparableComparator());
  +        return new ReverseComparator(Collections.reverseOrder());
       }
   
       public List getComparableObjectsOrdered() {
           List list = new LinkedList();
  -        list.add(new Integer(5));
  -        list.add(new Integer(4));
  -        list.add(new Integer(3));
  -        list.add(new Integer(2));
           list.add(new Integer(1));
  +        list.add(new Integer(2));
  +        list.add(new Integer(3));
  +        list.add(new Integer(4));
  +        list.add(new Integer(5));
           return list;
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message