You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Alex Herbert (Jira)" <ji...@apache.org> on 2021/06/09 16:53:00 UTC
[jira] [Resolved] (RNG-143) Instance create() method for
RandomSource
[ https://issues.apache.org/jira/browse/RNG-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Herbert resolved RNG-143.
------------------------------
Fix Version/s: 1.4
Resolution: Implemented
Merged in commit: 3daa231754f9866efc89a91a7988dac8691f60d6
> Instance create() method for RandomSource
> -----------------------------------------
>
> Key: RNG-143
> URL: https://issues.apache.org/jira/browse/RNG-143
> Project: Commons RNG
> Issue Type: New Feature
> Components: simple
> Affects Versions: 1.3
> Reporter: Alex Herbert
> Priority: Trivial
> Fix For: 1.4
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> This is a wish for an instance {{create}} method for RandomSource:
> {code:java}
> public RestorableUniformRandomProvider create() {
> return create(this);
> }
> public RestorableUniformRandomProvider create(Object seed,
> Object... data) {
> return create(this, seed, data);
> }
> {code}
> It is syntactic sugar to avoid typing the use of the static factory method and repeating {{RandomSource}} in close succession:
> {code:java}
> RandomSource.create(RandomSource.MT);
> RandomSource.create(RandomSource.MT, 12345L);
> {code}
> Becomes:
> {code:java}
> RandomSource.MT.create();
> RandomSource.MT.create(12345L);
> {code}
> It would make the use of the static factory method redundant, which could be deprecated.
> Opinions on this?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)