You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/29 14:38:48 UTC

[GitHub] [commons-io] boris-unckel commented on a change in pull request #196: [IO-711] Use Objects.requireNotNull for fail fast method/constructors

boris-unckel commented on a change in pull request #196:
URL: https://github.com/apache/commons-io/pull/196#discussion_r566852479



##########
File path: src/main/java/org/apache/commons/io/FileUtils.java
##########
@@ -866,6 +868,8 @@ public static void copyFile(final File srcFile, final File destFile, final CopyO
      * @since 2.1
      */
     public static long copyFile(final File input, final OutputStream output) throws IOException {
+        Objects.requireNonNull(input, "input");
+        Objects.requireNonNull(output, "output");

Review comment:
       @garydgregory The other cases before I understood the pattern behind "-1". In this case a FileInputStream is created, afterwards copyLarge calls copy calls copyLarge which then does the check.
   I'll fix the former cases and wait with removal for cases like this on your comment.




----------------------------------------------------------------
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