Merge branch 'stable-2.15'
* stable-2.15:
WORKSPACE: Make header comment line space indent consistent
Upgrade bazlets to latest stable-2.15 to build with 2.15.6 API
Upgrade bazlets to latest stable-2.14 to build with 2.14.16 API
Align Eclipse compiler settings with core Gerrit's
WORKSPACE: Make commented out lines spaces indent consistent
Change-Id: I6fdb22f335207af25bf5ba685a85353428501b20
diff --git a/WORKSPACE b/WORKSPACE
index 3160a5d..1b994ea 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
load("//:bazlets.bzl", "load_bazlets")
load_bazlets(
- commit = "087da1f6ca119ad5c4bc443926426ddf44dcde3a",
+ commit = "e4662688b3f482cf5789b27a1ea726e8d0aabfc8",
#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" : ""),