[jdk16] RFR: 8259028: ClassCastException when using custom filesystem with wrapper FileChannel impl [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Jan 6 17:57:59 UTC 2021

On Wed, 6 Jan 2021 17:51:20 GMT, Uwe Schindler <uschindler at openjdk.org> wrote:

> Another option would have been to just check the class with instanceof. If the FileChannel returned by the path's filesystem has wrong type, it won't work. If we have some custom filesystem that just returns the original FileChannelImpl but does some additional checks before or after (e.g to hide some files from user), this would still work.

We considered this - but we opted for better clarity and alignment with existing APIs.


PR: https://git.openjdk.java.net/jdk16/pull/90

More information about the core-libs-dev mailing list