@ Paulsm4's explanation is good enough to know whether to use it further or not.
Long Answer ~ JEP 260: Encapsulate Most Internal APIs
Why did they decide to remove / depreciate API support for a long time?
Utility
In the JEP 200 Modular JDK , restricting access to non-standard, intermittent, and unsupported APIs that are internal parts of the JDK implementation, using the JEP 261 Module System improves the integrity and security of the platform , as many of these internal APIs define privileged, security-sensitive operations. In the long run, this change will reduce the costs that accompany the JDK itself and the libraries and applications that, consciously or not, use these internal APIs.
Are all internal APIs planned?
Category
The above internal JDK APIs fall into two broad categories: -
Non-critical internal APIs that do not appear to be used by code outside the JDK or are used by external code just for convenience.
Critical internal APIs that provide critical functionality that would be difficult, if not impossible, to implement outside the JDK itself (for example, sun.misc.Unsafe ).
What if someone translates code that already uses Unsafe , but ultimately plans to move away?
sun.misc.Unsafe
Its one of those critical internal APIs that are not encapsulated in JDK 9, since supported replacements did not exist in JDK 8 when at the same time most other APIs were encapsulated or deprecated for removal in future releases.
Is sun.misc.Unsafe public in JDK9?
Using
Currently, to access a critical internal API, such as Unsafe , you need to determine the dependency on the jdk.unsupported module, which is defined specifically for this purpose:
module jdk.unsupported { exports sun.misc; opens sun.misc; ... }
➜ As far as he could answer your question, you won’t be able to find this documented module, possibly to limit the users from using this and, obviously, a sign to avoid it, to make it “publicly available”.
source share