On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey <jlas...@openjdk.org> wrote:

>> 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 incrementally with one additional 
> commit since the last revision:
> 
>   8248862: Implement Enhanced Pseudo-Random Number Generators
>   
>   Changes to RandomGeneratorFactory requested by @PaulSandoz

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
235:

> 233:             throws IllegalArgumentException {
> 234:         Map<String, Provider<? extends RandomGenerator>> fm = 
> getFactoryMap();
> 235:         Provider<? extends RandomGenerator> provider = 
> fm.get(name.toUpperCase());

again use of toUpperCase() instead of toUpperCase(Locale)

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
250:

> 248:      * @return Stream of matching Providers.
> 249:      */
> 250:     static <T extends RandomGenerator> Stream<RandomGeneratorFactory<T>> 
> all(Class<? extends RandomGenerator> category) {

this signature is weird, T is not used in the parameter, so in case return any 
type of Stream<RandomGeneratorFactory<T>> from a type POV, should it be
` <T extends RandomGenerator> Stream<RandomGeneratorFactory<T>> all(Class<? 
extends T> category)` instead ?

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
269:

> 267:      * @throws IllegalArgumentException when either the name or category 
> is null
> 268:      */
> 269:     static <T> T of(String name, Class<? extends RandomGenerator> 
> category)

Same issue as above, T is not used as a constraint

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
288:

> 286:      * @throws IllegalArgumentException when either the name or category 
> is null
> 287:      */
> 288:     static <T extends RandomGenerator> RandomGeneratorFactory<T> 
> factoryOf(String name, Class<? extends RandomGenerator> category)

Same as above

src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java line 
300:

> 298:      */
> 299:     @SuppressWarnings("unchecked")
> 300:     private void getConstructors(Class<? extends RandomGenerator> 
> randomGeneratorClass) {

method name get but do side effects

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

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

Reply via email to