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

A return value of zero from java.io.File#lastModified() is ambiguous

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 10
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      The currently public specification of java.io.File#lastModified() as given below is ambiguous if the last-modified time of an actually extant file is exactly the epoch because the return value would per the specification indicate that the file does not exist.

      Returns:
          A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs
      Throws:
          SecurityException - If a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the file

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                bpb Brian Burkhalter
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: