[
https://issues.apache.org/jira/browse/LANG-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Yandell closed LANG-902.
------------------------------
Resolution: Fixed
Fix Version/s: 3.2
Clarified in the documentation (changed to 'may'). Thanks for pointing that out.
> RandomStringUtils.random (count, letters=true, number=true) may not use
> numerics
> --------------------------------------------------------------------------------
>
> Key: LANG-902
> URL: https://issues.apache.org/jira/browse/LANG-902
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.1
> Reporter: Andrzej Winnicki
> Priority: Minor
> Labels: random
> Fix For: 3.2
>
>
> Either there is a bug in an implementation or misunderstanding in docs.
> RandomStringUtils.random (count, letters, numbers) is documented so that:
> letters if true, generated string *will* include alphabetic characters
> numbers if true, generated string *will* include numeric characters
> But apparently the current implementation supports only that generated string
> *may* include either only letters, only numbers or both.
> This is current implementation:
> if (letters && Character.isLetter(ch) || numbers && Character.isDigit(ch) ||
> !letters && !numbers)
> So there may be situation when generated string is not containing numbers at
> all which is in contrary with what the docs say.
--
This message was sent by Atlassian JIRA
(v6.1#6144)