}
public Collection<PatchSetApproval> currentApprovals(Provider<ReviewDb> db)
throws OrmException {
if (currentApprovals == null) {
Change c = change(db);
if (c == null) {
currentApprovals = Collections.emptyList();
} else if (approvals != null) {
Map<Id, Collection<PatchSetApproval>> map = approvalsMap(db);
currentApprovals = map.get(c.currentPatchSetId());
if (currentApprovals == null) {
currentApprovals = Collections.emptyList();
map.put(c.currentPatchSetId(), currentApprovals);
}
} else {
currentApprovals = db.get().patchSetApprovals()
.byPatchSet(c.currentPatchSetId()).toList();
}
}
return currentApprovals;
}