commit | d19c5e3002b13919c337a49e2a48c4bb13d004c3 | [log] [tgz] |
---|---|---|
author | Marco Miller <marco.miller@ericsson.com> | Thu Feb 20 13:28:07 2020 -0500 |
committer | Marco Miller <marco.miller@ericsson.com> | Thu Feb 20 13:28:07 2020 -0500 |
tree | eb1477832cf146be8785b9593e8f64daf4d57b50 | |
parent | 890967ffc4d4c16fbbeaa1a84d7f09f839c139c0 [diff] | |
parent | 6e3c80d352681d7e00bf78c5f73dfea7ac4a40a4 [diff] |
Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: StartCommand/ListCommand: Use isEmpty() to test for empty collection Change-Id: I794e57d641c6ee08564bea4c27489b06fc1838ed
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"); }