mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8289274: Cleanup unnecessary null comparison before instanceof check in security modules
Reviewed-by: mullan
This commit is contained in:
parent
81ee7d28f8
commit
87aa3ce03e
14 changed files with 54 additions and 94 deletions
|
@ -915,9 +915,8 @@ final class P11KeyStore extends KeyStoreSpi {
|
|||
|
||||
token.ensureValid();
|
||||
|
||||
if (protParam != null &&
|
||||
protParam instanceof KeyStore.PasswordProtection &&
|
||||
((KeyStore.PasswordProtection)protParam).getPassword() != null &&
|
||||
if (protParam instanceof PasswordProtection pp &&
|
||||
pp.getPassword() != null &&
|
||||
!token.config.getKeyStoreCompatibilityMode()) {
|
||||
throw new KeyStoreException("ProtectionParameter must be null");
|
||||
}
|
||||
|
@ -1018,9 +1017,8 @@ final class P11KeyStore extends KeyStoreSpi {
|
|||
token.ensureValid();
|
||||
checkWrite();
|
||||
|
||||
if (protParam != null &&
|
||||
protParam instanceof KeyStore.PasswordProtection &&
|
||||
((KeyStore.PasswordProtection)protParam).getPassword() != null &&
|
||||
if (protParam instanceof PasswordProtection pp &&
|
||||
pp.getPassword() != null &&
|
||||
!token.config.getKeyStoreCompatibilityMode()) {
|
||||
throw new KeyStoreException(new UnsupportedOperationException
|
||||
("ProtectionParameter must be null"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue