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 2025/06/12 16:11:31 UTC

(commons-io) 02/04: No need to nest else

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-io.git

commit cfe4477d64c127f65aef2d196db98f7f594a2ab5
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Jun 12 12:08:10 2025 -0400

    No need to nest else
---
 src/main/java/org/apache/commons/io/input/QueueInputStream.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/io/input/QueueInputStream.java b/src/main/java/org/apache/commons/io/input/QueueInputStream.java
index f9e0da166..dd52de095 100644
--- a/src/main/java/org/apache/commons/io/input/QueueInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/QueueInputStream.java
@@ -246,7 +246,8 @@ public int read() {
     public int read(final byte[] b, final int offset, final int length) {
         if (b == null) {
             throw new NullPointerException();
-        } else if (offset < 0 || length < 0 || length > b.length - offset) {
+        }
+        if (offset < 0 || length < 0 || length > b.length - offset) {
             throw new IndexOutOfBoundsException(
                     String.format("Range [%d, %<d + %d) out of bounds for length %d", offset, length, b.length));
         } else if (length == 0) {