commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [3/8] [text] made a defensive copy of argument passed
Date Thu, 29 Jun 2017 02:11:43 GMT
made a defensive copy of argument passed


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/c1aabc01
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/c1aabc01
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/c1aabc01

Branch: refs/heads/master
Commit: c1aabc0172e86f4f28a0444afebda335d144b039
Parents: 278f1e0
Author: Amey Jadiye <ameyjadiye@gmail.com>
Authored: Fri Jun 23 11:10:17 2017 +0530
Committer: Amey Jadiye <ameyjadiye@gmail.com>
Committed: Fri Jun 23 11:10:17 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/commons/text/RandomStringGenerator.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/c1aabc01/src/main/java/org/apache/commons/text/RandomStringGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/RandomStringGenerator.java b/src/main/java/org/apache/commons/text/RandomStringGenerator.java
index d3d8567..358d342 100644
--- a/src/main/java/org/apache/commons/text/RandomStringGenerator.java
+++ b/src/main/java/org/apache/commons/text/RandomStringGenerator.java
@@ -410,7 +410,10 @@ public final class RandomStringGenerator {
          * @return {@code this}, to allow method chaining
          */
         public Builder selectFromList(List<Character> characterList) {
-            this.characterList = characterList;
+            characterList = new ArrayList<Character>();
+            for (char c : characterList) {
+                characterList.add(c);
+            }
             return this;
         }
 


Mime
View raw message