for (Map.Entry<String, LabelInfo> e : labels.entrySet()) {
if (e.getValue().approved != null || e.getValue().rejected != null) {
continue;
}
ApprovalType type = approvalTypes.byLabel(e.getKey());
if (type == null || type.getMin() == null || type.getMax() == null) {
// Unknown or misconfigured type can't have intermediate scores.
continue;
}
short min = type.getMin().getValue();
short max = type.getMax().getValue();
if (-1 <= min && max <= 1) {
// Types with a range of -1..+1 can't have intermediate scores.
continue;
}
if (approvals == null) {
approvals = cd.currentApprovals(db);
}
for (PatchSetApproval psa : approvals) {
short val = psa.getValue();
if (val != 0 && min < val && val < max
&& psa.getCategoryId().equals(type.getCategory().getId())) {
if (0 < val) {
e.getValue().recommended = asAccountAttribute(psa.getAccountId());
e.getValue().value = val != 1 ? val : null;
} else {
e.getValue().disliked = asAccountAttribute(psa.getAccountId());