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

Inconsistent exception specifications in FileUtils#chmod

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Incompatible change

    Description

      There are two FileUtils#chmod methods:

      public static int chmod(String filename, String perm
                                ) throws IOException, InterruptedException;
      public static int chmod(String filename, String perm, boolean recursive)
                                  throws IOException;
      

      The first one just calls the second one with recursive = false, but despite that it is declared as throwing InterruptedException, something the second one doesn't declare.

      The new Java7 chmod API, which we will transition to once JDK6 support is dropped, does not throw InterruptedException

      See http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#setOwner(java.nio.file.Path, java.nio.file.attribute.UserPrincipal)

      So we should make these consistent by removing the InterruptedException

      Attachments

        1. HADOOP-9646.001.patch
          0.7 kB
          Colin McCabe
        2. HADOOP-9646.002.patch
          1 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: