ChangeData: get reviewers from notes when applicable

Change-Id: I33253a5f7ac32045e5a7e5ff28cf4087dd7ffbcf
This commit is contained in:
Dave Borowitz 2014-01-21 16:45:06 -08:00
parent e759cd16ab
commit cec9b3b959
2 changed files with 11 additions and 2 deletions

View File

@ -124,7 +124,16 @@ public class ApprovalsUtil {
* exactly once in {@link SetMultimap#values()}, and
* {@link ReviewerState#REMOVED} is not present.
*/
public static ImmutableSetMultimap<ReviewerState, Account.Id> getReviewers(
public ImmutableSetMultimap<ReviewerState, Account.Id> getReviewers(
ChangeNotes notes, Iterable<PatchSetApproval> allApprovals)
throws OrmException {
if (!migration.readPatchSetApprovals()) {
return getReviewers(allApprovals);
}
return notes.load().getReviewers();
}
private static ImmutableSetMultimap<ReviewerState, Account.Id> getReviewers(
Iterable<PatchSetApproval> allApprovals) {
PatchSetApproval first = null;
SetMultimap<ReviewerState, Account.Id> reviewers =

View File

@ -475,7 +475,7 @@ public class ChangeData {
public SetMultimap<ReviewerState, Account.Id> reviewers()
throws OrmException {
return ApprovalsUtil.getReviewers(approvals());
return approvalsUtil.getReviewers(notes(), approvals());
}
public Collection<PatchLineComment> comments()