List constructors for ComparatorChain no longer perform defensive copies

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130676 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Morgan James Delagrange 2002-03-25 21:20:53 +00:00
parent 80ea89fd05
commit 59a50d1b9b
1 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/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 $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/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.5 $ * $Revision: 1.6 $
* $Date: 2002/03/19 22:25:51 $ * $Date: 2002/03/25 21:20:53 $
* *
* ==================================================================== * ====================================================================
* *
@ -85,7 +85,9 @@ import java.util.List;
* <p>Calling a method that adds new Comparators or * <p>Calling a method that adds new Comparators or
* changes the ascend/descend sort <i>after compare(Object, * changes the ascend/descend sort <i>after compare(Object,
* Object) has been called</i> will result in an * 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. * <p>Instances of ComparatorChain are not synchronized.
* The class is not thread-safe at construction time, but * The class is not thread-safe at construction time, but
@ -162,15 +164,13 @@ public class ComparatorChain implements Comparator,Serializable {
* sort order is used; a return value of <i>true</i> * sort order is used; a return value of <i>true</i>
* indicates reverse sort order. * indicates reverse sort order.
* *
* @param list List of Comparators. NOTE: This constructor performs a * @param list List of Comparators. NOTE: This constructor does not perform a
* defensive copy of the list elements into a new * defensive copy of the list
* List.
* @param bits Sort order for each Comparator. Extra bits are ignored, * @param bits Sort order for each Comparator. Extra bits are ignored,
* unless extra Comparators are added by another method. * unless extra Comparators are added by another method.
*/ */
public ComparatorChain(List list, BitSet bits) { public ComparatorChain(List list, BitSet bits) {
comparatorChain = new ArrayList(); comparatorChain = list;
comparatorChain.addAll(list);
orderingBits = bits; orderingBits = bits;
} }