This is more than a cosmetic issue.
sun.nio.fs.DefaultFileSystemProvider#instance() leaks the platform-dependent type to platform-independent code.
Currently, callers of sun.nio.fs.DefaultFileSystemProvider#instance() must issue calls with different signatures on every OS because the target method signature needlessly use {Linux|Windows|Aix|MacOSX}FileSystemProvider, instead of the common FileSystemProvider type.
For example, java.nio.file.FileSystems.DefaultFileSystemHolder#getDefaultProvider() generates different bytecodes (INVOKESTATIC with different signatures) on every OS.
We stumbled upon this leakage while working on Espresso (a spec-compliant JVM written in Java, part of the GraalVM project), where we provide an alternative file system to overcome the deprecation of the SecurityManager.
While we have a workaround in Espresso, a tiny cleanup upstream is desirable.
These are internal APIs, there's no risk of breakage of any user code.
sun.nio.fs.DefaultFileSystemProvider#instance() leaks the platform-dependent type to platform-independent code.
Currently, callers of sun.nio.fs.DefaultFileSystemProvider#instance() must issue calls with different signatures on every OS because the target method signature needlessly use {Linux|Windows|Aix|MacOSX}FileSystemProvider, instead of the common FileSystemProvider type.
For example, java.nio.file.FileSystems.DefaultFileSystemHolder#getDefaultProvider() generates different bytecodes (INVOKESTATIC with different signatures) on every OS.
We stumbled upon this leakage while working on Espresso (a spec-compliant JVM written in Java, part of the GraalVM project), where we provide an alternative file system to overcome the deprecation of the SecurityManager.
While we have a workaround in Espresso, a tiny cleanup upstream is desirable.
These are internal APIs, there's no risk of breakage of any user code.
- links to
-
Review openjdk/jdk/11674