summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorCarsten Hammer <carsten.hammer@t-online.de>2019-04-11 19:27:34 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-04-13 19:53:29 +0200
commit6a4c77e619d79c885aa6f08f2a1d8d8c1a936bcb (patch)
tree30c8ad7fa8a890578c07026d494cacb4a16406a7 /org.eclipse.jgit.test
parent6e03645ad80adf71527ca18f937db4b8e34b7f13 (diff)
downloadjgit-6a4c77e619d79c885aa6f08f2a1d8d8c1a936bcb.tar.gz
jgit-6a4c77e619d79c885aa6f08f2a1d8d8c1a936bcb.zip
Use isEmpty() instead of size()==0 where possible
Change-Id: I97f1367a2ea9f1f6146e264c27c3981b842f2a26 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java9
2 files changed, 5 insertions, 6 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 139f199f7a..4eeaf4d6e4 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
@@ -128,7 +128,7 @@ public class CleanCommandTest extends RepositoryTestCase {
status = git.status().call();
files = status.getUntracked();
- assertTrue(files.size() == 0);
+ assertTrue(files.isEmpty());
assertTrue(cleanedFiles.contains("File2.txt"));
assertTrue(cleanedFiles.contains("File3.txt"));
assertTrue(!cleanedFiles.contains("sub-noclean/File1.txt"));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
index df1a52dc09..f2f277c6ea 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
@@ -45,7 +45,6 @@
package org.eclipse.jgit.lib;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -63,7 +62,8 @@ public class ReflogConfigTest extends RepositoryTestCase {
// check that there are no entries in the reflog and turn off writing
// reflogs
- assertEquals(0, db.getReflogReader(Constants.HEAD).getReverseEntries().size());
+ assertTrue(db.getReflogReader(Constants.HEAD).getReverseEntries()
+ .isEmpty());
final FileBasedConfig cfg = db.getConfig();
cfg.setBoolean("core", null, "logallrefupdates", false);
cfg.save();
@@ -72,9 +72,8 @@ public class ReflogConfigTest extends RepositoryTestCase {
// written
commit("A Commit\n", commitTime, tz);
commitTime += 60 * 1000;
- assertTrue(
- "Reflog for HEAD still contain no entry",
- db.getReflogReader(Constants.HEAD).getReverseEntries().size() == 0);
+ assertTrue("Reflog for HEAD still contain no entry", db
+ .getReflogReader(Constants.HEAD).getReverseEntries().isEmpty());
// set the logAllRefUpdates parameter to true and check it
cfg.setBoolean("core", null, "logallrefupdates", true);