You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/17 01:42:10 UTC

[commons-compress] branch master updated: Use isEmpty().

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new adab245  Use isEmpty().
adab245 is described below

commit adab245db9e187b47d1089bab9fea927cce6f6d5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 16 20:42:04 2021 -0500

    Use isEmpty().
---
 .../apache/commons/compress/archivers/tar/TarArchiveInputStream.java  | 2 +-
 .../commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
index 3f160dc..e67f1d7 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
@@ -298,7 +298,7 @@ public class TarArchiveInputStream extends ArchiveInputStream {
      * @throws IOException
      */
     private long skipSparse(final long n) throws IOException {
-        if (sparseInputStreams == null || sparseInputStreams.size() == 0) {
+        if (sparseInputStreams == null || sparseInputStreams.isEmpty()) {
             return inputStream.skip(n);
         }
 
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
index 00ebdb2..54840da 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
@@ -73,7 +73,7 @@ public class ParallelScatterZipCreatorTest {
         zipCreator.writeTo(zos);
         zos.close();
         removeEntriesFoundInZipFile(result, entries);
-        assertTrue(entries.size() == 0);
+        assertTrue(entries.isEmpty());
         assertNotNull( zipCreator.getStatisticsMessage());
     }
 
@@ -137,7 +137,7 @@ public class ParallelScatterZipCreatorTest {
 
 
         removeEntriesFoundInZipFile(result, entries);
-        assertTrue(entries.size() == 0);
+        assertTrue(entries.isEmpty());
         assertNotNull(zipCreator.getStatisticsMessage());
     }