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/11/07 10:57:42 UTC

(commons-imaging) branch master updated: Bump commons-io:commons-io from 2.20.0 to 2.21.0

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


The following commit(s) were added to refs/heads/master by this push:
     new 54084a31 Bump commons-io:commons-io from 2.20.0 to 2.21.0
54084a31 is described below

commit 54084a313ce07e37830a7e4b96f6a159b76fba33
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 7 05:57:37 2025 -0500

    Bump commons-io:commons-io from 2.20.0 to 2.21.0
---
 pom.xml                                                               | 2 +-
 src/changes/changes.xml                                               | 2 +-
 src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java  | 2 +-
 .../apache/commons/imaging/formats/jpeg/segments/App2SegmentTest.java | 4 ----
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9d842ba2..deab3976 100644
--- a/pom.xml
+++ b/pom.xml
@@ -230,7 +230,7 @@
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
-      <version>2.20.0</version>
+      <version>2.21.0</version>
     </dependency>
     <dependency>
       <groupId>org.openjdk.jol</groupId>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 41f4114b..66f3ada1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,7 +52,7 @@ The <action> type attribute can be add,update,fix,remove.
       <!-- UPDATE -->
       <action dev="ggregory" type="update" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-parent from 83 to 91 #527, #530, #539.</action>
       <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.19.0 #515.</action>
-      <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io:commons-io from 2.19.0 to 2.20.0.</action>
+      <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io:commons-io from 2.19.0 to 2.21.0.</action>
     </release>
     <release version="1.0.0-alpha6" date="2025-04-27" description="This release requires Java 8.">
       <!-- FIX -->
diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
index c63a651d..c4032aff 100644
--- a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
+++ b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
@@ -262,7 +262,7 @@ public final class BinaryFunctions {
 
     public static byte[] readBytes(final String name, final InputStream in, final int length, final String exception) throws IOException {
         try {
-            return IOUtils.toByteArray(in, Allocator.check(length));
+            return in == null ? ArrayUtils.EMPTY_BYTE_ARRAY : IOUtils.toByteArray(in, Allocator.check(length));
         } catch (final IOException e) {
             throw new IOException(exception + ", name: " + name + ", length: " + length);
         }
diff --git a/src/test/java/org/apache/commons/imaging/formats/jpeg/segments/App2SegmentTest.java b/src/test/java/org/apache/commons/imaging/formats/jpeg/segments/App2SegmentTest.java
index 7a82e21d..6a2fed6c 100644
--- a/src/test/java/org/apache/commons/imaging/formats/jpeg/segments/App2SegmentTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/jpeg/segments/App2SegmentTest.java
@@ -34,7 +34,6 @@ class App2SegmentTest {
     @Test
     void testCompareTo() throws IOException, ImagingException {
         final App2Segment app2Segment = new App2Segment(0, 0, null);
-
         assertEquals(0, app2Segment.compareTo(app2Segment));
     }
 
@@ -42,15 +41,12 @@ class App2SegmentTest {
     void testEqualsReturningFalse() throws IOException, ImagingException {
         final byte[] byteArray = new byte[3];
         final App2Segment app2Segment = new App2Segment(65475, byteArray);
-
         assertNotEquals(app2Segment, byteArray);
     }
 
     @Test
     void testEqualsReturningTrue() throws IOException, ImagingException {
         final App2Segment app2Segment = new App2Segment(0, 0, null);
-
         assertEquals(app2Segment, app2Segment);
     }
-
 }