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

Rostislav Krasny commented on MATH-1304:
----------------------------------------

One note about making the code of {{nextBytes()}} reusable. When I thought 
about that {{BitsStreamGenerator}} could extend {{AbstractRandomGenerator}} I 
realized it can introduce a compatibility issue. If one uses {{instanceof}} to 
distinguish between classes inherited from current {{BitsStreamGenerator}} and 
{{AbstractRandomGenerator}} his/her code may stop doing it correctly after such 
change. So if you decide to have only one code nextBytes() used by both 
{{BitsStreamGenerator}} and {{AbstractRandomGenerator}} you need to do it in a 
new super class of them.

But this is just a note. I'm fine with your decision to just copy it between 
those two classes. I'm not fine with the code itself, but this is another story 
:-)

> "nextBytes" methods in RNG implementations
> ------------------------------------------
>
>                 Key: MATH-1304
>                 URL: https://issues.apache.org/jira/browse/MATH-1304
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.5
>            Reporter: Gilles
>            Assignee: Gilles
>             Fix For: 4.0
>
>
> There are two implementations of the "nextBytes" method.
> One is in {{AbstractRandomGenerator}} and the other in 
> {{BitsStreamGenerator}}.
> The code should be the same.
> And, if possible, it should be shared.
> MATH-1300 has several suggestions for improving the current implementations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to