[jdk17] RFR: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes [v2]

Jim Laskey jlaskey at openjdk.java.net
Tue Jun 29 17:39:07 UTC 2021


On Mon, 28 Jun 2021 19:07:09 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Not averaging
>
> src/java.base/share/classes/java/util/random/RandomGenerator.java line 644:
> 
>> 642:      *
>> 643:      * @implSpec The default implementation checks that {@code bound} is a
>> 644:      * positive int. Then invokes {@code nextInt()}, limiting the result to
> 
> I think if you are refering to the Java type it should be in {@ code xxx }.
> "int" - > {@ code int}.  Or use "integer".
> Ditto "ints", "long", and "longs" in the overridden methods below.

Updated

> src/java.base/share/classes/java/util/random/RandomGenerator.java line 674:
> 
>> 672:      * If {@code bound} is a power of two then limiting is a simple masking
>> 673:      * operation. Otherwise, the result is re-calculated  by invoking
>> 674:      * {@code nextInt()} until the result is greater equal {@code origin}
> 
> greater equal -> greater than or equal
> and in the overloads below (and above)

Updated

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

PR: https://git.openjdk.java.net/jdk17/pull/151


More information about the core-libs-dev mailing list