Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
This is a follow-up of a discussion held in TEXT-34.
By default, RandomStringBuilder will use a shared java.util.Random object.
I think that the decision of which generator to use lies with the code that constructs the RandomStringBuilder instance, not with code that uses it (to build a string).
It would be safer to pass the RNG instance at construction (since, anyways, the constructor must be called):
RandomStringBuilder sb = new RandomStringBuilder(new MyRandom()); String s = sb.ofLength(length).build();
In the above, the MyRandom type is the subject of TEXT-36.
Attachments
Issue Links
- supercedes
-
TEXT-34 Add class to generate random strings
- Closed