On Thu, 29 May 2025 22:38:41 GMT, Anthony Scarpino <ascarp...@openjdk.org> 
wrote:

> I need a code review to throw `InvalidKeySpecException` when null is passed 
> with `generatePublic()` and `generatePrivate()`.  This change takes the 
> opportunity to modernize the KeyFactory code by using `switch` syntax for 
> `instanceof` checking, as well as, keeping the previous design of the 
> implementation method handling the null case.  There are existing JCK test 
> cover this case, so no regression test is added.

src/java.base/share/classes/sun/security/ec/ECKeyFactory.java line 223:

> 221:             }
> 222:             case null -> throw new InvalidKeySpecException(
> 223:                 "keySpec most not be null");

`s/most/must/`. Add every other `case null` in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25533#discussion_r2114892682

Reply via email to