Skip to content

Commit

Permalink
8321739: Source launcher fails with "Not a directory" error
Browse files Browse the repository at this point in the history
Reviewed-by: jlahoda
  • Loading branch information
sormuras committed Dec 12, 2023
1 parent 5718039 commit df4ed7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ byte[] compileJavaFileByName(String name) {
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();
Expand Down
4 changes: 2 additions & 2 deletions test/langtools/tools/javac/launcher/GetResourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/*
* @test
* @bug 8210009
* @bug 8210009 8321739
* @summary Source Launcher classloader should support getResource and getResourceAsStream
* @enablePreview
* @modules jdk.compiler
Expand All @@ -41,7 +41,7 @@

/*
* 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 {
Expand Down
1 change: 1 addition & 0 deletions test/langtools/tools/javac/launcher/src/java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A text file named `java` to simulate https://bugs.openjdk.org/browse/JDK-8321739

1 comment on commit df4ed7e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.