commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1341) "RandomDataGenerator" is brittle
Date Fri, 20 May 2016 13:35:12 GMT

    [ https://issues.apache.org/jira/browse/MATH-1341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15293376#comment-15293376
] 

Gilles commented on MATH-1341:
------------------------------

Class {{RandomDataGenerator}} removed in branch "task-MATH-1366".

> "RandomDataGenerator" is brittle
> --------------------------------
>
>                 Key: MATH-1341
>                 URL: https://issues.apache.org/jira/browse/MATH-1341
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Gilles
>            Priority: Minor
>              Labels: API, cleanup, deprecation, thread-safety
>             Fix For: 4.0
>
>         Attachments: RandomUtils.java
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message