NoteDbUpdateManager: Remove stageAndApplyDelta method

This method combines the stage method and applying a delta to the
NoteDbChangeState in the Change. The state in the change is only used to
store in ReviewDb, so this is no longer applicable.

The only caller is in ChangeUpdate#commit, which can just be removed, as
staging will still happen automatically during the subsequent call to
execute.

This method was the only usage of the Result class, so remove that as
well.

Change-Id: I08dbc14c801caf62c467915fef3547b744ef7bee
diff --git a/java/com/google/gerrit/server/notedb/ChangeUpdate.java b/java/com/google/gerrit/server/notedb/ChangeUpdate.java
index 468e481..837e093 100644
--- a/java/com/google/gerrit/server/notedb/ChangeUpdate.java
+++ b/java/com/google/gerrit/server/notedb/ChangeUpdate.java
@@ -267,7 +267,6 @@
   public ObjectId commit() throws IOException, OrmException {
     try (NoteDbUpdateManager updateManager = updateManagerFactory.create(getProjectName())) {
       updateManager.add(this);
-      updateManager.stageAndApplyDelta(getChange());
       updateManager.execute();
     }
     return getResult();
diff --git a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
index a9ec3bc..80e3afd 100644
--- a/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
+++ b/java/com/google/gerrit/server/notedb/NoteDbUpdateManager.java
@@ -148,19 +148,6 @@
     public abstract ImmutableList<InsertedObject> allUsersObjects();
   }
 
-  @AutoValue
-  public abstract static class Result {
-    static Result create(NoteDbUpdateManager.StagedResult staged, NoteDbChangeState newState) {
-      return new AutoValue_NoteDbUpdateManager_Result(newState, staged);
-    }
-
-    @Nullable
-    public abstract NoteDbChangeState newState();
-
-    @Nullable
-    abstract NoteDbUpdateManager.StagedResult staged();
-  }
-
   public static class OpenRepo implements AutoCloseable {
     public final Repository repo;
     public final RevWalk rw;
@@ -568,13 +555,6 @@
     }
   }
 
-  public Result stageAndApplyDelta(Change change) throws OrmException, IOException {
-    StagedResult sr = stage().get(change.getId());
-    NoteDbChangeState newState =
-        NoteDbChangeState.applyDelta(change, sr != null ? sr.delta() : null);
-    return Result.create(sr, newState);
-  }
-
   private Table<Change.Id, Account.Id, ObjectId> getDraftIds() {
     Table<Change.Id, Account.Id, ObjectId> draftIds = HashBasedTable.create();
     if (allUsersRepo == null) {