commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r884490 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java
Date Thu, 26 Nov 2009 10:29:34 GMT
Author: bayard
Date: Thu Nov 26 10:29:33 2009
New Revision: 884490

URL: http://svn.apache.org/viewvc?rev=884490&view=rev
Log:
Clone the passed in array

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java?rev=884490&r1=884489&r2=884490&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/AggregateTranslator.java
Thu Nov 26 10:29:33 2009
@@ -19,6 +19,8 @@
 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 @@
      * @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);
     }
 
     /**



Mime
View raw message