8321739: Source launcher fails with "Not a directory" error

Reviewed-by: jlahoda
This commit is contained in:
Christian Stein 2023-12-12 15:26:21 +00:00
parent 5718039a46
commit df4ed7eff7
3 changed files with 4 additions and 3 deletions

View File

@ -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();

View File

@ -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 {

View File

@ -0,0 +1 @@
A text file named `java` to simulate https://bugs.openjdk.org/browse/JDK-8321739