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 Fri, 01 Mar 2002 23:48:59 GMT
morgand     02/03/01 15:48:59

  Modified:    collections/src/java/org/apache/commons/collections/comparators
                        ComparatorChain.java
  Log:
  changed List, BitSet constructor to perform a defensive copy into a
  new List
  
  Revision  Changes    Path
  1.3       +8 -10     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComparatorChain.java	1 Mar 2002 23:40:43 -0000	1.2
  +++ ComparatorChain.java	1 Mar 2002 23:48:59 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v
1.2 2002/03/01 23:40:43 morgand Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/01 23:40:43 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/comparators/ComparatorChain.java,v
1.3 2002/03/01 23:48:59 morgand Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/03/01 23:48:59 $
    *
    * ====================================================================
    *
  @@ -125,16 +125,14 @@
   
       /**
        * 
  -     * @param list   WARNING: If this list is not modifiable, some
  -     *               subsequent modifications
  -     *               to the ComparatorChain can fail.  Also, if you intend
  -     *               to serialize
  -     *               this ComparatorChain, then this List must also
  -     *               be Serializable.
  +     * @param list   NOTE: This constructor performs a defensive
  +     *                     copy of the list elements into a new
  +     *                     List. 
        * @param bits
        */
       public ComparatorChain(List list, BitSet bits) {
  -        comparatorChain = list;
  +        comparatorChain = new ArrayList();
  +        comparatorChain.addAll(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