RFR: JDK-8283084 RandomGenerator nextDouble(double, double) is documented incorrectly [v2]

Brian Burkhalter bpb at openjdk.java.net
Mon Apr 11 17:08:40 UTC 2022


On Mon, 11 Apr 2022 12:32:26 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> `default float nextFloat(float origin, float bound); ` and `default double nextDouble(double origin, double bound); ` are documented incorrectly. The default method checks (origin < bound) and (bound - origin) < +infinity. 
>> 
>> The exception conditions are incorrect: 
>> "if {@code origin} is not finite, 
>>  or {@code bound} is not finite, or {@code origin} 
>>  is greater than or equal to {@code bound}" 
>> 
>> This is not true. Calling with -Double.MAX_VALUE and Double.MAX_VALUE satisfies the documented requirements but actually throws an exception.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add between

Marked as reviewed by bpb (Reviewer).

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

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


More information about the core-libs-dev mailing list