LabelNormalizer: record what happens to each approval
Unchanged, updated, and deleted approvals may need to be handled separately by the underlying storage layer, e.g. in Submit. Record this information in the result of LabelNormalizer.normalize(). For callers that don't care whether approvals were updated or not, provide a convenience method to concatenate them. Change-Id: Ifea7db3f7333d3ddb5e4d647a1d7e8eeb8cbff11
This commit is contained in:
@@ -91,12 +91,12 @@ public class ReviewerJson {
|
||||
|
||||
public ReviewerInfo format(ReviewerInfo out, ChangeControl ctl,
|
||||
List<PatchSetApproval> approvals) throws OrmException {
|
||||
approvals = labelNormalizer.normalize(ctl, approvals);
|
||||
LabelTypes labelTypes = ctl.getLabelTypes();
|
||||
|
||||
// Don't use Maps.newTreeMap(Comparator) due to OpenJDK bug 100167.
|
||||
out.approvals = new TreeMap<String,String>(labelTypes.nameComparator());
|
||||
for (PatchSetApproval ca : approvals) {
|
||||
for (PatchSetApproval ca :
|
||||
labelNormalizer.normalize(ctl, approvals).getNormalized()) {
|
||||
for (PermissionRange pr : ctl.getLabelRanges()) {
|
||||
if (!pr.isEmpty()) {
|
||||
LabelType at = labelTypes.byLabel(ca.getLabelId());
|
||||
|
Reference in New Issue
Block a user