On Mon, 21 Mar 2022 18:17:06 GMT, Mandy Chung <[email protected]> wrote:
> > $ javac com/acme/*.java
> > is fine. Am I missing something?
>
> If you make P.Q private, it will fail the compilation.
>
Yes, I got that part. I did make a comment earlier ("Two of those subclasses
are nested "private" in another class and hence cannot be referred from
DelegatingMethodHandle's permits clause, right?"). My example was in response
to "I did try to name the nested type in the permits clause, and it was not
accepted by javac." comment by @jddarcy. I wondered if there is any other issue
with permits beyond private access of those 2 nested classes.
> To make `DelegatingMethodHandle` a sealed class, we could make
> `AsVarargsCollector` and `WrappedMember` package-private classes.
right.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7881