src/share/classes/java/io/File.java

Print this page

        

@@ -1998,11 +1998,11 @@
                                           : TempDirectory.location();
         File f;
         try {
             do {
                 f = TempDirectory.generateFile(prefix, suffix, tmpdir);
-            } while (f.exists());
+            } while ((fs.getBooleanAttributes(f) & FileSystem.BA_EXISTS) != 0);
             if (!f.createNewFile())
                 throw new IOException("Unable to create temporary file");
         } catch (SecurityException se) {
             // don't reveal temporary directory location
             if (directory == null)