JDK-8256358 : Release Note: JEP 396: Strongly Encapsulate JDK Internals by Default
  • Type: Sub-task
  • Component: core-libs
  • Affected Version: 16
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2020-11-13
  • Updated: 2022-01-04
  • Resolved: 2022-01-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16Resolved
Description
Strongly encapsulate all internal elements of the JDK by default, except
for [critical internal APIs][crit] such as `sun.misc.Unsafe`.  Allow end
users to choose the relaxed strong encapsulation that has been the
default since JDK 9.

With this change, the default value of the launcher option
[`--illegal-access`][relax] is now `deny` rather than `permit`.  As a
consequence, existing code that uses most internal classes, methods, or
fields of the JDK will fail to run.  Such code can be made to run on
JDK 16 by specifying `--illegal-access=permit`.  That option will,
however, be removed in a future release.

For further details, please see [JEP 396](https://openjdk.java.net/jeps/396).

[crit]: https://openjdk.java.net/jeps/260#Description
[relax]: https://openjdk.java.net/jeps/261#Relaxed-strong-encapsulation