summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-06-07 12:12:44 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-06-07 12:12:44 +0900
commit00f840dcd1fc53b3face0d824af0eb9de9d19f08 (patch)
treeee529c0fc77b9151107747d19506be00f75bded1 /org.eclipse.jgit.test
parentb5a1b770a05848983688b81b5318f6ce15ead68d (diff)
downloadjgit-00f840dcd1fc53b3face0d824af0eb9de9d19f08.tar.gz
jgit-00f840dcd1fc53b3face0d824af0eb9de9d19f08.zip
Consistently use "!isEmpty()" to detect non-empty list
Replace "size() > 0" with "!isEmpty()" where appropriate. In the Status implementation we can drop the check; the subsequent loop will only execute when the list is non-empty anyway. Change-Id: I355aff551a603373e702a9d44304f087b476263c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
index 4eeaf4d6e4..c9852e8b83 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
@@ -98,7 +98,7 @@ public class CleanCommandTest extends RepositoryTestCase {
StatusCommand command = git.status();
Status status = command.call();
Set<String> files = status.getUntracked();
- assertTrue(files.size() > 0);
+ assertFalse(files.isEmpty());
// run clean
Set<String> cleanedFiles = git.clean().call();
@@ -120,7 +120,7 @@ public class CleanCommandTest extends RepositoryTestCase {
StatusCommand command = git.status();
Status status = command.call();
Set<String> files = status.getUntracked();
- assertTrue(files.size() > 0);
+ assertFalse(files.isEmpty());
// run clean
Set<String> cleanedFiles = git.clean().setCleanDirectories(true).call();
@@ -143,7 +143,7 @@ public class CleanCommandTest extends RepositoryTestCase {
StatusCommand command = git.status();
Status status = command.call();
Set<String> files = status.getUntracked();
- assertTrue(files.size() > 0);
+ assertFalse(files.isEmpty());
// run clean with setPaths
Set<String> paths = new TreeSet<>();
@@ -164,7 +164,7 @@ public class CleanCommandTest extends RepositoryTestCase {
StatusCommand command = git.status();
Status status = command.call();
Set<String> files = status.getUntracked();
- assertTrue(files.size() > 0);
+ assertFalse(files.isEmpty());
// run clean
Set<String> cleanedFiles = git.clean().setDryRun(true).call();
@@ -186,7 +186,7 @@ public class CleanCommandTest extends RepositoryTestCase {
StatusCommand command = git.status();
Status status = command.call();
Set<String> files = status.getUntracked();
- assertTrue(files.size() > 0);
+ assertFalse(files.isEmpty());
// run clean
Set<String> cleanedFiles = git.clean().setDryRun(true)