commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Updated] (MATH-1012) Reduce code duplication in "RandomDataGenerator"
Date Wed, 31 Jul 2013 22:17:48 GMT


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 "") 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:
>             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 "" 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:

View raw message