diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java index ff36db080b2..6ed239e5abd 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/MemoryContext.java @@ -177,7 +177,7 @@ final class MemoryContext { var file = descriptor.sourceRootPath().resolve(path); // Trivial case: no matching source file exists - if (Files.notExists(file)) return null; + if (!Files.exists(file)) return null; // Compile source file (unit) with similar options as the program. var opts = options.forSubsequentCompilations(); diff --git a/test/langtools/tools/javac/launcher/GetResourceTest.java b/test/langtools/tools/javac/launcher/GetResourceTest.java index 095a43f39f1..4b46cb034ee 100644 --- a/test/langtools/tools/javac/launcher/GetResourceTest.java +++ b/test/langtools/tools/javac/launcher/GetResourceTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8210009 + * @bug 8210009 8321739 * @summary Source Launcher classloader should support getResource and getResourceAsStream * @enablePreview * @modules jdk.compiler @@ -41,7 +41,7 @@ import toolbox.ToolBox; /* * The body of this test is in ${test.src}/src/p/q/CLTest.java, - * which is executed in single-file source-launcher mode, + * which is executed in source-launcher mode, * in order to test the classloader used to launch such programs. */ public class GetResourceTest { diff --git a/test/langtools/tools/javac/launcher/src/java b/test/langtools/tools/javac/launcher/src/java new file mode 100644 index 00000000000..b1478523807 --- /dev/null +++ b/test/langtools/tools/javac/launcher/src/java @@ -0,0 +1 @@ +A text file named `java` to simulate https://bugs.openjdk.org/browse/JDK-8321739