Integrated: 8331467: FileSystems.getDefault fails with ClassNotFoundException if custom default provider is in run-time image

liyazzi duke at openjdk.org
Fri Dec 20 07:08:41 UTC 2024


On Sat, 7 Dec 2024 07:29:05 GMT, liyazzi <duke at openjdk.org> wrote:

> For two cases:
> 
> 1. When the ImageReaderFactory was loaded by local jdk,that means the ImageReaderFactory was loaded by boot class loader,then init the `Path BOOT_MODULES_JIMAGE` by using `sun.nio.fs.DefaultFileSystemProvider` which is obtained through reflection,due to it is in jdk internal.
> 2. When loaded by a target jdk, such as jdk8 runtime, then use the Java 8 compatible APIs: `FileSystems.getDefault()` to init the `BOOT_MODULES_JIMAGE` field.
> Then we can avoid the circular dependencies in class loading caused by loading the defaultSystemProvider.

This pull request has now been integrated.

Changeset: 54f34750
Author:    liyazzi <youngjyx at gmail.com>
Committer: Alan Bateman <alanb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/54f34750edb284f4a49fb86c3939491211eb98fe
Stats:     24 lines in 2 files changed: 17 ins; 3 del; 4 mod

8331467: FileSystems.getDefault fails with ClassNotFoundException if custom default provider is in run-time image

Reviewed-by: alanb, jpai

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

PR: https://git.openjdk.org/jdk/pull/22628


More information about the core-libs-dev mailing list