RFR: 8331467: ImageReaderFactory can cause a ClassNotFoundException if the default FileSystemProvider is not the system-default provider [v2]
jyxzwd
duke at openjdk.org
Wed Nov 20 17:30:17 UTC 2024
On Wed, 20 Nov 2024 14:11:51 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> I don't think we should be doing this. Did you try the direction of checking the defining class loader that I outlined in the previous comment?
yeah,I tested it a few mins ago.It works well in the situation mentioned in the issue and in the normal situation, also when a remote/target jdk is set. But I have a doubt, when only using the local jdk, no remote/targetjdk, that is, ImageReaderFactory.class.getClassLoader() will be null, when loading any class located in the runtime image, BOOT_MODULES_JIMAGE will always be the path provided by the built-in default FileSystemProvider. The user-defined FileSystemProvider will make no contribution to loading the classes that exist in the image in this case.Although the built-in default FileSystemProvider is sufficient, are my concerns redundant?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21997#issuecomment-2489173647
More information about the core-libs-dev
mailing list