You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2024/07/19 13:13:00 UTC
[jira] [Comment Edited] (LANG-1745) RandomStringUtils.random() with a negative character index should throw IllegalArgumentException
[ https://issues.apache.org/jira/browse/LANG-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17867324#comment-17867324 ]
Gary D. Gregory edited comment on LANG-1745 at 7/19/24 1:12 PM:
----------------------------------------------------------------
[~sustech-whl]
Thank you for your report. Fixed in git master, please test your use case with a local build or a snapshot build from our snapshot repository [https://repository.apache.org/content/repositories/snapshots/]
If your use case, works, please code this ticket.
was (Author: garydgregory):
[~sustech-whl]
Thank you for your report. Fixed in git master, please test your use case with a local build or a snapshot build from our snapshot repository https://repository.apache.org/content/repositories/snapshots/
> RandomStringUtils.random() with a negative character index should throw IllegalArgumentException
> ------------------------------------------------------------------------------------------------
>
> Key: LANG-1745
> URL: https://issues.apache.org/jira/browse/LANG-1745
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.14.0
> Environment: jdk18
> Reporter: Wang Hailong
> Assignee: Gary D. Gregory
> Priority: Major
> Fix For: 3.16.0
>
>
> when RandomStringUtils.random encounters negative index it just keep running all the time(like meeting a dead loop?), hope to raise an exception
> the test code is :
> {color:#bbb529}@Test
> {color}{color:#cc7832}public void {color}{color:#ffc66d}testNegativeRange{color}() {
> {color:#cc7832}int {color}start = Integer.{color:#9876aa}MIN_VALUE{color}{color:#cc7832};
> {color}{color:#cc7832} int {color}end = -{color:#6897bb}10{color}{color:#cc7832};
> {color}{color:#cc7832}
> {color}{color:#cc7832} {color}{color:#808080}// Generate a random character with negative range parameters
> {color}{color:#808080} {color}String result = RandomStringUtils.random({color:#6897bb}1{color}{color:#cc7832}, {color}start{color:#cc7832}, {color}end{color:#cc7832}, false, false, null{color}){color:#cc7832};
> {color}{color:#cc7832}
> {color}}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)