Don't use deprecated ReviewDb.nextChangeId()
Change-Id: Ia892cb6ec7a9ec2d90fae19b78ed05f4684ab292
diff --git a/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayChangesStep.java b/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayChangesStep.java
index 3322dfc..17a4345 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayChangesStep.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayChangesStep.java
@@ -26,6 +26,7 @@
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.server.ReviewDb;
+import com.google.gerrit.server.Sequences;
import com.google.gerrit.server.git.UpdateException;
import com.google.gerrit.server.index.ChangeIndexer;
import com.google.gerrit.server.project.NoSuchChangeException;
@@ -74,6 +75,7 @@
private final ReviewDb db;
private final ChangeIndexer indexer;
private final Provider<InternalChangeQuery> queryProvider;
+ private final Sequences sequences;
private final String fromGerrit;
private final GerritApi api;
private final Repository repo;
@@ -96,6 +98,7 @@
ReviewDb db,
ChangeIndexer indexer,
Provider<InternalChangeQuery> queryProvider,
+ Sequences sequences,
@Assisted @Nullable String fromGerrit,
@Assisted GerritApi api,
@Assisted Repository repo,
@@ -115,6 +118,7 @@
this.db = db;
this.indexer = indexer;
this.queryProvider = queryProvider;
+ this.sequences = sequences;
this.fromGerrit = fromGerrit;
this.api = api;
this.repo = repo;
@@ -220,7 +224,7 @@
private Change createChange(ChangeInfo c) throws OrmException,
NoSuchAccountException, IOException, RestApiException {
- Change.Id changeId = new Change.Id(db.nextChangeId());
+ Change.Id changeId = new Change.Id(sequences.nextChangeId());
Change change =
new Change(new Change.Key(c.changeId), changeId, accountUtil.resolveUser(api, c.owner),