[
https://issues.apache.org/jira/browse/TEXT-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061745#comment-16061745
]
Gilles commented on TEXT-93:
----------------------------
Code
[here|https://github.com/apache/commons-text/pull/54/commits/c1aabc0172e86f4f28a0444afebda335d144b039]
looks suspicious:
# It seems that the argument of the method is modified, not the instance
variable
# There are unnecessary conversion from {{Character}} to {{char}} and back
How about something like
{code}
public Builder selectFrom(Collection<Character> list) {
characterList = new ArrayList<Character>();
characterList.addAll(list);
return this;
}
{code}
?
> RandomStringGenerator accepts a list of valid characters
> --------------------------------------------------------
>
> Key: TEXT-93
> URL: https://issues.apache.org/jira/browse/TEXT-93
> Project: Commons Text
> Issue Type: Wish
> Reporter: Wilson MacGyver
>
> implement a "selectFrom" feature:
> RandomStringGenerator gen = new RandomStringGenerator.Builder()
> .selectFrom(charArray)
> .build();
> so we can pass a list of valid characters
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)