Merge branch 'stable-2.15'

* stable-2.15:
  Upgrade bazlets to latest stable-2.15 to build with 2.15.7 API
  Upgrade bazlets to latest stable-2.14 to build with 2.14.17 API

Change-Id: Ieeea48c572b98e4664bee782430d53a51afe1bf7
diff --git a/WORKSPACE b/WORKSPACE
index 026e89a..932129e 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "b54eaed487d37188120da6933b97c571519954ca",
+    commit = "5019308b48bb5e2b5971bed11a1ba8bab2a49279",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ListUsersCommand.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ListUsersCommand.java
index 96b9c77..78ac5ab 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ListUsersCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ListUsersCommand.java
@@ -71,7 +71,9 @@
               .append(account.getId().toString())
               .append(" |")
               .append(
-                  Strings.isNullOrEmpty(account.getUserName()) ? "" : " " + account.getUserName())
+                  Strings.isNullOrEmpty(accountState.getUserName().get())
+                      ? ""
+                      : " " + accountState.getUserName().get())
               .append(" |")
               .append(
                   Strings.isNullOrEmpty(account.getFullName()) ? "" : " " + account.getFullName())
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java
index 512828e..bde0611 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java
@@ -25,11 +25,12 @@
 import com.google.gerrit.server.IdentifiedUser;
 import com.google.gerrit.server.account.AccountResolver;
 import com.google.gerrit.server.account.AccountResource;
-import com.google.gerrit.server.account.GetGroups;
-import com.google.gerrit.server.account.GetSshKeys;
+import com.google.gerrit.server.account.AccountState;
 import com.google.gerrit.server.account.externalids.ExternalId;
 import com.google.gerrit.server.account.externalids.ExternalIds;
 import com.google.gerrit.server.permissions.PermissionBackendException;
+import com.google.gerrit.server.restapi.account.GetGroups;
+import com.google.gerrit.server.restapi.account.GetSshKeys;
 import com.google.gerrit.sshd.CommandMetaData;
 import com.google.gerrit.sshd.SshCommand;
 import com.google.inject.Inject;
@@ -66,6 +67,7 @@
   private final IdentifiedUser.GenericFactory userFactory;
   private final Provider<GetSshKeys> getSshKeys;
   private final ExternalIds externalIds;
+  private final AccountState accountState;
 
   @Inject
   ShowAccountCommand(
@@ -73,12 +75,14 @@
       Provider<GetGroups> accountGetGroups,
       IdentifiedUser.GenericFactory userFactory,
       Provider<GetSshKeys> getSshKeys,
-      ExternalIds externalIds) {
+      ExternalIds externalIds,
+      AccountState accountState) {
     this.accountResolver = accountResolver;
     this.accountGetGroups = accountGetGroups;
     this.userFactory = userFactory;
     this.getSshKeys = getSshKeys;
     this.externalIds = externalIds;
+    this.accountState = accountState;
   }
 
   @Override
@@ -118,7 +122,7 @@
       stdout.println("Full name:         " + account.getFullName());
       stdout.println("Account Id:        " + id.toString());
       stdout.println("Preferred Email:   " + account.getPreferredEmail());
-      stdout.println("User Name:         " + account.getUserName());
+      stdout.println("User Name:         " + accountState.getUserName().get());
       stdout.println("Active:            " + account.isActive());
       stdout.println("Registered on:     " + account.getRegisteredOn());
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccessCommand.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccessCommand.java
index 130e69c..4c88634 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccessCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccessCommand.java
@@ -21,8 +21,8 @@
 import com.google.gerrit.extensions.annotations.CapabilityScope;
 import com.google.gerrit.extensions.annotations.RequiresCapability;
 import com.google.gerrit.reviewdb.client.Project;
-import com.google.gerrit.server.git.MetaDataUpdate;
-import com.google.gerrit.server.git.ProjectConfig;
+import com.google.gerrit.server.git.meta.MetaDataUpdate;
+import com.google.gerrit.server.project.ProjectConfig;
 import com.google.gerrit.sshd.CommandMetaData;
 import com.google.gerrit.sshd.SshCommand;
 import com.google.inject.Inject;
@@ -83,7 +83,7 @@
             stdout.print(
                 String.format(
                     permissionNameFormatter,
-                    (!rule.getMin().equals(rule.getMax()))
+                    (rule.getMin() != rule.getMax())
                         ? "" + rule.getMin() + " " + rule.getMax()
                         : rule.getAction(),
                     (permission.getExclusiveGroup() ? "EXCLUSIVE" : ""),
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccountAccessCommand.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccountAccessCommand.java
index 6b59bc1..2f542bf 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccountAccessCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowRepoAccountAccessCommand.java
@@ -27,9 +27,9 @@
 import com.google.gerrit.server.IdentifiedUser;
 import com.google.gerrit.server.account.AccountResolver;
 import com.google.gerrit.server.account.AccountResource;
-import com.google.gerrit.server.account.GetGroups;
-import com.google.gerrit.server.git.MetaDataUpdate;
-import com.google.gerrit.server.git.ProjectConfig;
+import com.google.gerrit.server.git.meta.MetaDataUpdate;
+import com.google.gerrit.server.project.ProjectConfig;
+import com.google.gerrit.server.restapi.account.GetGroups;
 import com.google.gerrit.sshd.CommandMetaData;
 import com.google.gerrit.sshd.SshCommand;
 import com.google.inject.Inject;
@@ -150,7 +150,7 @@
                 sb.append(
                     String.format(
                         permissionNameFormatter,
-                        (!rule.getMin().equals(rule.getMax()))
+                        (rule.getMin() != rule.getMax())
                             ? "" + rule.getMin() + " " + rule.getMax()
                             : rule.getAction(),
                         (permission.getExclusiveGroup() ? "EXCLUSIVE" : ""),