Rename ChangeNotes.Factory#createForNew to createForBatchUpdate

BatchUpdate is the only caller, and it isn't always creating a new
change (though sometimes it is). An inline comment already describes
why it needs to use a preloaded change.

Change-Id: I18d8d9c38902461e958fa609a311539014e69ed5
This commit is contained in:
Dave Borowitz
2016-06-20 15:30:02 -04:00
parent 954a8cf963
commit a519e8d195
2 changed files with 2 additions and 2 deletions

View File

@@ -855,7 +855,7 @@ public class BatchUpdate implements AutoCloseable {
// Pass in preloaded change to controlFor, to avoid:
// - reading from a db that does not belong to this update
// - attempting to read a change that doesn't exist yet
ChangeNotes notes = changeNotesFactory.createForNew(c);
ChangeNotes notes = changeNotesFactory.createForBatchUpdate(c);
ChangeControl ctl = changeControlFactory.controlFor(notes, user);
return new ChangeContext(ctl, new BatchUpdateReviewDb(db), repo, rw);
}

View File

@@ -185,7 +185,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
return new ChangeNotes(args, change);
}
public ChangeNotes createForNew(Change change) throws OrmException {
public ChangeNotes createForBatchUpdate(Change change) throws OrmException {
return new ChangeNotes(args, change).load();
}