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/java/org/apache/commons/collections/comparators ComparatorChain.java
Date Mon, 25 Mar 2002 21:20:53 GMT
morgand     02/03/25 13:20:53

  Modified:    collections/src/java/org/apache/commons/collections/comparators
                        ComparatorChain.java
  Log:
  List constructors for ComparatorChain no longer perform defensive copies
  
  Revision  Changes    Path
  1.6       +9 -9      jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java
  
  Index: ComparatorChain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ComparatorChain.java	19 Mar 2002 22:25:51 -0000	1.5
  +++ ComparatorChain.java	25 Mar 2002 21:20:53 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v
1.5 2002/03/19 22:25:51 morgand Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/03/19 22:25:51 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v
1.6 2002/03/25 21:20:53 morgand Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/03/25 21:20:53 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,9 @@
    * <p>Calling a method that adds new Comparators or
    * changes the ascend/descend sort <i>after compare(Object,
    * Object) has been called</i> will result in an
  - * UnsupportedOperationException.</p>
  + * UnsupportedOperationException.  However, <i>take care</i>
  + * to not alter the underlying List of Comparators
  + * or the BitSet that defines the sort order.</p>
    * 
    * <p>Instances of ComparatorChain are not synchronized.
    * The class is not thread-safe at construction time, but
  @@ -162,15 +164,13 @@
        * sort order is used; a return value of <i>true</i>
        * indicates reverse sort order.
        * 
  -     * @param list   List of Comparators.  NOTE: This constructor performs a
  -     *               defensive copy of the list elements into a new
  -     *               List.
  +     * @param list   List of Comparators.  NOTE: This constructor does not perform a
  +     *               defensive copy of the list
        * @param bits   Sort order for each Comparator.  Extra bits are ignored,
        *               unless extra Comparators are added by another method.
        */
       public ComparatorChain(List list, BitSet bits) {
  -        comparatorChain = new ArrayList();
  -        comparatorChain.addAll(list);
  +        comparatorChain = list;
           orderingBits = bits;
       }
   
  
  
  

--
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