RFR: JDK-8283416: Update java.lang.invoke.MethodHandle to use sealed classes
Athijegannathan Sundararajan
sundar at openjdk.java.net
Tue Mar 22 04:03:31 UTC 2022
On Mon, 21 Mar 2022 18:17:06 GMT, Mandy Chung <mchung at openjdk.org> 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
More information about the core-libs-dev
mailing list