Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  StartCommand/ListCommand: Use isEmpty() to test for empty collection
  Make constants final

Change-Id: I1ce8d78f2ebf8b20e704b4cea3ae06b309f21d3d
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java b/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
index d37321a..d195aa3 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java
@@ -27,8 +27,8 @@
 public class GerritSshApi implements AdminApi {
   private static final FluentLogger logger = FluentLogger.forEnclosingClass();
 
-  static int SSH_COMMAND_FAILED = -1;
-  static String GERRIT_ADMIN_PROTOCOL_PREFIX = "gerrit+";
+  static final int SSH_COMMAND_FAILED = -1;
+  static final String GERRIT_ADMIN_PROTOCOL_PREFIX = "gerrit+";
 
   protected final SshHelper sshHelper;
   protected final URIish uri;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ListCommand.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ListCommand.java
index d337883..9264d9b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/ListCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ListCommand.java
@@ -72,7 +72,7 @@
   }
 
   private void addQueueDetails(JsonObject obj, String key, Collection<PushOne> values) {
-    if (values.size() > 0) {
+    if (!values.isEmpty()) {
       JsonArray list = new JsonArray();
       for (PushOne p : values) {
         list.add(new JsonPrimitive(p.toString()));
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
index 8130051..3e6c4d4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationTasksStorage.java
@@ -83,7 +83,7 @@
     }
   }
 
-  private static Gson GSON = new Gson();
+  private static final Gson GSON = new Gson();
 
   private final Path refUpdates;
   private final Path buildingUpdates;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/StartCommand.java b/src/main/java/com/googlesource/gerrit/plugins/replication/StartCommand.java
index 7115d5b..fa8b44c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/StartCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/StartCommand.java
@@ -55,7 +55,7 @@
 
   @Override
   protected void run() throws Failure {
-    if (all && projectPatterns.size() > 0) {
+    if (all && !projectPatterns.isEmpty()) {
       throw new UnloggedFailure(1, "error: cannot combine --all and PROJECT");
     }