Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Class RandomDataGenerator can easily be misused as it advertizes a method to access its internal RNG (which is not thread-safe).
The class is also a mixed bag of "data generators" that are either "secure" or not.
Moreover it uses the "lazy initialization" pattern (for the RNG instance) solely because of this duality; otherwise users that need one or the other form of data generation will obviously always use the RNG since all data generation methods need it.
This entails also a performance hit (albeit tiny) as each call checks whether the RNG has been initialized already.
The clean solution would be to separate the two types of data generation (secure vs not) into different classes.
Attachments
Attachments
Issue Links
- is related to
-
MATH-1319 Refactor the package "o.a.c.m.random"
- Resolved