Bug 61358 - Replace deprecated RandomStringUtils by commons-text RandomStringGenerator
Summary: Replace deprecated RandomStringUtils by commons-text RandomStringGenerator
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.2
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-29 14:17 UTC by Philippe Mouawad
Modified: 2017-09-05 20:13 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2017-07-29 14:17:54 UTC
RandomStringUtils is deprecated since commons-lang3-3.6
Comment 1 Philippe Mouawad 2017-09-02 21:29:38 UTC
Hello,

Not sure it's a good idea for now.
My understanding is that it may incur additional objects creation for builders particularly for RandomString from a set of chars.

Recoded as of commons-text-1.1, it would be something like:
final String lcharsToUse = charsToUse;
myValue = new RandomStringGenerator.Builder()
                    .filteredBy(c -> lcharsToUse.indexOf(c) >= 0)
                    .build().generate(length);

Version 1.2 has a selectFrom() 

But anyway, AFAIU this consumes more objects than RandomStringUtils.

Am I wrong ?
Comment 2 Philippe Mouawad 2017-09-03 15:22:50 UTC
Maybe wait for next versions of commons-text:

- http://markmail.org/message/azxw4nai7fs2laas