Don't store username in Account but in AccountState
The username is just an external ID and all other external IDs are kept in AccountState. It is more consistent if the username is kept in AccountState alongside the other external IDs. This is also a preparation to make Account an AutoValue class. Then account will be non-mutable and hence a username can no longer be set on it after it was created. Change-Id: Ia7ad7b43326caea356812e48ecee9dd92da596ab Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -262,6 +262,6 @@ public class MetaDataUpdate implements AutoCloseable {
|
||||
}
|
||||
|
||||
protected void fireGitRefUpdatedEvent(RefUpdate ru) {
|
||||
gitRefUpdated.fire(projectName, ru, author == null ? null : author.getAccount());
|
||||
gitRefUpdated.fire(projectName, ru, author == null ? null : author.state());
|
||||
}
|
||||
}
|
||||
|
@@ -497,7 +497,7 @@ public class ReplaceOp implements BatchUpdateOp {
|
||||
try {
|
||||
ReplacePatchSetSender cm =
|
||||
replacePatchSetFactory.create(projectState.getNameKey(), notes.getChangeId());
|
||||
cm.setFrom(ctx.getAccount().getId());
|
||||
cm.setFrom(ctx.getAccount().getAccount().getId());
|
||||
cm.setPatchSet(newPatchSet, info);
|
||||
cm.setChangeMessage(msg.getMessage(), ctx.getWhen());
|
||||
if (magicBranch != null) {
|
||||
|
@@ -553,7 +553,7 @@ abstract class SubmitStrategyOp implements BatchUpdateOp {
|
||||
args.changeMerged.fire(
|
||||
updatedChange,
|
||||
mergedPatchSet,
|
||||
args.accountCache.get(submitter.getAccountId()).getAccount(),
|
||||
args.accountCache.get(submitter.getAccountId()),
|
||||
args.mergeTip.getCurrentTip().name(),
|
||||
ctx.getWhen());
|
||||
}
|
||||
|
Reference in New Issue
Block a user