Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21390#discussion_r190074813
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java
 ---
    @@ -157,10 +172,10 @@ private static void 
deleteRecursivelyUsingUnixNative(File file) throws IOExcepti
         }
       }
     
    -  private static File[] listFilesSafely(File file) throws IOException {
    +  private static File[] listFilesSafely(File file, FilenameFilter filter) 
throws IOException {
         if (file.exists()) {
    -      File[] files = file.listFiles();
    -      if (files == null) {
    +      File[] files = file.listFiles(filter);
    +      if (files == null && filter == null) {
    --- End diff --
    
    Agreed, null is reserved for errors, and it's possible that 
`listFiles(filter)` returns null when the list operation fail. 


---

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

Reply via email to