On Sat, 29 Jan 2022 16:13:46 GMT, Yasser Bazzi <d...@openjdk.java.net> wrote:

>> Hi, could i get a review on this implementation proposed by Stuart Marks, i 
>> decided to use the 
>> https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html
>>  interface to create the default method `asRandom()` that wraps around the 
>> newer algorithms to be used on classes that do not accept the new interface.
>> 
>> Some things to note as proposed by the bug report, the protected method 
>> next(int bits) is not overrided and setSeed() method if left blank up to 
>> discussion on what to do with it.
>> 
>> Small test done on 
>> https://gist.github.com/YShow/da678561419cda8e32fccf3a27a649d4
>
> Yasser Bazzi has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - fix missing periods
>  - Use final on initialized variable

I think pushing more commits into the same PR should be fine. It's basically 
moving the same code into a different place and making some minor adjustments.

(While we're on that topic, the wrapper might be better expressed as a nested 
class of j.u.Random. It might also be an opportunity to call a new constructor 
that avoids the hack workaround for setSeed.)

-------------

PR: https://git.openjdk.java.net/jdk/pull/7001

Reply via email to