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

(fs) Files.setLastModifiedTime(path, null) does not throw NPE

XMLWordPrintable

    • b42
    • Verified

        According to spec of java.nio.file package:
        "Unless otherwise noted, passing a null argument to a constructor or method of any class or interface in this package will cause a NullPointerException to be thrown. Additionally, invoking a method with a collection containing a null element will cause a NullPointerException, unless otherwise specified."

        if second argument passes as null of j.n.f.Files.setLastModifiedTime(Path, FileTime), NPE is not thrown:
        Files.setLastModifiedTime(file.toPath(), (FileTime) null)

        Tested with JDK9b35
        Failed JCK test is under development.

              alanb Alan Bateman
              asolodkaya Anastasiya Solodkaya (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: