Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Upgrade bazlets to latest stable-2.15
  Upgrade bazlets to latest stable-2.14

Change-Id: I74f2b9b0c567ec5343899fdb018642368fbd2746
diff --git a/BUILD b/BUILD
index 4201ec2..ea6778f 100644
--- a/BUILD
+++ b/BUILD
@@ -5,7 +5,7 @@
     srcs = glob(["src/main/java/**/*.java"]),
     manifest_entries = [
         "Gerrit-PluginName: admin-console",
-        "Gerrit-SshModule: com.googlesource.gerrit.plugins.adminconsole.AdminConsoleCommandModule",
+        "Gerrit-SshModule: com.googlesource.gerrit.plugins.adminconsole.SshModule",
         "Implementation-Title: Plugin admin-console",
         "Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/admin-console",
     ],
diff --git a/WORKSPACE b/WORKSPACE
index 11f2bbe..e039c2d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "4df6379dfb49746619dcf4764825916406365774",
+    commit = "d100b6aad6b37e7db8fa141020c882dc97fb7723",
     #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..2c7062b 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())
+                  accountState.getUserName().isPresent()
+                      ? ""
+                      : " " + 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..99c140e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/ShowAccountCommand.java
@@ -23,13 +23,15 @@
 import com.google.gerrit.reviewdb.client.Account;
 import com.google.gerrit.reviewdb.client.Account.Id;
 import com.google.gerrit.server.IdentifiedUser;
+import com.google.gerrit.server.account.AccountCache;
 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;
@@ -38,6 +40,7 @@
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Optional;
 import java.util.Set;
 import org.eclipse.jgit.errors.ConfigInvalidException;
 import org.kohsuke.args4j.Argument;
@@ -66,6 +69,7 @@
   private final IdentifiedUser.GenericFactory userFactory;
   private final Provider<GetSshKeys> getSshKeys;
   private final ExternalIds externalIds;
+  private final AccountCache accountCache;
 
   @Inject
   ShowAccountCommand(
@@ -73,12 +77,14 @@
       Provider<GetGroups> accountGetGroups,
       IdentifiedUser.GenericFactory userFactory,
       Provider<GetSshKeys> getSshKeys,
-      ExternalIds externalIds) {
+      ExternalIds externalIds,
+      AccountCache accountCache) {
     this.accountResolver = accountResolver;
     this.accountGetGroups = accountGetGroups;
     this.userFactory = userFactory;
     this.getSshKeys = getSshKeys;
     this.externalIds = externalIds;
+    this.accountCache = accountCache;
   }
 
   @Override
@@ -118,7 +124,10 @@
       stdout.println("Full name:         " + account.getFullName());
       stdout.println("Account Id:        " + id.toString());
       stdout.println("Preferred Email:   " + account.getPreferredEmail());
-      stdout.println("User Name:         " + account.getUserName());
+      Optional<AccountState> accountState = accountCache.get(id);
+      if (accountState.isPresent()) {
+        stdout.println("User Name:         " + accountState.get().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" : ""),
diff --git a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/AdminConsoleCommandModule.java b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/SshModule.java
similarity index 74%
rename from src/main/java/com/googlesource/gerrit/plugins/adminconsole/AdminConsoleCommandModule.java
rename to src/main/java/com/googlesource/gerrit/plugins/adminconsole/SshModule.java
index c29da8f..fa73ecc 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/adminconsole/AdminConsoleCommandModule.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/adminconsole/SshModule.java
@@ -16,15 +16,13 @@
 
 import com.google.gerrit.sshd.PluginCommandModule;
 
-public class AdminConsoleCommandModule extends PluginCommandModule {
+public class SshModule extends PluginCommandModule {
   @Override
   protected void configureCommands() {
     command(ShowAccountCommand.class);
     command(ListUsersCommand.class);
     command(GetFullPathCommand.class);
-    alias("show-account", ShowAccountCommand.class);
-    alias("show-repo-account-access", ShowRepoAccountAccessCommand.class);
-    alias("show-repo-access", ShowRepoAccessCommand.class);
-    alias("get-path", GetFullPathCommand.class);
+    command(ShowRepoAccountAccessCommand.class);
+    command(ShowRepoAccessCommand.class);
   }
 }