Replacing default FileSystemProvider
Alan Bateman
Alan.Bateman at oracle.com
Sun Mar 21 09:15:30 UTC 2021
On 21/03/2021 08:35, Michael Hall wrote:
> :
>
> So far I haven’t been able to duplicate the error with the simple test
> case. The error does appear to begin right after 1.8 at java 9.
>
> It seems similar to these issues…
> https://bugs.openjdk.java.net/browse/JDK-8058876
> <https://bugs.openjdk.java.net/browse/JDK-8058876>. Overriding the
> default file system provider fails with a modular image
> https://bugs.openjdk.java.net/browse/JDK-8059939
> <https://bugs.openjdk.java.net/browse/JDK-8059939>. java/nio/file/spi/SetDefaultProvider.java
> fails with modular image
>
Those issues were in the jigsaw repo so didn't impact any GA release.
That said, there has been refactoring in this area since JDK 8 in order
to allow access to the file system during VM initialization. This all
happens before a custom file system provider is located and set. So are
you saying that the NPE started with JDK 9 or a more recent release? We
have tests that exercise this mechanism so I would be surprised if there
is something fundamentally broken. The only other thing that comes to
mind is the zip/JAR code which has changed significantly in recent
releases (the zip/JAR code needs to use the builtin file system provider
when accessing the file system to load the custom file system provider).
Finally, just to rule this out, your provider isn't making direct use of
the sun.nio.* classes, right?
-Alan
More information about the nio-dev
mailing list