Move more functionality from elsewhere into ApprovalsUtil

The commonality of these methods is they will have a different
implementation when approvals are read from an eventual notedb, so
it makes sense to keep them located together.

Change-Id: I5de63a4210f29863274111964480fb1f5720ca60
This commit is contained in:
Dave Borowitz
2013-12-18 13:12:44 -08:00
parent ab33191c2e
commit b5b6f615ec
12 changed files with 91 additions and 72 deletions

View File

@@ -27,6 +27,7 @@ import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.PatchSetApproval;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.ApprovalsUtil;
import com.google.gerrit.server.account.AccountInfo;
import com.google.gerrit.server.git.LabelNormalizer;
import com.google.gerrit.server.project.ChangeControl;
@@ -76,7 +77,7 @@ public class ReviewerJson {
PatchSet.Id psId = ctl.getChange().currentPatchSetId();
if (approvals == null) {
approvals = ChangeData.sortApprovals(db.get().patchSetApprovals()
approvals = ApprovalsUtil.sortApprovals(db.get().patchSetApprovals()
.byPatchSetUser(psId, out._id));
}
approvals = labelNormalizer.normalize(ctl, approvals);