haiyang1987 commented on a change in pull request #2974:
URL: https://github.com/apache/hadoop/pull/2974#discussion_r635970022
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
##########
@@ -604,18 +604,12 @@ public static long getDU(File dir) {
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)) {
Review comment:
Should try catch performed here ?
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]