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.
------------- Commit messages: - add null and update syntax Changes: https://git.openjdk.org/jdk/pull/25533/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25533&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8358076 Stats: 200 lines in 4 files changed: 51 ins; 20 del; 129 mod Patch: https://git.openjdk.org/jdk/pull/25533.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25533/head:pull/25533 PR: https://git.openjdk.org/jdk/pull/25533