commit | 6e3c80d352681d7e00bf78c5f73dfea7ac4a40a4 | [log] [tgz] |
---|---|---|
author | David Pursehouse <dpursehouse@collab.net> | Wed Feb 19 23:03:51 2020 +0900 |
committer | David Pursehouse <dpursehouse@collab.net> | Wed Feb 19 14:57:59 2020 +0000 |
tree | 0fd9b2f4b4a396e5ba0b9293c70bbc0943eb82c6 | |
parent | fa69bf7220461e519607c8ef00c80349c8b9a1c4 [diff] |
StartCommand/ListCommand: Use isEmpty() to test for empty collection Change-Id: Icc4454a412a500afdec12a0b31e716b578f45e8d
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 fa17dce..07978ab 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/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"); }