On Mon, 8 Jun 2026 12:25:36 GMT, Alan Bateman <[email protected]> wrote:

> I think we should also change jrtfs so that FileSystem::close does its best 
> to cleanup and not leave files open.

Automatic cleanup on FileSystem::close could be problematic. Consider the 
following code snippet:

FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), 
Map.of("java.home", targetJavaHome));
FileSystemProvider provider = fs.provider();
fs.close(); // URLClassLoader is closed automatically now
...
FileSystem newFs = provider.newFileSystem(URI.create("jrt:/"), Map.of());
// Now any call to newFs instance that require additional class loading crashes

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31417#issuecomment-4649932110

Reply via email to