[ 
https://issues.apache.org/jira/browse/TEXT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16028771#comment-16028771
 ] 

Duncan Jones commented on TEXT-84:
----------------------------------

bq. WDYT?

I suppose you could run some tests to prove your assumptions around performance?

Supposing it existed, how would you propose to use ThreadLocalRandom with 
RandomStringGenerator? 

bq. Is there a value in "conditional immutability"?

In the Pair example, I could imagine some limited usefulness (perhaps when 
composing Pairs into another object). Less so with RandomStringGenerator. 

> RandomStringGenerator claims to be immutable, but isn't
> -------------------------------------------------------
>
>                 Key: TEXT-84
>                 URL: https://issues.apache.org/jira/browse/TEXT-84
>             Project: Commons Text
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Duncan Jones
>
> {{RandomStringGenerator}} claims to be immutable in the Javadocs, however it 
> accepts a {{TextRandomProvider}} object through the builder pattern. This 
> object may altered by external code, thus breaking the immutability claim of 
> our generator.
> A possible solution is to adjust the documentation for {{TextRandomProvider}} 
> and require implementations to be immutable. Alternatively, we can relax the 
> documentation in {{RandomStringGenerator}} to remove the immutability claim 
> or state that the mutability is linked to the mutability of the random source 
> (when provided).
> I think we will have to do the latter, since the former would forbid callers 
> from supplying a {{UniformRandomProvider}} instance as suggested in the 
> documentation. Thoughts welcome.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to