Ignore createBranch result explicitly to satisfy CheckReturnValue The createBranch REST API now carries a @CheckReturnValue contract, so ignoring its Response fails the errorprone build. Assign it to an unused variable to make the intent explicit; the backup ref creation behaviour is unchanged. Change-Id: I089c879ca4893712b69985b749267d6e14691a48
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java index d05eeaa..91336b0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java +++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
@@ -165,7 +165,8 @@ ObjectId.toString(revWalk.parseCommit(ObjectId.fromString(refUpdate.oldRev)).getId()); try { - createBranch.apply(project, IdString.fromDecoded(backupRef), input); + @SuppressWarnings("unused") + var unused = createBranch.apply(project, IdString.fromDecoded(backupRef), input); } catch (BadRequestException | AuthException | ResourceConflictException