RFR [14]: 8227438: [TESTLIB] Determine if file exists by Files.exists in function FileUtils.deleteFileIfExistsWithRetry

Frank Yuan frank.yuan at oracle.com
Fri Jul 12 06:32:46 UTC 2019


Hi

 

Would you like to review the following patch for 

Bug: https://bugs.openjdk.java.net/browse/JDK-8227438 

 

--- a/test/lib/jdk/test/lib/util/FileUtils.java      Thu Jul 11 15:58:54 2019 +0000

+++ b/test/lib/jdk/test/lib/util/FileUtils.java   Fri Jul 12 13:33:30 2019 +0800

@@ -96,7 +96,7 @@

      */

     public static void deleteFileIfExistsWithRetry(Path path) throws IOException {

         try {

-            if (Files.exists(path)) {

+            if (!Files.notExists(path)) {

                 deleteFileWithRetry0(path);

             }

         } catch (InterruptedException x) {

 

 

Files.exists returns false if the existence cannot be determined, so replace it with "!Files.notExists" like the change in
JDK-8184961.

 

Thanks

Frank

 



More information about the core-libs-dev mailing list