3 ms·
Private APIs have been starting to be restricted in previous versions already, requiring command line flags like add-exports=jdk.compiler/com.sun.tools.javac.ap
by dtech 2y ago
Private APIs have been starting to be restricted in previous versions already, requiring command line flags like add-exports=jdk.compiler/com.sun.tools.javac.api
- pron 2y agoYes, those restrictions were turned on by default at runtime starting in JDK 16 (and at compile-time starting in JDK 9), but they specifically did not include Unsafe [1] precisely because it's been widely used for capabilities for which there were no supported replacements. Capabilities requiring access to other internals -- such as jdk.compiler/com.sun.tools.javac.api -- do not have supported replacements as they can violate the specification in ways that the specification exists to prevent. [1]: https://openjdk.org/jeps/260#Critical-internal-APIs-not-encapsulated-in-JDK-9 https://openjdk.org/jeps/260#Critical-internal-APIs-not-enca...