Clone the passed in array

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@884490 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-11-26 10:29:33 +00:00
parent 0abdedcd16
commit b1ac38cb1b
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,8 @@ package org.apache.commons.lang.text.translate;
import java.io.IOException;
import java.io.Writer;
import org.apache.commons.lang.ArrayUtils;
/**
* Executes a sequence of translators one after the other. Execution ends whenever
* the first translator consumes codepoints from the input.
@ -36,8 +38,7 @@ public class AggregateTranslator extends CharSequenceTranslator {
* @param translators CharSequenceTranslator array to aggregate
*/
public AggregateTranslator(CharSequenceTranslator... translators) {
// TODO - copy array to prevent subsequent external changes
this.translators = translators;
this.translators = ArrayUtils.clone(translators);
}
/**