[jdk16] RFR: 8259028: ClassCastException when using custom filesystem with wrapper FileChannel impl [v2]
alanb at openjdk.java.net
Wed Jan 6 16:44:01 UTC 2021
On Wed, 6 Jan 2021 16:32:17 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.
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> Simplify test not to depend on JDK internals
Marked as reviewed by alanb (Reviewer).
More information about the core-libs-dev