Construct ChangeDatas with ChangeControls in REST handlers

This is strictly less work than constructing them with Changes, as
ChangeControls never need to be lazily loaded.

Unfortunately there are still many more callers where it was not
obvious whether a ChangeControl could be passed in, so I just got the
easy ones.

Change-Id: Ic1c8c2f6aedb25df6c64595f3aecc0e9d2c96817
This commit is contained in:
Dave Borowitz
2014-10-14 14:36:23 -07:00
parent b810da2053
commit 77ac934e8b
3 changed files with 3 additions and 3 deletions

View File

@@ -289,7 +289,7 @@ public class PostReview implements RestModifyView<RevisionResource, ReviewInput>
in.entrySet().iterator();
Set<String> filePaths =
Sets.newHashSet(changeDataFactory.create(
db.get(), revision.getChange()).filePaths(
db.get(), revision.getControl()).filePaths(
revision.getPatchSet()));
while (mapItr.hasNext()) {
Map.Entry<String, List<CommentInput>> ent = mapItr.next();

View File

@@ -94,7 +94,7 @@ public class TestSubmitRule implements RestModifyView<RevisionResource, Input> {
rsrc.getControl().getProjectControl(),
rsrc.getControl(),
rsrc.getChange(),
changeDataFactory.create(db.get(), rsrc.getChange()),
changeDataFactory.create(db.get(), rsrc.getControl()),
false,
"locate_submit_rule", "can_submit",
"locate_submit_filter", "filter_submit_results",

View File

@@ -74,7 +74,7 @@ public class TestSubmitType implements RestModifyView<RevisionResource, Input> {
rsrc.getControl().getProjectControl(),
rsrc.getControl(),
rsrc.getChange(),
changeDataFactory.create(db.get(), rsrc.getChange()),
changeDataFactory.create(db.get(), rsrc.getControl()),
false,
"locate_submit_type", "get_submit_type",
"locate_submit_type_filter", "filter_submit_type_results",