AccountConfig: Improve message if account is not loaded yet

Change-Id: Icdb960f55b4f717bb9465bd02c4dfcfcb13e4895
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-12-07 14:08:09 +01:00
parent 3047318f88
commit db92484e5e

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.server.account;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import com.google.common.base.Strings;
@@ -84,7 +85,7 @@ public class AccountConfig extends VersionedMetaData implements ValidationError.
public AccountConfig(@Nullable OutgoingEmailValidator emailValidator, Account.Id accountId) {
this.emailValidator = emailValidator;
this.accountId = accountId;
this.accountId = checkNotNull(accountId);
this.ref = RefNames.refsUsers(accountId);
}
@@ -250,7 +251,7 @@ public class AccountConfig extends VersionedMetaData implements ValidationError.
}
private void checkLoaded() {
checkState(isLoaded, "account not loaded yet");
checkState(isLoaded, "Account %s not loaded yet", accountId.get());
}
/**