8283416: Update java.lang.invoke.MethodHandle to use sealed classes

Reviewed-by: sundar, mchung
This commit is contained in:
Joe Darcy 2022-03-24 19:08:23 +00:00
parent 90750decb4
commit f16244509d
6 changed files with 23 additions and 17 deletions

View file

@ -448,7 +448,7 @@ abstract class MethodHandleImpl {
return new AsVarargsCollector(target, arrayType);
}
private static final class AsVarargsCollector extends DelegatingMethodHandle {
static final class AsVarargsCollector extends DelegatingMethodHandle {
private final MethodHandle target;
private final Class<?> arrayType;
private @Stable MethodHandle asCollectorCache;
@ -705,7 +705,7 @@ abstract class MethodHandleImpl {
* Behavior in counting and non-counting states is determined by lambda forms produced by
* countingFormProducer & nonCountingFormProducer respectively.
*/
static class CountingWrapper extends DelegatingMethodHandle {
static final class CountingWrapper extends DelegatingMethodHandle {
private final MethodHandle target;
private int count;
private Function<MethodHandle, LambdaForm> countingFormProducer;
@ -1299,7 +1299,7 @@ abstract class MethodHandleImpl {
}
/** This subclass allows a wrapped method handle to be re-associated with an arbitrary member name. */
private static final class WrappedMember extends DelegatingMethodHandle {
static final class WrappedMember extends DelegatingMethodHandle {
private final MethodHandle target;
private final MemberName member;
private final Class<?> callerClass;