On Wed, 6 Jan 2021 16:10:12 GMT, Maurizio Cimadamore <mcimadamore@openjdk.org> wrote:
This patch tweaks `MemorySegment::mapFile` so that it will throw `IllegalArgumentException` whenever the path to be mapped is associated with a custom file system provider.
The check in the implementation is heavily borrowed by what `UnixDomainSocketAddress::of(Path)` does (thanks Alan for the tip!). Not only we have to check if file system is the default one, but also if the default FS belongs to java.base (since that can be overridden).
The test simply check that paths coming from the (internal) JRT file system are not supported by the factory.
CSR: https://bugs.openjdk.java.net/browse/JDK-8259321 ------------- PR: https://git.openjdk.java.net/jdk16/pull/90