Enable and fix 'Statement unnecessarily nested within else clause' warnings
Change-Id: Ida6df4593fc2ab3c11581309b2b4a638229ea093
This commit is contained in:
@@ -139,9 +139,8 @@ public class GerritPublicKeyChecker extends PublicKeyChecker {
|
||||
try {
|
||||
if (depth == 0 && expectedUser != null) {
|
||||
return checkIdsForExpectedUser(key);
|
||||
} else {
|
||||
return checkIdsForArbitraryUser(key);
|
||||
}
|
||||
return checkIdsForArbitraryUser(key);
|
||||
} catch (PGPException | OrmException e) {
|
||||
String msg = "Error checking user IDs for key";
|
||||
log.warn(msg + " " + keyIdToString(key.getKeyID()), e);
|
||||
|
||||
@@ -88,10 +88,9 @@ public class SignedPushPreReceiveHook implements PreReceiveHook {
|
||||
// key is not ultimately trusted. Assume anyone with Submit permission to
|
||||
// the branch is able to verify during review that the code is legitimate.
|
||||
return result.isOk();
|
||||
} else {
|
||||
// Directly updating one or more refs: require a trusted key.
|
||||
return result.isTrusted();
|
||||
}
|
||||
// Directly updating one or more refs: require a trusted key.
|
||||
return result.isTrusted();
|
||||
}
|
||||
|
||||
private static boolean onlyMagicBranches(Iterable<ReceiveCommand> commands) {
|
||||
|
||||
Reference in New Issue
Block a user