Factor setPatchSetId out of ChangeUpdate

I missed this when factoring out AbstractChangeUpdate from
ChangeUpdate.

Change-Id: If6eb57fa1a2ed9b37061bdca2fcde200ef034329
This commit is contained in:
Yacob Yonas
2014-07-14 10:46:41 -07:00
parent a9ef3509c0
commit 6a6cf062c1
2 changed files with 7 additions and 6 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.server.notedb;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST;
import com.google.gerrit.reviewdb.client.Account;
@@ -70,6 +71,12 @@ public abstract class AbstractChangeUpdate extends VersionedMetaData {
return (IdentifiedUser) ctl.getCurrentUser();
}
public void setPatchSetId(PatchSet.Id psId) {
checkArgument(psId == null
|| psId.getParentKey().equals(getChange().getId()));
this.psId = psId;
}
private void load() throws IOException {
if (migration.write() && getRevision() == null) {
Repository repo = repoManager.openRepository(getProjectName());

View File

@@ -170,12 +170,6 @@ public class ChangeUpdate extends AbstractChangeUpdate {
this.subject = subject;
}
public void setPatchSetId(PatchSet.Id psId) {
checkArgument(psId == null
|| psId.getParentKey().equals(getChange().getId()));
this.psId = psId;
}
public void setChangeMessage(String changeMessage) {
this.changeMessage = changeMessage;
}