-
Notifications
You must be signed in to change notification settings - Fork 3k
Set context class loader to the system one when loading the default filesystem providers #9774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ile system providers
|
This does not seem right. FileSystemProvider is part of the JDK, there should never be multiple implementations of it (in fact you can't have multiple impls, because the JDK will stop you). |
|
Have you checked the original issue? |
|
This must be because the FS lookup is not using the TCCL, but some other provider is. Is there any reason why we don't pass the TCCL to the ServiceLoader here? |
|
It is using the TCCL but the JDK is using the system classloader to load the "installed" providers. The test deps are visible to the system classloader so this is where it picks it up. |
|
Well, the JDK actually allows you to provide your own classloader which we don't in this specific case. But even if we did it wouldn't affect this use-case. Because it always loads the providers from the system classloader first and then from the user provided cl. |
|
Looks at java.nio.file.spi.FileSystemProvider.loadInstalledProviders() |
|
Looks like there is not much else that can be done here. The global provider list is being loaded from the system CL, but then if the TCCL is set the sshd provider attempts to use the TCCL to load some classes. |
Fixes #9017
Fixes #7424
These two issues were reported by the same user. They are different but both reproducers are affected by #9017