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

Jim Laskey jlaskey at openjdk.java.net
Wed Nov 25 19:21:02 UTC 2020


On Wed, 25 Nov 2020 13:54:47 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:

>> 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)

removed

> 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 ?

agree

> 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

agree

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

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


More information about the security-dev mailing list