8289274: Cleanup unnecessary null comparison before instanceof check in security modules

Reviewed-by: mullan
This commit is contained in:
Andrey Turbanov 2022-07-09 17:59:43 +00:00
parent 81ee7d28f8
commit 87aa3ce03e
14 changed files with 54 additions and 94 deletions

View file

@ -86,9 +86,8 @@ public sealed class RC2Cipher extends CipherSpi
protected void engineInit(int opmode, Key key,
AlgorithmParameterSpec params, SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException {
if (params != null && params instanceof RC2ParameterSpec) {
embeddedCipher.initEffectiveKeyBits
(((RC2ParameterSpec)params).getEffectiveKeyBits());
if (params instanceof RC2ParameterSpec rc2Spec) {
embeddedCipher.initEffectiveKeyBits(rc2Spec.getEffectiveKeyBits());
} else {
embeddedCipher.initEffectiveKeyBits(0);
}