You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2021/05/12 02:04:31 UTC

[hadoop] branch branch-3.3 updated: HADOOP-17683. Update commons-io to 2.8.0 (#2974)

This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new b2897fd  HADOOP-17683. Update commons-io to 2.8.0 (#2974)
b2897fd is described below

commit b2897fdd66b5ea0e3597a1f56bf8af69f9d024ae
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Wed May 12 10:57:45 2021 +0900

    HADOOP-17683. Update commons-io to 2.8.0 (#2974)
    
    Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
    Co-authored-by: Akira Ajisaka <aa...@apache.org>
    Signed-off-by: Wei-Chiu Chuang <we...@apache.org>
    (cherry picked from commit 29105ffb634ceb44a331ba65280d418544b902a6)
---
 LICENSE-binary                                         |  2 +-
 .../src/main/java/org/apache/hadoop/fs/FileUtil.java   | 18 ++++++------------
 hadoop-project/pom.xml                                 |  2 +-
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/LICENSE-binary b/LICENSE-binary
index 4fa65d5..c3653f9 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -249,7 +249,7 @@ commons-cli:commons-cli:1.2
 commons-codec:commons-codec:1.11
 commons-collections:commons-collections:3.2.2
 commons-daemon:commons-daemon:1.0.13
-commons-io:commons-io:2.5
+commons-io:commons-io:2.8.0
 commons-lang:commons-lang:2.6
 commons-logging:commons-logging:1.1.3
 commons-net:commons-net:3.6
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
index 73ca6e6..444f992 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
@@ -604,18 +604,12 @@ public class FileUtil {
       return dir.length();
     } else {
       File[] allFiles = dir.listFiles();
-      if(allFiles != null) {
-         for (int i = 0; i < allFiles.length; i++) {
-           boolean isSymLink;
-           try {
-             isSymLink = org.apache.commons.io.FileUtils.isSymlink(allFiles[i]);
-           } catch(IOException ioe) {
-             isSymLink = true;
-           }
-           if(!isSymLink) {
-             size += getDU(allFiles[i]);
-           }
-         }
+      if (allFiles != null) {
+        for (File f : allFiles) {
+          if (!org.apache.commons.io.FileUtils.isSymlink(f)) {
+            size += getDU(f);
+          }
+        }
       }
       return size;
     }
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index de9864e..ad5c974 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -120,7 +120,7 @@
     <commons-collections.version>3.2.2</commons-collections.version>
     <commons-compress.version>1.19</commons-compress.version>
     <commons-csv.version>1.0</commons-csv.version>
-    <commons-io.version>2.5</commons-io.version>
+    <commons-io.version>2.8.0</commons-io.version>
     <commons-lang3.version>3.7</commons-lang3.version>
     <commons-logging.version>1.1.3</commons-logging.version>
     <commons-logging-api.version>1.1</commons-logging-api.version>

---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org