Adapt to latest master
- Rename reviewdb package to entities
- Adapt to API changes in Account class
Change-Id: I94c3adf6ebb2efa1459c705734ef9451801616ca
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
index 037ceb1..c421479 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ChangeUpdatedListener.java
@@ -14,10 +14,10 @@
package com.googlesource.gerrit.plugins.reviewersbyblame;
+import com.google.gerrit.entities.Change;
+import com.google.gerrit.entities.PatchSet;
+import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.annotations.PluginName;
-import com.google.gerrit.reviewdb.client.Change;
-import com.google.gerrit.reviewdb.client.PatchSet;
-import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.config.PluginConfig;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
index 89b8450..214c3ee 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlame.java
@@ -17,13 +17,13 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Ordering;
import com.google.common.collect.Sets;
+import com.google.gerrit.entities.Account;
+import com.google.gerrit.entities.Change;
+import com.google.gerrit.entities.Patch.ChangeType;
+import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.extensions.api.GerritApi;
import com.google.gerrit.extensions.api.changes.AddReviewerInput;
import com.google.gerrit.extensions.api.changes.ReviewInput;
-import com.google.gerrit.reviewdb.client.Account;
-import com.google.gerrit.reviewdb.client.Change;
-import com.google.gerrit.reviewdb.client.Patch.ChangeType;
-import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.account.AccountState;
import com.google.gerrit.server.account.Emails;
@@ -170,7 +170,7 @@
})
.greatestOf(reviewers.entrySet(), this.maxReviewers);
for (Entry<Account, Integer> entry : entries) {
- topReviewers.add(entry.getKey().getId());
+ topReviewers.add(entry.getKey().id());
}
return topReviewers;
}
@@ -190,10 +190,10 @@
try {
Set<Account.Id> ids = emails.getAccountFor(commit.getAuthorIdent().getEmailAddress());
for (Account.Id id : ids) {
- Optional<Account> accountState = accountCache.get(id).map(AccountState::getAccount);
+ Optional<Account> accountState = accountCache.get(id).map(AccountState::account);
if (accountState.isPresent()) {
Account account = accountState.get();
- if (account.isActive() && !change.getOwner().equals(account.getId())) {
+ if (account.isActive() && !change.getOwner().equals(account.id())) {
Integer count = reviewers.get(account);
reviewers.put(account, count == null ? 1 : count.intValue() + 1);
}