Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BE43E104F8 for ; Wed, 31 Jul 2013 22:17:48 +0000 (UTC) Received: (qmail 51045 invoked by uid 500); 31 Jul 2013 22:17:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50940 invoked by uid 500); 31 Jul 2013 22:17:48 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 50931 invoked by uid 99); 31 Jul 2013 22:17:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 22:17:48 +0000 Date: Wed, 31 Jul 2013 22:17:48 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MATH-1012) Reduce code duplication in "RandomDataGenerator" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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