On Thu, 8 Aug 2024 01:48:27 GMT, Valerie Peng <valer...@openjdk.org> wrote:
>> src/java.base/share/classes/javax/crypto/KDF.java line 253: >> >>> 251: public static KDF getInstance(String algorithm, String provider) >>> 252: throws NoSuchAlgorithmException, NoSuchProviderException { >>> 253: Objects.requireNonNull(provider, "provider may not be null"); >> >> nit: may=>should? > > Same goes for other {@code Object.requireNonNull()} calls Why do the null check on {@code provider} here? For consistency sake, since both {@code algorithm} and {@code provider} are checked for non-null inside {@code getInstance(String, KDFParameters, String), you should either check both for non-null or leave it to the 3-arg getInstance() call. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1710157587