diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
index 1a097c1..aebbe0e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/ExportReviewNotes.java
@@ -91,27 +91,29 @@
 
   private void export(Project.NameKey project, List<ChangeNotes> notes)
       throws RestApiException, UpdateException {
-    retryHelper
-        .changeUpdate(
-            "exportReviewNotes",
-            updateFactory -> {
-              try (Repository git = gitManager.openRepository(project)) {
-                CreateReviewNotes crn = reviewNotesFactory.create(project, git);
-                crn.createNotes(notes, monitor);
-                crn.commitNotes();
-              } catch (RepositoryNotFoundException e) {
-                stderr.println("Unable to open project: " + project.get());
-              }
-              return null;
-            })
-        .listener(
-            new RetryListener() {
-              @Override
-              public <V> void onRetry(Attempt<V> attempt) {
-                monitor.update(-notes.size());
-              }
-            })
-        .call();
+    @SuppressWarnings("unused")
+    var unused =
+        retryHelper
+            .changeUpdate(
+                "exportReviewNotes",
+                updateFactory -> {
+                  try (Repository git = gitManager.openRepository(project)) {
+                    CreateReviewNotes crn = reviewNotesFactory.create(project, git);
+                    crn.createNotes(notes, monitor);
+                    crn.commitNotes();
+                  } catch (RepositoryNotFoundException e) {
+                    stderr.println("Unable to open project: " + project.get());
+                  }
+                  return null;
+                })
+            .listener(
+                new RetryListener() {
+                  @Override
+                  public <V> void onRetry(Attempt<V> attempt) {
+                    monitor.update(-notes.size());
+                  }
+                })
+            .call();
   }
 
   @Nullable
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/RefUpdateListener.java b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/RefUpdateListener.java
index 1f8826f..2b39e56 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/RefUpdateListener.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewnotes/RefUpdateListener.java
@@ -98,23 +98,25 @@
       return;
     }
     try {
-      retryHelper
-          .changeUpdate(
-              "createReviewNotes",
-              updateFactory -> {
-                Project.NameKey projectName = Project.nameKey(e.getProjectName());
-                try (Repository git = repoManager.openRepository(projectName)) {
-                  CreateReviewNotes crn = reviewNotesFactory.create(projectName, git);
-                  crn.createNotes(
-                      e.getRefName(),
-                      ObjectId.fromString(e.getOldObjectId()),
-                      ObjectId.fromString(e.getNewObjectId()),
-                      null);
-                  crn.commitNotes();
-                }
-                return null;
-              })
-          .call();
+      @SuppressWarnings("unused")
+      var unused =
+          retryHelper
+              .changeUpdate(
+                  "createReviewNotes",
+                  updateFactory -> {
+                    Project.NameKey projectName = Project.nameKey(e.getProjectName());
+                    try (Repository git = repoManager.openRepository(projectName)) {
+                      CreateReviewNotes crn = reviewNotesFactory.create(projectName, git);
+                      crn.createNotes(
+                          e.getRefName(),
+                          ObjectId.fromString(e.getOldObjectId()),
+                          ObjectId.fromString(e.getNewObjectId()),
+                          null);
+                      crn.commitNotes();
+                    }
+                    return null;
+                  })
+              .call();
     } catch (RestApiException | UpdateException x) {
       logger.atSevere().withCause(x).log("%s", x.getMessage());
     }
