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:
Edwin Kempin
2018-01-18 16:55:47 +01:00
parent baeae020e5
commit b820248633
52 changed files with 175 additions and 175 deletions

View File

@@ -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());
}
}

View File

@@ -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) {

View File

@@ -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());
}