use of com.google.gerrit.entities.Project.NameKey in project gerrit by GerritCodeReview.
the class ChangeData method getRefStates.
public SetMultimap<NameKey, RefState> getRefStates() {
if (refStates == null) {
if (!lazyload()) {
return ImmutableSetMultimap.of();
}
ImmutableSetMultimap.Builder<NameKey, RefState> result = ImmutableSetMultimap.builder();
for (Table.Cell<Account.Id, PatchSet.Id, ObjectId> edit : editRefs().cellSet()) {
result.put(project, RefState.create(RefNames.refsEdit(edit.getRowKey(), edit.getColumnKey().changeId(), edit.getColumnKey()), edit.getValue()));
}
starRefs().values().forEach(r -> result.put(allUsersName, RefState.of(r.ref())));
// TODO: instantiating the notes is too much. We don't want to parse NoteDb, we just want the
// refs.
result.put(project, RefState.create(notes().getRefName(), notes().getMetaId()));
// Force loading robot comments.
notes().getRobotComments();
RobotCommentNotes robotNotes = notes().getRobotCommentNotes();
result.put(project, RefState.create(robotNotes.getRefName(), robotNotes.getMetaId()));
draftRefs().entrySet().forEach(r -> result.put(allUsersName, RefState.create(RefNames.refsDraftComments(getId(), r.getKey()), r.getValue())));
refStates = result.build();
}
return refStates;
}
Aggregations