[jdk16] Integrated: 8259028: ClassCastException when using custom filesystem with wrapper FileChannel impl
mcimadamore at openjdk.java.net
Mon Jan 11 16:18:02 UTC 2021
On Wed, 6 Jan 2021 16:10:12 GMT, Maurizio Cimadamore <mcimadamore at 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.
This pull request has now been integrated.
Author: Maurizio Cimadamore <mcimadamore at openjdk.org>
Stats: 20 lines in 3 files changed: 14 ins; 1 del; 5 mod
8259028: ClassCastException when using custom filesystem with wrapper FileChannel impl
Reviewed-by: chegar, alanb, uschindler
More information about the core-libs-dev