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

ZipEntry/JarEntry.setCreation/LastAccessTime(null) don't throw NPE as specified

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b53
    • Verification:
      Verified

      Backports

        Description

        (This is a tck-red/conformance clone of JDK-8065536)

        Spec for the methods
        http://docs.oracle.com/javase/8/docs/api/java/util/zip/ZipEntry.html#setCreationTime-java.nio.file.attribute.FileTime-
        http://docs.oracle.com/javase/8/docs/api/java/util/zip/ZipEntry.html#setLastAccessTime-java.nio.file.attribute.FileTime-

        says:

        "Throws:
        NullPointerException - if the time is null"


        However the implementation doesn't satisfy this assertion, the following code will produce no exceptions:

                new ZipEntry("entry").setCreationTime(null);
                new ZipEntry("entry").setLastAccessTime(null);
                new JarEntry("entry").setCreationTime(null);
                new JarEntry("entry").setLastAccessTime(null);


        The following JCK9 tests will fail due to this:

        api/java_util/jar/JarEntry/autd2.html#CreationTime[nullCreationTime]
        api/java_util/jar/JarEntry/autd2.html#LastAccessTime[nullCreationTime]
        api/java_util/zip/ZipEntry/autd2.html#LastAccessTime[nullCreationTime]
        api/java_util/zip/ZipEntry/autd2.html#CreationTime[nullCreationTime]


          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sherman Xueming Shen
                Reporter:
                dbessono Dmitry Bessonov
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: