On Sun, 20 Mar 2022 21:31:15 GMT, Joe Darcy <da...@openjdk.org> wrote:

> Small refactoring to use sealed classes in the MethodHandle implementation 
> hierarchy.
> 
> DelegatingMethodHandle is non-sealed rather than sealed since it has two 
> subclasses, one defined as a nested class and only a separate type in the 
> same package. The permits clause does not allow listed those two kinds of 
> subclasses.
> 
> Please also review the corresponding CSR 
> https://bugs.openjdk.java.net/browse/JDK-8283434

But the private inner classes are visible to the compiled `PermittedSubclasses` 
class attribute (otherwise it wouldn’t be possible for private inner classes to 
extend a sealed outer class with an implicit `permits` clause).

---

Technically, `private` means accessible only within the current nest.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7881

Reply via email to