Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8299864

ZipFileStore#supportsFileAttributeView(String) doesn't throw NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 21
    • 13, 17, 21
    • core-libs
    • None
    • 13
    • b05

    Description

      I've noticed that ZipFileStore#supportsFileAttributeView(String)
      doesn't throw NullPointerException when 'null' is passed as an
      argument.

      public boolean supportsFileAttributeView(String name) {
          return "basic".equals(name) || "zip".equals(name) ||
                 (("owner".equals(name) || "posix".equals(name)) && zfs.supportPosix);
      }

      Package level javadoc for {{java.nio.file}} package mentions that NullPointerException is expected from all methods which pass {{null}}:

      >Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown.

      Other JDK implementations of FileStore throw NPE in this method in case of null.

      Attachments

        Issue Links

          Activity

            People

              pminborg Per-Ake Minborg
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: