Remove usages of System.currentTimeMillis() from gerrit-reviewdb
Unlike pure server code, reviewdb.client is used from GWT, so we cannot just use joda's DateTimeUtils.currentTimeMillis(). Instead, just introduce arguments where necessary. Passing TimeUtil.nowTs() is a bit cumbersome but usually short enough to type. Change-Id: I87ef09b0920bc36851bca893a2a37348ffc6bf3a
This commit is contained in:
@@ -30,8 +30,10 @@ import com.google.gerrit.server.account.AccountByEmailCache;
|
||||
import com.google.gerrit.server.account.AccountCache;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.ssh.SshKeyCache;
|
||||
import com.google.gerrit.server.util.TimeUtil;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.gwtorm.server.SchemaFactory;
|
||||
|
||||
import com.jcraft.jsch.JSch;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.KeyPair;
|
||||
@@ -77,7 +79,7 @@ public class AccountCreator {
|
||||
db.accountExternalIds().insert(Collections.singleton(extMailto));
|
||||
}
|
||||
|
||||
Account a = new Account(id);
|
||||
Account a = new Account(id, TimeUtil.nowTs());
|
||||
a.setFullName(fullName);
|
||||
a.setPreferredEmail(email);
|
||||
db.accounts().insert(Collections.singleton(a));
|
||||
|
Reference in New Issue
Block a user