On Fri, 20 Sep 2024 20:17:00 GMT, Kevin Driver <[email protected]> wrote:
>> src/java.base/share/classes/javax/crypto/KDF.java line 665:
>>
>>> 663:
>>> 664: private static boolean checkSpiNonNull(Delegate d) {
>>> 665: return (d != null && d.spi() != null);
>>
>> Can `d.spi() == null` ever happen?
>
> Based upon the most recent DPS refactor, it doesn't look possible any longer,
> so we could remove it. I don't see the harm in this check being present as a
> defensive-coding measure though.
If it's useless then remote it. We should be confidence in the logic. Adding
unnecessary check will only confuse readers.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20301#discussion_r1769581460