Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v25]

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v25]

Jim Laskey-3
> This PR is to introduce a new random number API for the JDK. The primary API is found in RandomGenerator and RandomGeneratorFactory. Further description can be found in the JEP https://openjdk.java.net/jeps/356 .
>
> javadoc can be found at http://cr.openjdk.java.net/~jlaskey/prng/doc/api/java.base/java/util/random/package-summary.html
>
> old PR:  https://github.com/openjdk/jdk/pull/1273

Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits:

 - Merge branch 'master' into 8248862
 - Adjust ThreadLocalRandom javadoc inheritence
 - L32X64StarStarRandom -> L32X64MixRandom
 - Various corrects
 - Revised javadoc per CSR reviews
 - Remove tabs from random/package-info.java
 - Correct copyright notice.
 - Merge branch 'master' into 8248862
 - Update tests for RandomGeneratorFactory.all()
 - Merge branch 'master' into 8248862
 - ... and 47 more: https://git.openjdk.java.net/jdk/compare/0257caad...b9094279

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

Changes: https://git.openjdk.java.net/jdk/pull/1292/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1292&range=24
  Stats: 13693 lines in 26 files changed: 11542 ins; 2066 del; 85 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1292.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1292/head:pull/1292

PR: https://git.openjdk.java.net/jdk/pull/1292
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v25]

Jim Laskey-3
On Fri, 26 Feb 2021 19:30:09 GMT, Roger Riggs <[hidden email]> wrote:

>> Jim Laskey has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 57 commits:
>>
>>  - Merge branch 'master' into 8248862
>>  - Adjust ThreadLocalRandom javadoc inheritence
>>  - L32X64StarStarRandom -> L32X64MixRandom
>>  - Various corrects
>>  - Revised javadoc per CSR reviews
>>  - Remove tabs from random/package-info.java
>>  - Correct copyright notice.
>>  - Merge branch 'master' into 8248862
>>  - Update tests for RandomGeneratorFactory.all()
>>  - Merge branch 'master' into 8248862
>>  - ... and 47 more: https://git.openjdk.java.net/jdk/compare/0257caad...b9094279
>
> src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 232:
>
>> 230:         Provider<? extends RandomGenerator> provider = fm.get(name);
>> 231:         if (!isSubclass(category, provider)) {
>> 232:             throw new IllegalArgumentException(name + " is an unknown random number generator");
>
> The message is a bit vague. How about:
>
> "The random number generator does not support the category"

throw new IllegalArgumentException("The random number generator "" + name + "" can not be located");

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

PR: https://git.openjdk.java.net/jdk/pull/1292
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v25]

Jim Laskey-3
On Mon, 1 Mar 2021 15:12:46 GMT, Roger Riggs <[hidden email]> wrote:

>> throw new IllegalArgumentException("The random number generator "" + name + "" can not be located");
>
> The message only captures the failure if the result of `fm.get()` is null.
> It does not capture the failure if the name is found but does not support the category.

if (provider == null) {
            throw new IllegalArgumentException("No implementation of the random number generator algorithm "" +
                                                name +
                                                "" is available");
        } else if (!isSubclass(category, provider)) {
            throw new IllegalArgumentException("The random number generator algorithm "" +
                                                name +
                                                "" is not implemented with the interface "" +
                                                category.simpleName() +
                                                """);
        }

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

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