Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9144

FindBugs reports new warnings in branch-trunk-win

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • trunk-win
    • trunk-win
    • fs
    • None
    • Reviewed

    Description

      Testing the merge from branch-trunk-win to trunk, we saw some new FindBugs warnings that need to be fixed.

      Attachments

        Issue Links

          Activity

            cnauroth Chris Nauroth added a comment -

            https://builds.apache.org/job/PreCommit-HADOOP-Build/1871//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html

            For the string comparisons in Path, we can replace == with String#equals.

            For FileUtil#setPermission, we need to make sure that all paths through the code use checkReturnValue after each API call to change permissions.

            cnauroth Chris Nauroth added a comment - https://builds.apache.org/job/PreCommit-HADOOP-Build/1871//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html For the string comparisons in Path , we can replace == with String#equals . For FileUtil#setPermission , we need to make sure that all paths through the code use checkReturnValue after each API call to change permissions.
            cnauroth Chris Nauroth added a comment -

            The attached patch fixes the new FindBugs warnings.

            cnauroth Chris Nauroth added a comment - The attached patch fixes the new FindBugs warnings.
            arp Arpit Agarwal added a comment -

            +1

            arp Arpit Agarwal added a comment - +1
            cnauroth Chris Nauroth added a comment -

            To clarify, this patch fixes these 2 FindBugs warnings:

            Comparison of String parameter using == or != in org.apache.hadoop.fs.Path.normalizePath(String, String)
            Bug type ES_COMPARING_PARAMETER_STRING_WITH_EQ (click for details)
            In class org.apache.hadoop.fs.Path
            In method org.apache.hadoop.fs.Path.normalizePath(String, String)
            Actual type String
            At Path.java:[line 202]

            org.apache.hadoop.fs.FileUtil.setPermission(File, FsPermission) ignores exceptional return value of java.io.File.setWritable(boolean, boolean)
            Bug type RV_RETURN_VALUE_IGNORED_BAD_PRACTICE (click for details)
            In class org.apache.hadoop.fs.FileUtil
            In method org.apache.hadoop.fs.FileUtil.setPermission(File, FsPermission)
            Called method java.io.File.setWritable(boolean, boolean)
            At FileUtil.java:[line 705]

            cnauroth Chris Nauroth added a comment - To clarify, this patch fixes these 2 FindBugs warnings: Comparison of String parameter using == or != in org.apache.hadoop.fs.Path.normalizePath(String, String) Bug type ES_COMPARING_PARAMETER_STRING_WITH_EQ (click for details) In class org.apache.hadoop.fs.Path In method org.apache.hadoop.fs.Path.normalizePath(String, String) Actual type String At Path.java: [line 202] org.apache.hadoop.fs.FileUtil.setPermission(File, FsPermission) ignores exceptional return value of java.io.File.setWritable(boolean, boolean) Bug type RV_RETURN_VALUE_IGNORED_BAD_PRACTICE (click for details) In class org.apache.hadoop.fs.FileUtil In method org.apache.hadoop.fs.FileUtil.setPermission(File, FsPermission) Called method java.io.File.setWritable(boolean, boolean) At FileUtil.java: [line 705]

            +1. Committed to branch-trunk-win. Thank you Chris.

            sureshms Suresh Srinivas added a comment - +1. Committed to branch-trunk-win. Thank you Chris.

            People

              cnauroth Chris Nauroth
              cnauroth Chris Nauroth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: