mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-27 13:28:00 +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,10 +149,8 @@ public class KeyRingInfo {
|
|||
}
|
||||
|
||||
if (publicKey == getPublicKey()) {
|
||||
if (signatures.primaryKeyRevocation != null) {
|
||||
if (SignatureUtils.isHardRevocation(signatures.primaryKeyRevocation)) {
|
||||
return false;
|
||||
}
|
||||
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,10 +308,8 @@ public final class SignatureUtils {
|
|||
if (issuerKeyId != null && issuerKeyId.getKeyID() != 0) {
|
||||
return issuerKeyId.getKeyID();
|
||||
}
|
||||
if (issuerKeyId == null) {
|
||||
if (fingerprint != null) {
|
||||
return fingerprint.getKeyId();
|
||||
}
|
||||
if (issuerKeyId == null && fingerprint != null) {
|
||||
return fingerprint.getKeyId();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue