ChangeRebuilderImpl#execute: Fix string formatting of exception message

The string contains a %s placeholder, but is not formatted with
String.format and the changeId is not included in the message.

Format the string with String.format, passing in the changeId.

Change-Id: I2e06b9c89d597e69bb665dea4b9fd82aa5d55ba9
This commit is contained in:
David Pursehouse 2018-10-11 19:26:58 +09:00
parent c430605ebc
commit ddeb76c226

View File

@ -238,8 +238,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));