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

Roger Riggs rriggs at openjdk.java.net
Mon Mar 1 15:15:59 UTC 2021


On Mon, 1 Mar 2021 13:23:48 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

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

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.

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

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


More information about the security-dev mailing list