JEP 403 (openjdk.java.net/jeps/403) will finally finish the trek towards strong encapsulation by only allowing access to internal APIs that were explicitly broken into with --add-export/--add-opens. No more blanket --illegal-access! So... what exactly are internal APIs? 🧵 1/9
We need to look at the following packages: 1. sun.* 2. com.sun.* First is easy (almost): All sun.* packages are internal *except* for sun.misc, which is exported/opened by the module jdk.unsupported. That gives it a grace period until fully replaced by standard APIs. 2/9
Second is more complicated. I'll mostly quote a mail from Alex Buckley to jdk-dev (mail.openjdk.java.net/pipermail/jdk-…). "All of the com.sun namespace is JDK-specific -- it's not part of the Java SE Platform API." ⇝ There can be JDKs out there that don't contain it. 3/9