You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2021/11/16 14:37:23 UTC

[GitHub] [httpcomponents-client] ok2c commented on a change in pull request #326: Use Args for argument check.

ok2c commented on a change in pull request #326:
URL: https://github.com/apache/httpcomponents-client/pull/326#discussion_r750336819



##########
File path: httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/HttpByteArrayCacheEntrySerializerTestUtils.java
##########
@@ -320,9 +321,7 @@ private static int readFully(final InputStream src, final byte[] dest) throws IO
      *                     number of bytes have been read
      */
     static byte[] readFullyStrict(final InputStream src, final long length) throws IOException {
-        if (length > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException(String.format("Length %d is too large to fit in an array", length));
-        }
+        Args.check(length <= Integer.MAX_VALUE, String.format("Length %d is too large to fit in an array", length));

Review comment:
       @carterkozak Ah, Jesus. I will roll back the damn commit.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org