diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPick.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPick.java index e5a4d0f18b..18d2fc13c7 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPick.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/CherryPick.java @@ -66,9 +66,7 @@ public class CherryPick throw new BadRequestException("destination must be non-empty"); } - @SuppressWarnings("resource") - ReviewDb db = dbProvider.get(); - if (!control.isVisible(db)) { + if (!control.isVisible(dbProvider.get())) { throw new AuthException("Cherry pick not permitted"); }