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 2019/12/25 15:47:30 UTC

[GitHub] [commons-io] garydgregory commented on a change in pull request #75: Addition of tests for FileUtils

garydgregory commented on a change in pull request #75: Addition of tests for FileUtils
URL: https://github.com/apache/commons-io/pull/75#discussion_r361323277
 
 

 ##########
 File path: src/main/java/org/apache/commons/io/FileUtils.java
 ##########
 @@ -1176,20 +1178,20 @@ private static void doCopyFile(final File srcFile, final File destFile, final bo
      * @param srcDir  an existing directory to copy, must not be {@code null}
      * @param destDir the directory to place the copy in, must not be {@code null}
      *
-     * @throws NullPointerException if source or destination is {@code null}
+     * @throws IllegalArgumentException if source or destination is {@code null}
      * @throws IOException          if source or destination is invalid
      * @throws IOException          if an IO error occurs during copying
      * @since 1.2
      */
     public static void copyDirectoryToDirectory(final File srcDir, final File destDir) throws IOException {
         if (srcDir == null) {
-            throw new NullPointerException("Source must not be null");
+            throw new IllegalArgumentException("Source must not be null");
 
 Review comment:
   Do not change these please. Since Java 8 and the broad use of [java.util.Objects.requireNonNull(T, String)](https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#requireNonNull-T-java.lang.String-), any edits to current throws of NPE should use the aforementioned API.
   

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