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

Alex Herbert commented on RNG-143:
----------------------------------

OK. I'll put this into a PR that removes use of the static factory method from 
the codebase and deprecate it. This will be mainly a lot of updates to test 
classes that create RNGs for tests.

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

Reply via email to