Merge "Merge branch 'stable-2.14'"
This commit is contained in:
@@ -167,22 +167,18 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
|||||||
checkArgument(project != null, "project is required");
|
checkArgument(project != null, "project is required");
|
||||||
Change change = readOneReviewDbChange(db, changeId);
|
Change change = readOneReviewDbChange(db, changeId);
|
||||||
|
|
||||||
if (change == null && args.migration.readChanges()) {
|
if (change == null) {
|
||||||
// Change isn't in ReviewDb, but its primary storage might be in NoteDb.
|
if (args.migration.readChanges()) {
|
||||||
// Prepopulate the change exists with proper noteDbState field.
|
return newNoteDbOnlyChange(project, changeId);
|
||||||
change = newNoteDbOnlyChange(project, changeId);
|
}
|
||||||
} else {
|
throw new NoSuchChangeException(changeId);
|
||||||
checkNotNull(change, "change %s not found in ReviewDb", changeId);
|
|
||||||
checkArgument(
|
|
||||||
change.getProject().equals(project),
|
|
||||||
"passed project %s when creating ChangeNotes for %s, but actual project is %s",
|
|
||||||
project,
|
|
||||||
changeId,
|
|
||||||
change.getProject());
|
|
||||||
}
|
}
|
||||||
|
checkArgument(
|
||||||
// TODO: Throw NoSuchChangeException when the change is not found in the
|
change.getProject().equals(project),
|
||||||
// database
|
"passed project %s when creating ChangeNotes for %s, but actual project is %s",
|
||||||
|
project,
|
||||||
|
changeId,
|
||||||
|
change.getProject());
|
||||||
return change;
|
return change;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user