Slide 40
Slide 40 text
@elderjava
40
JEP 403: Strongly Encapsulate JDK Internals
• This JEP is part of the famous Project Jigsaw (and no, it wasn’t only about
modules)
• Its main purpose is to discourage the usage of the JDK internals
• Since the JDK 9 and until JDK 16 it was using the “relaxed strong encapsulation”
as standard, which means that it was still possible to access all internals that was
available since JDK 8 (mainly for migration reasons)
• Starting with JDK 17, they switched to the “strong encapsulation” standard, where
all non-public elements from exported packages are unavailable, and all
elements from non-exported packages are unavailable as well
• This change aims to improve both the maintainability and security
• For example, some internal elements have the privilege to define a class in a
specific class loader, or even to access sensitive data like cryptography keys