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

When pathname is test.xls the java.io.File#exists returns true, it's incorrect

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      windows10 / java version "1.8.0_211"

      A DESCRIPTION OF THE PROBLEM :
          @Test
          public void testFileExist() {
              File xlsFile = new File("test.xls");
              System.out.println(xlsFile.exists());// true

              File xlsFile2 = new File("test2.xls");
              System.out.println(xlsFile2.exists());// false

              File txtFile = new File("test.txt");
              System.out.println(txtFile.exists());// false
          }


            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: