Merge "Clean up BUILD rules"
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
index 7a654da..0d9f967 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
@@ -131,7 +131,7 @@
return changeData.reviewers().all().stream()
.map(accountCache::get)
.flatMap(Streams::stream)
- .map(a -> a.getAccount().getPreferredEmail())
+ .map(a -> a.getAccount().preferredEmail())
.filter(Objects::nonNull)
.collect(toList());
} catch (StorageException e) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
index 8b99f17..190f1eb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
@@ -69,7 +69,7 @@
if (p.value() != 0 && p.label().equals("Code-Review")) {
// Reviewers may have no preferred email, skip them if the preferred email is not set.
Optional<String> preferredEmail =
- accountCache.get(p.accountId()).map(a -> a.getAccount().getPreferredEmail());
+ accountCache.get(p.accountId()).map(a -> a.getAccount().preferredEmail());
if (preferredEmail.isPresent()) {
map.put(preferredEmail.get(), Integer.valueOf(p.value()));
}
@@ -82,7 +82,7 @@
Optional<String> author =
accountCache
.get(changeData.change().getOwner())
- .map(a -> a.getAccount().getPreferredEmail());
+ .map(a -> a.getAccount().preferredEmail());
if (author.isPresent() && (!map.containsKey(author.get()) || map.get(author.get()) == 0)) {
map.put(author.get(), minVoteLevel);
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
index e3e7059..db3bc5b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/OwnersDb.java
@@ -253,7 +253,7 @@
email =
accountCache
.get(ids.iterator().next())
- .map(a -> a.getAccount().getPreferredEmail())
+ .map(a -> a.getAccount().preferredEmail())
.orElse(null);
}
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/findowners/ApiIT.java b/src/test/java/com/googlesource/gerrit/plugins/findowners/ApiIT.java
index 9c487cb..514d146 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/findowners/ApiIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/findowners/ApiIT.java
@@ -174,7 +174,7 @@
// Action.getReviewers and Checker.getVotes use accountCache to get email address.
Optional<Account> account = accountCache.get(id1).map(AccountState::getAccount);
assertWithMessage("account %s", id1).about(optionals()).that(account).isPresent();
- assertThat(account.get().getPreferredEmail()).isEqualTo(emails1[i]);
+ assertThat(account.get().preferredEmail()).isEqualTo(emails1[i]);
}
// Wrong or non-existing email address.
String[] wrongEmails = {"nobody", "@g.com", "nobody@g.com", "*"};