RFR: 8298658: Platform-specific type leaks to platform independent code.

Alan Bateman alanb at openjdk.org
Fri Jan 27 07:16:17 UTC 2023


On Wed, 14 Dec 2022 13:37:32 GMT, Alfonso² Peterssen <duke at openjdk.org> wrote:

> This is not a cosmetic change, it enforces the isolation of platform-specific code from the user-facing API.
> 
> `sun.nio.fs.DefaultFileSystemProvider#instance()` has a platform-specific return type. This makes the platform-independent `java.nio.file.FileSystems.DefaultFileSystemHolder#getDefaultProvider()` have a platform-dependent call e.g. INVOKESTATIC with different signatures.
> 
> The platform-specific return types were introduced in [JDK-8213406](https://bugs.openjdk.org/browse/JDK-8213406), the common SPI type was used before. There's no reason to leak types to platform-independent code, except for tests, which could just cast.
> 
> This change is motivated by [Espresso](https://github.com/oracle/graal/tree/master/espresso), a meta-circular, spec-compliant JVM written in Java. Espresso aims to provide a custom Java IO/NIO implementation on top of any vanilla JDK as a viable alternative to the imminent removal of `SecurityManager`.

The JBS was resolved as "Incomplete" in December, this is why the bot has added "Issue is not open" in the link.

This change has no impact on the JDK but the JBS and/or PR needs to provide more context. Are you combining the classes from several builds and trying to de-duplicate or something else?

-------------

PR: https://git.openjdk.org/jdk/pull/11674


More information about the nio-dev mailing list