RFR: 8177650: JShell tool: packages in classpath don't appear in completions [v2]
Christian Stein
cstein at openjdk.org
Mon Jul 7 13:09:43 UTC 2025
On Mon, 7 Jul 2025 12:43:57 GMT, Christian Stein <cstein at openjdk.org> wrote:
>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Avoiding problems with locked files on Windows.
>
> test/langtools/jdk/jshell/ToolCompletionTest.java line 196:
>
>> 194: Files.createDirectories(lib);
>> 195: compiler.jar(p1, jarName, "p1/p2/Test.class", "p1/p3/Test.class");
>> 196: Files.move(compiler.getPath(p1.resolve(jarName)), lib.resolve(jarName));
>
> Suggestion:
>
> Files.copy(compiler.getPath(p1.resolve(jarName)), lib.resolve(jarName));
>
>
> Prevent `java.nio.file.FileSystemException` on Windows:
>
>
> ToolCompletionTest.d\\tool_completion_test\\dir1\\test.jar -> tool_completion_test\\lib\\test.jar: The process cannot access the file because it is being used by another process
>
>
> Seems like `compiler.jar(p1, jarName, "p1/p2/Test.class", "p1/p3/Test.class");` keeps an open file handle to the created `JAR` file.
Superseded by https://github.com/openjdk/jdk/pull/26137/commits/54eed125f92aeb016502a8c06b2f284d4e4d4ded
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26137#discussion_r2190028046
More information about the kulla-dev
mailing list