[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Updated] (MATH-1012) Reduce code duplication in "RandomDataGenerator"
From:       "Gilles (JIRA)" <jira () apache ! org>
Date:       2013-07-31 22:17:48
Message-ID: JIRA.12661002.1375308198251.147752.1375309068480 () arcas
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/MATH-1012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Gilles updated MATH-1012:
-------------------------

    Attachment: MATH-1012.patch

The attached patch would allow to remove some duplicated code.

In summary, a new "RandomUtils" utility class provides a factory method to wrap a \
"java.util.Random" (which is the parent class of "java.security.SecureRandom") into a \
CM's "RandomGenerator". Then, in "RandomDataGenerator", only one method (that takes a \
"RandomGenerator" parameter) is necessary.

The patch passes all the "RandomDataGenerator" unit tests with no change and affects \
only private methods (backwards-compatible).

                
> Reduce code duplication in "RandomDataGenerator"
> ------------------------------------------------
> 
> Key: MATH-1012
> URL: https://issues.apache.org/jira/browse/MATH-1012
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 3.2
> Reporter: Gilles
> Assignee: Gilles
> Priority: Trivial
> Labels: cleanup
> Fix For: 3.3
> 
> Attachments: MATH-1012.patch
> 
> 
> Some duplication exists in "o.a.c.m.random.RandomDataGenerator".
> That partly arises from having a method that requires a \
> "o.a.c.m.random.RandomGenerator" parameter vs a similar method but with a \
> "java.security.SecureRandom" parameter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic