Search in sources :

Example 1 with ChangeNotesResult

use of com.google.gerrit.server.notedb.ChangeNotes.Factory.ChangeNotesResult in project gerrit by GerritCodeReview.

the class VisibleChangesCache method visibleChangesByScan.

private void visibleChangesByScan() throws PermissionBackendException {
    visibleChanges = new HashMap<>();
    Project.NameKey p = projectState.getNameKey();
    ImmutableList<ChangeNotesResult> changes;
    try {
        changes = changeNotesFactory.scan(repository, p).collect(toImmutableList());
    } catch (IOException e) {
        logger.atSevere().withCause(e).log("Cannot load changes for project %s, assuming no changes are visible", p);
        return;
    }
    for (ChangeNotesResult notesResult : changes) {
        ChangeNotes notes = toNotes(notesResult);
        if (notes != null) {
            visibleChanges.put(notes.getChangeId(), notes.getChange().getDest());
        }
    }
}
Also used : Project(com.google.gerrit.entities.Project) IOException(java.io.IOException) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) ChangeNotesResult(com.google.gerrit.server.notedb.ChangeNotes.Factory.ChangeNotesResult)

Aggregations

Project (com.google.gerrit.entities.Project)1 ChangeNotes (com.google.gerrit.server.notedb.ChangeNotes)1 ChangeNotesResult (com.google.gerrit.server.notedb.ChangeNotes.Factory.ChangeNotesResult)1 IOException (java.io.IOException)1