mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 22:32:07 +01:00
Merge nested if-statements
This commit is contained in:
parent
28f6664b29
commit
dd941fb293
2 changed files with 6 additions and 12 deletions
|
@ -149,11 +149,9 @@ public class KeyRingInfo {
|
|||
}
|
||||
|
||||
if (publicKey == getPublicKey()) {
|
||||
if (signatures.primaryKeyRevocation != null) {
|
||||
if (SignatureUtils.isHardRevocation(signatures.primaryKeyRevocation)) {
|
||||
if (signatures.primaryKeyRevocation != null && SignatureUtils.isHardRevocation(signatures.primaryKeyRevocation)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return signatures.primaryKeyRevocation == null;
|
||||
}
|
||||
|
||||
|
@ -825,10 +823,8 @@ public class KeyRingInfo {
|
|||
* @return encryption subkeys
|
||||
*/
|
||||
public @Nonnull List<PGPPublicKey> getEncryptionSubkeys(String userId, EncryptionPurpose purpose) {
|
||||
if (userId != null) {
|
||||
if (!isUserIdValid(userId)) {
|
||||
throw new KeyValidationException(userId, getLatestUserIdCertification(userId), getUserIdRevocation(userId));
|
||||
}
|
||||
if (userId != null && !isUserIdValid(userId)) {
|
||||
throw new KeyValidationError(userId, getLatestUserIdCertification(userId), getUserIdRevocation(userId));
|
||||
}
|
||||
|
||||
return getEncryptionSubkeys(purpose);
|
||||
|
|
|
@ -308,11 +308,9 @@ public final class SignatureUtils {
|
|||
if (issuerKeyId != null && issuerKeyId.getKeyID() != 0) {
|
||||
return issuerKeyId.getKeyID();
|
||||
}
|
||||
if (issuerKeyId == null) {
|
||||
if (fingerprint != null) {
|
||||
if (issuerKeyId == null && fingerprint != null) {
|
||||
return fingerprint.getKeyId();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue