diff --git a/test/lib/jdk/test/lib/util/FileUtils.java b/test/lib/jdk/test/lib/util/FileUtils.java index 016e76b6bae..b7dabc62fa1 100644 --- a/test/lib/jdk/test/lib/util/FileUtils.java +++ b/test/lib/jdk/test/lib/util/FileUtils.java @@ -97,7 +97,7 @@ public static void deleteFileWithRetry(Path path) throws IOException { */ public static void deleteFileIfExistsWithRetry(Path path) throws IOException { try { - if (Files.exists(path)) { + if (!Files.notExists(path)) { deleteFileWithRetry0(path); } } catch (InterruptedException x) {