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 2019/11/16 09:36:45 UTC

[GitHub] [httpcomponents-core] ok2c commented on a change in pull request #161: EntityUtils clean ups and internal refactoring

ok2c commented on a change in pull request #161: EntityUtils clean ups and internal refactoring
URL: https://github.com/apache/httpcomponents-core/pull/161#discussion_r347084557
 
 

 ##########
 File path: httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/EntityUtils.java
 ##########
 @@ -97,6 +97,11 @@ public static void consume(final HttpEntity entity) throws IOException {
         }
     }
 
+    private static int getCheckedContentLength(final HttpEntity entity) {
+        final int contentLength = (int) Args.checkContentLength(entity);
 
 Review comment:
   @garydgregory I am not a very big fan of shared code at all cost. I would very much prefer to keep `Args.checkContentLength` and similar argument checks at the very beginning of each method, and not hidden somewhere deep inside a static method. Otherwise looks good to me.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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