Merge branch 'stable-2.15'

* stable-2.15:
  ChangeRebuilderImpl#execute: Fix string formatting of exception message
  ChangeRebuilderImpl#checkNoteDbState: Fix usage of String.format

Change-Id: Ica8e229ea756693b46eb0843761fe98c0a8027f1
This commit is contained in:
David Pursehouse
2018-10-11 20:34:27 +09:00

View File

@@ -230,8 +230,9 @@ public class ChangeRebuilderImpl extends ChangeRebuilder {
String newNoteDbStateStr = change.getNoteDbState();
if (newNoteDbStateStr == null) {
throw new OrmException(
"Rebuilding change %s produced no writes to NoteDb: "
+ bundleReader.fromReviewDb(db, changeId));
String.format(
"Rebuilding change %s produced no writes to NoteDb: %s",
changeId, bundleReader.fromReviewDb(db, changeId)));
}
NoteDbChangeState newNoteDbState =
checkNotNull(NoteDbChangeState.parse(changeId, newNoteDbStateStr));
@@ -290,8 +291,7 @@ public class ChangeRebuilderImpl extends ChangeRebuilder {
// Can only rebuild a change if its primary storage is ReviewDb.
NoteDbChangeState s = NoteDbChangeState.parse(c);
if (s != null && s.getPrimaryStorage() != PrimaryStorage.REVIEW_DB) {
throw new OrmException(
String.format("cannot rebuild change " + c.getId() + " with state " + s));
throw new OrmException(String.format("cannot rebuild change %s with state %s", c.getId(), s));
}
return c;
}