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

File.exists() returns false negative

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 7
    • core-libs
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 Professional 64 Service Pack 1,
      Windows XP 32,
      not tested on other systems

      A DESCRIPTION OF THE PROBLEM :
      Save file to a disk through (tested with images). Call File.exists(). It may return false even when the file can be opened by other applications. Typically consistent within a session (either correct or not). Some stream operations and libraries, like ImageIO, will fail too.

      Strange behavior: when the problem occurs 'file.exists()' will return false but 'Files.isReadable(file.toPath())' will return true.

      REGRESSION. Last worked in version 6u26

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      It is more frequent in a particular situation. I create a Windows COM server in Java (with help of ComfyJ library). The Java COM server is called from .NET. Errors are frequent, but not consistent.
      When the same code is executed directly on the same JVM (without COM interface), error is quite difficult to reproduce.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      File.exists() returns true if file is on the disk
      ACTUAL -
      File.exists() returns false if file is on the disk

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      no error messages

      REPRODUCIBILITY :
      This bug can be reproduced often.

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: