Author: fanningpj
Date: Mon Feb 21 23:31:58 2022
New Revision: 1898291

URL: http://svn.apache.org/viewvc?rev=1898291&view=rev
Log:
refactor IOUtils.toByteArray

Modified:
    poi/trunk/poi/src/main/java/org/apache/poi/util/IOUtils.java

Modified: poi/trunk/poi/src/main/java/org/apache/poi/util/IOUtils.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/util/IOUtils.java?rev=1898291&r1=1898290&r2=1898291&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/util/IOUtils.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/util/IOUtils.java Mon Feb 21 
23:31:58 2022
@@ -196,7 +196,7 @@ public final class IOUtils {
         if (length < 0 || maxLength < 0) {
             throw new RecordFormatException("Can't allocate an array of length 
< 0");
         }
-        final int derivedMaxLength = BYTE_ARRAY_MAX_OVERRIDE <= 0 ? maxLength 
: Math.max(maxLength, BYTE_ARRAY_MAX_OVERRIDE);
+        final int derivedMaxLength = Math.max(maxLength, 
BYTE_ARRAY_MAX_OVERRIDE);
         if ((length != Integer.MAX_VALUE) || (derivedMaxLength != 
Integer.MAX_VALUE)) {
             checkLength(length, derivedMaxLength);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to