[ https://issues.apache.org/jira/browse/LANG-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pascal Schumacher closed LANG-808. ---------------------------------- Resolution: Won't Fix Assignee: Pascal Schumacher Fix Version/s: (was: Patch Needed) RandomStringUtils will be deprecated in commons-lang 3.6 in favor of RandomStringGenerator from commons-text. Please use [RandomStringGenerator|https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/RandomStringGenerator.html] instead. > RandomStringUtils inefficient init of start and end for letters and numbers; > misleading Javadoc > ----------------------------------------------------------------------------------------------- > > Key: LANG-808 > URL: https://issues.apache.org/jira/browse/LANG-808 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 2.6, 3.1 > Reporter: Sebb > Assignee: Pascal Schumacher > > If either letters or numbers is true, RandomStringUtils(count, 0, 0, letters, > numbers, ...) sets the default start index to space, intending to support the > set of printable characters (according to the Javadoc). > However, the code later uses Character.isLetter and Character.isDigit, which > exclude space and some other printable characters. > There is currently no direct support for generating printable characters; > this would probably require another flag. > The current Javadoc is misleading, and the current code is inefficient > because some characters cannot currently be used. > The lowest char which is either digit or letter is '0' (zero). > The lowest char which is a letter is 'A' (upper case a). > The Javadoc for the randomNumeric(int) method says: > bq. Characters will be chosen from the set of numeric characters. > This does not make clear that the numerics are restricted to the ASCII set > (because of the way start=end=0 is handled). > Similarly for randomAlphabetic and randomAlphanumeric. > Is it the intention that randomAlphabetic etc. be restricted to ASCII? -- This message was sent by Atlassian JIRA (v6.3.15#6346)