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

commit c5c3c46127084b7a07691e8871b057de7c42f011
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Apr 13 16:28:45 2025 -0400

    No need to nest
---
 .../java/org/apache/commons/compress/archivers/zip/ZipIoUtil.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/archivers/zip/ZipIoUtil.java 
b/src/main/java/org/apache/commons/compress/archivers/zip/ZipIoUtil.java
index d09416f71..20a3a3a0c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipIoUtil.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipIoUtil.java
@@ -46,7 +46,8 @@ static void writeAll(final FileChannel channel, final 
ByteBuffer buffer, final l
                 // A non-blocking channel
                 Thread.yield();
                 continue;
-            } else if (written < 0) {
+            }
+            if (written < 0) {
                 throw new IOException("Failed to write all bytes in the buffer 
for channel=" + channel + ", length=" + remaining + ", written=" + written);
             }
             currentPos += written;
@@ -68,7 +69,8 @@ static void writeAll(final WritableByteChannel channel, final 
ByteBuffer buffer)
                 // A non-blocking channel
                 Thread.yield();
                 continue;
-            } else if (written < 0) {
+            }
+            if (written < 0) {
                 throw new IOException("Failed to write all bytes in the buffer 
for channel=" + channel + ", length=" + remaining + ", written=" + written);
             }
         }

Reply via email to